A paper about mercury says the following:
The if-then-else and negation constructs in most variants of Prolog are non-logical and unsound: they can cause the system to compute answers which are inconsistent with the program viewed as a logical theory. Some existing logic programming systems such as NU-Prolog and Gödel provide logical and sound replacements for these Prolog constructs. Unfortunately, these systems enforce safety via runtime groundness checks. This effect can increase the runtime of a program by an arbitrarily large factor; if the goals checked for groundness include large terms, the checks can be prohibitively expensive.
NU-Prolog and Gödel look rather dead and non-free, but I still wonder:
- What are these logical and sound
if-then-else
replacements? - Do they have analogs in SWI or GNU Prologs?
- How do they work? How could they work? Adding logical negation to Prolog turns it into general FOL, right? You would basically need a general FOL theorem prover to work with it?
- Are they different from
if_/3
?if_/3
has to be extended to be used with new conditions. Would one have to do this in NU-Prolog and Gödel also?