[Oz] equality of unbound variables
Christian Schulte
schulte at ps.uni-sb.de
Mon Dec 20 09:55:12 CET 1999
Cesare Tinelli wrote:
> Consider a tuple T, some of whose arguments are unbound variables,
> possibly with repetitions; for instance, something like T=t(X Y X Z Z).
> I want to create a fresh ``variant'' of T in the sense of unification
> theory, that is, a copy of T in which all of T's unbound variables are
> (bijectively) renamed to fresh variables. For instance, in the example
> above, I'd like to produce a tuple of the form t(X1 Y1 X1 Z1 Z1) where
> X1, Y1, Z1 are fresh variables.
Nils solution works of course, but maybe this can also be of some help.
If you know in advance for which records you'll need variants, you also
can use procedural/functional abstraction, that is wrap the record
construction into a function, for example
fun {F}
X Y in a(X Y Y)
end
returns on each application a fresh variant.
Christian
--
Christian Schulte, http://www.ps.uni-sb.de/~schulte/
-
Please send submissions to users at mozart-oz.org
and administriva mail to users-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.
More information about the mozart-users
mailing list