users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

beginner question


From: Luca Ciciriello
Subject: beginner question
Date: Sun, 9 May 2010 15:52:41 +0200

Hi All.
I'm moving the first steps in the world of logic programming and I've installed 
on MacOS X 10.6.3 the GNU prolog 1.3.1 compiler. 

To teach myself in Prolog I'm reading the book "Learn Prolog Now". In this book 
i've found some simple knowledge base and i've used the gprolog to test some 
example.

I've created the file test2.pl with the following content:

listensToMusic(mia). 
happy(yolanda). 
playsAirGuitar(mia) :- listensToMusic(mia). 
playsAirGuitar(yolanda) :- listensToMusic(yolanda). 
listensToMusic(yolanda):- happy(yolanda).

and I've loaded it in to interpreter typing [test2].

now the book is telling me that if I type at the prompt the query:

?- playsAirGuitar(yolanda).

the result i obtain is "yes".

My problem is that the result I obtain is a big "no".

Now, as student, I'm a bit confused.
Who is right and who is wrong?
The book or the interpreter?

Thanks in advance for any help.

Luca.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]