users-prolog
[Top][All Lists]
Advanced

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

Re: Newbie to GProlog - Is it ISO?


From: Daniel Diaz
Subject: Re: Newbie to GProlog - Is it ISO?
Date: Mon, 03 Dec 2001 10:55:38 +0100

Hello Paulo,

"Paulo J. Matos aka PDestroy" wrote:
> 
> Hi all,
> 
> I'm studying Prolog and my teacher recommends Sicstus
> Prolog. Although she recommends it I prefered Gprolog since it is
> free. But now I'm finding gprolog a bit strange. My Prolog book
> is Programming in Prolog (4th ed.) from Clocksin.
> There are two questions about predicated that show up in sicstus
> and in clocksin and afaik are not in gprolog. One is not. The
> negation predicate fails when its arguments succeeds and
> vice-versa.

GNU-Prolog is an ISO Prolog, thus use \+ for the negation, see:

http://gnu-prolog.inria.fr/manual/manual040.html#toc141

If you want a not:
not(Goal) :-
        \+ Goal.

> The other is randseq. It builds a sequence with numbers randomly
> ordered.
> 

Random numbers are not ISO... GNU Prolog provides a random number generator, 
see:

http://gnu-prolog.inria.fr/manual/manual047.html


> I've tried to write this function in gprolog but for that I need
> not, since there is no not and I can't write a not in prolog I'm
> stuck.
> 
> Can anybody help?
> 

Hope this helps.


-- 
Daniel Diaz   address@hidden
http://pauillac.inria.fr/~diaz
gprolog --version 2>&1 | sed -n -e 's/By //p'



reply via email to

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