12.4 Unifying Attribute Value Matrices

We now show how to unify attribute value matrices (AVM's) in Oz. The idea is to treat AVM's exactly as we treated terms in the previous section. Here are three examples of AVM's encoded as predicates.

<AVM's as Predicates>=
proc{AVM1 X}
   Y in X=a(f:a(f:X g:Y h:Y))
end 
proc{AVM2 X}
   Y in X=a(f:a(f:X g:a(f:Y) h:Y))
end 
proc{AVM3 X}
   X=a(f:a(f:X g:nono h:_))
end

In fact, we can use the same procedure Unify for unification as before.

<Test AVM Unification>=
declare 
<AVM's as Predicates> 
<Unify Terms> 
proc{BrowseAVM AVMs}
   {ForAll AVMs Browse}
   {Browse done}
end 
/*
{BrowseAVM {Unify AVM1 AVM2}}
{BrowseAVM {Unify AVM2 AVM3}}
{BrowseAVM {Unify AVM1 AVM3}}
*/


Denys Duchier, Claire Gardent and Joachim Niehren
Version 1.3.99 (20050412)