I am currently doing a re-evaluation of an old Prolog system,
checking what features I could adopt. This is unlike the current
trend where people have turned their focus on GUIs, like XPCE,
or a are stuck in an endless loop of parser problems, like in
Trealla. But I would nevertheless share my finding. Take this
simple example of a list append:
app([], X, X).
app([X|Y], Z, [X|T]) :- app(Y, Z, T).
ECLiPSe Prolog gives me, only one redo question in the top-level:
/* ECLiPSe Prolog 7.1beta #13 */
[eclipse 2]: app(X,Y,[1]).
X = []
Y = [1]
Yes (0.00s cpu, solution 1, maybe more) ? ;
X = [1]
Y = []
Yes (0.00s cpu, solution 2)
In SWI-Prolog I find, two redo questions in the top-level:
/* SWI-Prolog 9.3.25 */
?- app(X,Y,[1]).
X = [],
Y = [1] ;
X = [1],
Y = [] ;
false.
I know SWI-Prolog handles lists differently than other Prolog terms
during indexing. Could this be the reason? Or maybe that the call is
not “hot” enough, so it doesn’t get JIT-ed. ECLiPSe Prolog
does it on the very first call, and I assume its due to a kind of
index on the 3rd argument.