newbie questions: re-execution, negation

Josh <[email protected]>
Newsgroups gmane.comp.gnu.prolog.general
Message-ID <[email protected]>
Hi.  I'm brand new to Prolog and am having trouble understanding some
of the results I get from the gprolog interpreter.  For instance, the
following simple program is meant to yield 'true' for both c(foo) and
c(bar):

a(foo).
a(bar).
b(foo).

c(X) :- a(X) ; b(X).

But in fact I get this:

| ?- c(foo).

true ? ;

yes
| ?- c(bar).

true ? ;

no

Could someone humor me and tell me why I am prompted for another
result after 'true' (and why the 'yes' after the first result and the
'no' after the second).  I get the same behavior if I use:

c(X) :- a(X).
c(X) :- b(X).

Also, I've had to define my own negation operator because if I try to
compile something like:

d(X) :- not a(X).

...I get an error:

/[...]/test.pl:29 error: syntax error: . or operator expected after
expression (char:13)
        1 error(s)
compilation failed

I've read most of TFM as well as a Prolog tutorial, but I don't see
why this shouldn't work.  Btw. this is gprolog 1.2.16 on i386 Linux.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.