0
What about the following meta-predicate "fixed point"?
fixedpoint(P_2,X0,X) :-
call(P_2,X0,X1),
if_(X0 = X1, X = X0, fixedpoint(P_2,X1,X)).
fixedpointlist(P_2,X0,[X0|Xs]) :-
call(P_2,X0,X1),
if_(X0 = X1, Xs = [], fixedpointlist(P_2,X1,Xs)).
The implementation is based, in part, on...