Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't gnu prolog support the "false" predicate? (I've changed to swi)

I've been using the gprolog thingy to do some things in prolog. But now when testing some more code I discovered that it does not support "false". Which is supported by swi?

like image 847
Algific Avatar asked Dec 17 '22 20:12

Algific


2 Answers

Use fail instead of false. I believe the former is in the ISO standard for Prolog. Otherwise, define it yourself:

false :- 0=1.

or

fail :- 0=1.
like image 140
Fred Foo Avatar answered May 17 '23 09:05

Fred Foo


Recent versions of GNU Prolog (1.4.0) do support false/0.

false/0 is not defined in the original ISO standard of 1995, but is part of Cor.2:2012.

like image 44
false Avatar answered May 17 '23 08:05

false