Not really, it could also remove call/1 in the input. Like for example input:
negation(X) :- call(X), !, fail.
negation(_).
And then during listing/[0,1]
:
negation(X) :- X, !, fail.
negation(_).
But I refrained from doing something that would affect listing/[0,1] or
retract/1, clause/2. I now do it under the hood, and it gives me some
performance boost, although I need more deref(). Its a sneaky
compilation optimization of call/1 which removes it from the generated code,
by placing a naked variable in the generated code. But its now realized so
that the end-user doesn’t know. Except for a little performance gain.
Without this optimization, the Lion and Unicorn example:
/* Dogelog Player 1.1.4, JDK 21 */
?- time((between(1,1000000,_), solve(_), fail; true)).
% Zeit 7086 ms, GC 1 ms, Lips 13124484, Uhr 09.11.2023 13:11
true.
With this optimization, the Lion and Unicorn example:
/* Dogelog Player 1.1.4, JDK 21 */
?- time((between(1,1000000,_), solve(_), fail; true)).
% Zeit 6891 ms, GC 0 ms, Lips 9577724, Uhr 10.11.2023 10:40
true.
Note the LIPS went down, because call/1 is not anymore present,
and thus not anymore counted. But the performance gain is not that
big. Still thinking about other ways to opimitze, the Lion and
Unicorn example is quite tricky to optimize concerning the Prolog
system that runs it. That will be a nice task for the Christmas & New
Years holidays, to squeeze the lemon further!