Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange problem?! I'm confused(getting false instead of true)

Status
Not open for further replies.

looloo1

Programmer
Mar 2, 2009
1
NL
Hi,

This is my first assignment for Prolog:

I have to make sure that:

?- like(artos,oscar). is TRUE!


these are the statements:

(a) Artos is a dog.
(b) Dogs are fourlegged mammals.
(c) Dogs like little children.
(d) Oscar is a little child.

and these are my clauses:

dogs(artos).
fourleggedmammals(dogs).
like(dogs,littlechild).
littlechild(oscar).

I really don't understand why it says FALSE?

Does someone have an idea? I really appreciate it.

 
You have mistakes in your database.
You must assert your facts :
Code:
dogs(artos).
littlechild(oscar).

You have to give your rules :
"Dogs like little children" ==>
Code:
like(X, Y) :-
  dog(X),
  littlechild(Y).
Now it runs !

You have to translate "Dogs are fourlegged mammals.".



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top