15static char SccsId[] =
"%W% %G%";
25Int bind_variable(Term t0, Term t1)
28 if (Yap_IUnify(t0,t1)) {
32 CELL *p = (CELL *)TrailTerm(--TR);
40Int unify(Term t0, Term t1)
43 if (Yap_IUnify(t0,t1)) {
47 CELL *p = (CELL *)TrailTerm(--TR);
54EXTERN
inline Int unify_constant(
register Term a,
register Term cons)
59 deref_head(a,unify_cons_unk);
62 if (a == cons)
return(TRUE);
63 else if (IsApplTerm(a) && IsExtensionFunctor(FunctorOfTerm(a))) {
65 if (!IsApplTerm(cons) || FunctorOfTerm(cons) != fun)
68 case (CELL)FunctorDBRef:
70 case (CELL)FunctorLongInt:
71 return(pt0[1] == pt1[1]);
72 case (CELL)FunctorString:
73 return(strcmp( (
const char *)(pt0+2), (
const char *)(pt1+2)) == 0);
74 case (CELL)FunctorDouble:
75 return(FloatOfTerm(AbsAppl(pt0)) == FloatOfTerm(AbsAppl(pt1)));
77 case (CELL)FunctorBigInt:
78 return(Yap_gmp_tcmp_big_big(AbsAppl(pt0),AbsAppl(pt0)) == 0);
89 deref_body(a,pt,unify_cons_unk,unify_cons_nonvar);