Session 20


 

Learning about Prolog

I gave you an introduction to using Prolog in the labs, by playing with this knowledgebase

  1. hoosier(Schafer)
  2. x hoosier(x) -> likes (x,Basketball)
  3. x,y  childOf(x,y) AND likes (y, Basketball) -> likes (x,Basketball)
  4. y  likes(y,Basketball) -> likes(y,March)
  5. daughterOf(Margaret,Schafer)
  6. x,y daughterOf( x, y )-> childOf( x, y )
  7. hoosier(Wallingford)
  8. hoosier(Letterman)
  9. daughterOf(Sarah,Wallingford)