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?
Asked
Active
Viewed 1,668 times
2 Answers
8
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.

Fred Foo
- 355,277
- 75
- 744
- 836
-
4Wouldn't `false :- fail.` be a clearer definition, since you somehow imply that they have the same effect and/or are synonyms? – Giulio Piancastelli Nov 13 '10 at 10:01
-
What I meant was: if neither is available, this is how implement one of them. Changed my answer. – Fred Foo Nov 13 '10 at 12:21
-
4In the meantime, ISO Prolog now has both `fail` and `false`. It is available in GNU and many other systems. – false Feb 16 '12 at 23:26
4
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.

false
- 10,264
- 13
- 101
- 209