users-prolog
[Top][All Lists]
Advanced

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

assert/1 and not/1 (Re: Newbie trouble with ebg from the CMU AI archive)


From: Timo Karjalainen
Subject: assert/1 and not/1 (Re: Newbie trouble with ebg from the CMU AI archive)
Date: Tue, 30 Jul 2002 16:50:57 +0300 (EEST)

On Tue, 30 Jul 2002 address@hidden wrote:

> For gprolog: assert/1 and not/1 are not defined in gprolog--use
> asserta/1 and '\+'/1 instead.

To minimize the hassle and maintain portability, I recommend simply
putting this snippet in a file called, for example, gnuprolog.pl:

----8<----
assert(A) :-
   asserta(A).   % Or assertz(), according to taste.

not(A) :-
   \+ A.
----8<----

and then including the file gnuprolog.pl when you are using GNU Prolog.

That way, you don't have to edit code to get it to run on GNU Prolog.

-- 
Timo Karjalainen             "I don't have a life.
                              I have a program."
                                   - Star Trek: Voyager





reply via email to

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