- Solved the TERM_Hidden issue for the keys in termMguSubTerm. Yields
cleaner behaviour for MguSubterm.
This commit is contained in:
parent
d7e49028c1
commit
98bff1e5e2
21
src/mgu.c
21
src/mgu.c
@ -23,6 +23,8 @@
|
|||||||
*/
|
*/
|
||||||
int mgu_match = 0;
|
int mgu_match = 0;
|
||||||
|
|
||||||
|
extern Term TERM_Hidden;
|
||||||
|
|
||||||
void
|
void
|
||||||
showSubst (Term t)
|
showSubst (Term t)
|
||||||
{
|
{
|
||||||
@ -309,16 +311,21 @@ termMguSubTerm (Term t1, Term t2, int (*iterator) (),
|
|||||||
Termlist keylist_new;
|
Termlist keylist_new;
|
||||||
Term newkey;
|
Term newkey;
|
||||||
|
|
||||||
keylist_new = termlistShallow (keylist);
|
|
||||||
newkey = inverseKey (inverses, t2->right.key);
|
newkey = inverseKey (inverses, t2->right.key);
|
||||||
keylist_new = termlistAdd (keylist_new, newkey);
|
|
||||||
|
|
||||||
// Recurse
|
// We can never produce the TERM_Hidden key, thus, this is not a valid iteration.
|
||||||
flag =
|
if (!isTermEqual (newkey, TERM_Hidden))
|
||||||
flag && termMguSubTerm (t1, t2->left.op, iterator, inverses,
|
{
|
||||||
keylist_new);
|
keylist_new = termlistShallow (keylist);
|
||||||
|
keylist_new = termlistAdd (keylist_new, newkey);
|
||||||
|
|
||||||
termlistDelete (keylist_new);
|
// Recurse
|
||||||
|
flag =
|
||||||
|
flag && termMguSubTerm (t1, t2->left.op, iterator, inverses,
|
||||||
|
keylist_new);
|
||||||
|
|
||||||
|
termlistDelete (keylist_new);
|
||||||
|
}
|
||||||
termDelete (newkey);
|
termDelete (newkey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user