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.
I made the observation while looking at
debugger traces, choice point elimination,
driven by indexes, also determines what
FAIL/REDO ports a debugger shows.
What is amazing Scryer Prolog, which has
a tamer version of multi-argument indexing, a
kind of skip indexing, they describe
it on their GitHub homepage, can do it:
/* Scryer Prolog 0.9.4-415 */
?- app(X,Y,[1]).
X = [], Y = [1]
; X = [1], Y = [].
And the ghost from my cabinet, formerly
Jekejeke Prolog, which does a little bit more
than skip indexing, but still not the same deep
indexing as in SWI-Prolog can also do it:
/* Jekejeke Runtime 1.7.3 */
?- app(X,Y,[1]).
X = [], Y = [1];
X = [1], Y = [].
Mild Shock schrieb:
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.
Hi,
Shocking revelation, I found two significant
bugs in my age old indexer code base yesterday.
How can an eGovernment ever trust any Prolog
system? These were bugs that typically go
unnoticed by lets say a Rust type system.
Would possibly require deep axiomatization
or heavy fuzzy testing of the code, or a
combination of both.
LoL
Bye
Mild Shock schrieb:
I made the observation while looking at
debugger traces, choice point elimination,
driven by indexes, also determines what
FAIL/REDO ports a debugger shows.
What is amazing Scryer Prolog, which has
a tamer version of multi-argument indexing, a
kind of skip indexing, they describe
it on their GitHub homepage, can do it:
/* Scryer Prolog 0.9.4-415 */
?- app(X,Y,[1]).
X = [], Y = [1]
; X = [1], Y = [].
And the ghost from my cabinet, formerly
Jekejeke Prolog, which does a little bit more
than skip indexing, but still not the same deep
indexing as in SWI-Prolog can also do it:
/* Jekejeke Runtime 1.7.3 */
?- app(X,Y,[1]).
X = [], Y = [1];
X = [1], Y = [].
Mild Shock schrieb:
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.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 716 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 48:59:47 |
| Calls: | 12,115 |
| Calls today: | 6 |
| Files: | 15,010 |
| Messages: | 6,518,530 |