Prolog library: not.hlp
pereira at sri-unix.UUCP
pereira at sri-unix.UUCP
Mon Aug 15 15:57:09 AEST 1983
File: Util:Not.Hlp Author: R.A.O'Keefe Updated: 21 May 1983
#source.
The simple-minded not/1 lives in Util:Imisce.Pl.
Whenever you could use it, you aree strongly recommended to use \+ .
The suspicious not/1 lives in Util:Not.Pl.
#purpose.
The simple-minded not/1 was for compatibility with a long-dead version
of Dec-10 Prolog. It has been retained because some other Prologs use
it. However, it is always better to use \+ in Dec-10 Prolog, and it
is no worse in C Prolog.
There are problems with negated goals containing universally quantified
variables. For example, if you write
bachelor(X) :- \+married(X), male(X).
you will not be able to enumerate bachelors. To help you detect such
errors, there is a suspicious version of not/1 which will report any
negated goals containing universally quantified variables.
#commands.
The source only defines one public predicate: not/1.
If it detects an error, not/1 will switch on tracing and enter a
break.
not/1 understands the existential quantifier ^ . See the description
of bagof and setof in the Prolog manual to find out what that means.
More information about the Comp.sources.unix
mailing list