开发者

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

开发者 https://www.devze.com 2023-01-25 07:33 出处:网络
I\'ve bee开发者_开发知识库n 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? Use fa

I've bee开发者_开发知识库n 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?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号