158
dest(ID, Where) :- operation(ID, move(_, _, Where)), !.
dest(ID, Where) :- operation(ID, copy(_, _, Where)), !.
dest_star(ID, Where) :- dest(ID, Where).
dest_star(ID, Where) :- dest(ID, address([I | _], Index)), dest_star(I,
Where).
% The following defines the ordering on Palimpsest addresses. The
ordering is well-
% defined for the legal addresses, a superset of the addresses that
would actually
% appear in a P-sequence.
% These clauses correspond directly with the definitions in Chapter 4.
less(address([], 0), X) :- X \= address([], 0).
less(X, address([I|_], _)) :- dest_star(I, S), S = X.
less(address([I1], Index1), address([I1], Index2)) :- Index1 <
dest(ID, Where) :- operation(ID, move(_, _, Where)), !.
dest(ID, Where) :- operation(ID, copy(_, _, Where)), !.
dest_star(ID, Where) :- dest(ID, Where).
dest_star(ID, Where) :- dest(ID, address([I | _], Index)), dest_star(I,
Where).
% The following defines the ordering on Palimpsest addresses. The
ordering is well-
% defined for the legal addresses, a superset of the addresses that
would actually
% appear in a P-sequence.
% These clauses correspond directly with the definitions in Chapter 4.
less(address([], 0), X) :- X \= address([], 0).
less(X, address([I|_], _)) :- dest_star(I, S), S = X.
less(address([I1], Index1), address([I1], Index2)) :- Index1 <