Jump to content

Prolog newbie question

- - - - -

  • Please log in to reply
No replies to this topic

#1
misao

misao

    Newbie

  • Members
  • Pip
  • 9 posts
Hey, I've been trying to query this knowledgebase:

dog (fido, labrador, black, big)
dog (spot, terrier, white, medium)
dog (snoopy, beagle, black, medium)

So let's say I want to get a listing of the names all black dogs, for example. That would be snoopy and fido. How do I do this? I can't just do ?- dog (Name,black) because the arity wouldn't match. But if I do something like ?- dog (Name, Breed, black, Size) then it would display more information than I want (I want just the names of black dogs).




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users