,
..., . – . . , , .
, . , , , , . , freeze(_, G_0). , , . SICStus 1 SWI call_residue_vars(Query_0, Vs), .
, . , , . , difgrn/2 dif/2:
difgrn(X, Y) :-
when((ground(X), ground(Y)), X \== Y).
| ?- difgrn(X, X).
prolog:trig_ground(X,[],[X],_A,_B),
prolog:trig_ground(X,[],[X],_A,_C),
prolog:trig_and(_C,[],_A,_B,_A),
prolog:when(_A,(ground(X),ground(X)),user:(X\==X)) ? ;
no
| ?- dif(X, X).
no
| ?- difgrn([], [_]).
prolog:trig_ground(_A,[],[_A],_B,_C),
prolog:trig_and(_C,[],_B,1,_B),
prolog:when(_B,(ground([]),ground([_A])),user:([]\==[_A]))
| ?- dif([], [_]).
yes
dif/2 (?=)/2:
difwh(X,Y) :- when(?=(X,Y), X\==Y).
:
, , dif/2, ?
, , .
, . X in 1..2, dif(X, 1), dif(X, 2).
(- .) - - , , .
. trig_ground , , , .
, , , frozen/2 copy_term/3.
.
subsumes_term/2, . . freeze(X, Y = a) , Y. Y ( freeze/2), , Y b.
, dif/2 (1972, Prolog 0). L'anatomie de Prolog, Interditions 1986 Lee Naish MU-Prolog.
1 . library(clpfd) assert(clpfd:full_answer).