Hi all
I think gprolog does a too much simple trace on this exemple:
permutation([], []).
permutation(List, [S|Perm]) :-
select(S, List, Rest),
permutation(Rest, Perm).
select(Element, [Element|Tail], Tail).
select(Element, [Head|Tail1], [Head|Tail2]) :-
select(Element, Tail1, Tail2).
=>
"
Prolog interruption (h for help) ? t
The debugger will first creep -- showing everything (trace)
| ?- permutation([1, 2, 3], L).
1 1 Call: permutation([1,2,3],_23) ?
1 1 Exit: permutation([1,2,3],[1,2,3]) ?
L = [1,2,3] ?
yes
{trace}
| ?-
"
no call to select, and no different trace if I press "shift+;" for the other
solutions. maybe I missed an option
I thought it was a nice exemple for studients, to show the backtraking engine,
since they saw these two lines :)
Tanks for comments
Gilles
_______________________________________________
Users-prolog mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/users-prolog
--
Ce message a subi une analyse antivirus
par MailScanner ; il est vraisemblablement
sans danger.