Since release 0.9.4 of Jekejeke Prolog the interpreter features a simplifica-tion framework. Simplification is directly applied after the expansion of a goal or term. It can be customized by the end-user.
It now happens that certain rules can cause problems in the semantics of the if-then-else. This happens whenever the simplification generates a free standing (->)/2 term inside a (;)/2 context. The following innocently looking simplification rule already causes this problem:
A, true ~~> A
When the simplification acts on (! -> fail), true; true, it will turn the goal into ! -> fail; true. The former goal succeeds whereas the latter goal fails. The scope of the local cut inside the (->)/2 is broadened by the simplification, which causes the discrepancy in the semantics.
The simplification is vital to the Jekejeke Runtime and Jekejeke Minlog. It is internally used to simplify DCG grammar rules and to simplify forward chaining handlers. So we will need to keep this feature.
We did not yet identify all corners where such a glitch can happen. And for those cases where we already see the glitch, we do not yet have a definite concept to fix the simplification rules. For the already mentioned simplifica-tion rule a fix would be eventually:
A, true ~~> A if A \= (_ -> _)
But this also prevents simplification when the potential free standing (->)/2 is not inside a (;)/2 context. Thus reducing the number of simplified goals and therefor lowering the benefit of simplification.
ISO 18.104.22.168, ISO 9