2013-04-10 23:57:08 -07:00
|
|
|
empty(U-V) :-
|
2014-01-17 05:32:22 +00:00
|
|
|
unify_with_occurs_check(U, V).
|
2013-04-10 23:57:08 -07:00
|
|
|
|
|
|
|
|
push(Queue, Value, NewQueue) :-
|
2014-01-17 05:32:22 +00:00
|
|
|
append_dl(Queue, [Value|X]-X, NewQueue).
|
2013-04-10 23:57:08 -07:00
|
|
|
|
|
|
|
|
% when queue is empty pop fails.
|
|
|
|
|
pop([X|V]-U, X, V-U) :-
|
2014-01-17 05:32:22 +00:00
|
|
|
\+empty([X|V]-U).
|
2013-04-10 23:57:08 -07:00
|
|
|
|
|
|
|
|
append_dl(X-Y, Y-Z, X-Z).
|