At least the sublist/2 predicate does not what i would expect.
I get the effect of an subsequence instead of a sublist.
I also consulted the manual, which lapidarly states
sublist(List1, List2) succeeds if List1 is a sub-list of List2. This
predicate is re-executable on backtracking.
So what is a sub-list?
GNU Prolog 1.4.1
By Daniel Diaz
Copyright (C) 1999-2012 Daniel Diaz
| ?- sublist([ll,r],[ll,l,rr,r]).
| ?- sublist([l,r],[ll,l,rr,r]).
| ?- sublist([rr,r],[ll,l,rr,r]).
I would consider only the result from the last call
since the first argument is a true sublist here.
The others calls should give a 'no' result, since there are
other elements ([l,rr] and [rr]) inserted.
I experimented with other sublist definitions also.
This definition of a sublist/2 predicate