Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!munnari.oz.au!bruce!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.prolog Subject: Re: List of Folk Theorems Message-ID: <6473@goanna.cs.rmit.oz.au> Date: 24 Jun 91 08:52:13 GMT Article-I.D.: goanna.6473 References: <3470@geocub.UUCP> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 38 In article <3470@geocub.UUCP>, billaud@geocub.UUCP (Michel BILLAUD) QUOTES > What about: > > 5. If b is deterministic and followed by a !, you can switch them: > p :- a,...,b,!,c,... > p :- a,...,!,b,c,... This is false. Consider p :- fail, !. p :- !, fail. p :- write(yoo-hoo). p :- write(yoo-hoo). ?- p. ?- p. => yoo-hoo => no If b is determinate (not "deterministic") and cannot fail, _then_ you can switch them. > From csa09@seq1.keele.ac.uk Mon May 27 12:04:26 1991 > From: "P." Singleton > If a (deterministic) goal doesn't instantiate its arguments > any further (perhaps it has useful side-effects), then you > can replace it by > > \+ \+ goal The DEC-10 Prolog library defines gcc(G) :- \+ \+ X. It stands for "garbage collecting call". > Nota : \+ = not Note: in DEC-10 Prolog and Quintus Prolog 'not' is _not_ the same as "unprovable" \+ . In both Prologs, 'not' is not an evaluable predicate, but is defined in the library, and is defined to report an error when it won't be sound. Stick with \+ for portability. -- I agree with Jim Giles about many of the deficiencies of present UNIX.