Got rid of similar trampoline for unify tuple recursion.

This commit is contained in:
Cas Cremers 2018-12-24 13:45:28 +01:00
parent d594b04d15
commit 98a6ed5873

View File

@ -270,14 +270,15 @@ unify (Term t1, Term t2, Termlist tl, int (*callback) (), void *state)
non-associative version ! TODO other version */ non-associative version ! TODO other version */
if (isTermTuple (t1)) if (isTermTuple (t1))
{ {
int unify_combined_tup (Termlist tl, void *state) struct state_mgu_tmp tmpstate;
{
// now the keys are unified (subst in this tl) tmpstate.oldstate = state;
// and we try the inner terms tmpstate.oldcallback = callback;
return unify (TermOp2 (t1), TermOp2 (t2), tl, callback, state); tmpstate.unifyt1 = TermOp2 (t1);
} tmpstate.unifyt2 = TermOp2 (t2);
return unify (TermOp1 (t1), TermOp1 (t2), tl, unify_combined_tup,
state); return unify (TermOp1 (t1), TermOp1 (t2), tl, unify_callback_wrapper,
&tmpstate);
} }
return true; return true;