Using this directive:
:- table(path(_, lattice(shortest/3))).
Now if I run the program I get, its deterministic:
?- path(101,0,L).
L = [i, i, i, s, i, s, i, o].
If I reconsult the program I get, its not anymore deterministic:
% <path>/fish.p compiled 0.00 sec, 0 clauses
?- path(101,0,L).
L = [i, i, i, s, i, s, i, o] ;
L = [i, s, i, i, s, i, s, i, o] ;
L = [i, i, s, d, s, i, s, i, o] Etc..
Source to reproduce the problem:
fish.p.log (876 Bytes)