[cl-unification-devel] question about CL-UNIFICATION

Robert P. Goldman rpgoldman at sift.info
Fri May 27 16:25:23 UTC 2005


I was following up on CL-UNIFICATION based on your email to the cells
list, and read over the web site docs.  I was left with the question
of how to unify together two structures or objects.  I see how one can
unify a structure (or object) with a template, and how that might be
used for ML-style pattern-matching.

But what if you really want to know if two structures themselves
unify?  Presumably one might want to do something like the following:

(setf x #S(FOO A 42 S NIL D NIL))
(setf y #S(FOO A 42 S NIL D NIL))

where x and y are EQUALP, but not EQ, and you'd like to do

(unify x y)

but this is impossible.  Is the following correct:

(unify x #T(FOO foo-a (foo-a y) foo-s (foo-s y) foo-d (foo-d y)))

and, if so, is there some less cumbersome way to make this happen?
I.e., to have a unification method definition that would say "whenever
I unify together a FOO and a FOO, I want to apply this template to the
second argument?

Thanks,
R




More information about the cl-unification-devel mailing list