16.3.3 Translation to Set Constraints

If N1 dominates N2, then everything that is (weakly) below N2 must be (weakly) below N1, everything that is (weakly) above N1 must be (weakly) above N2, and everything that is beside N1 is also beside N2. Note however that there can be nodes beside N2 that are below N1.

<DC: dominates>=
proc {Dominates N1 N2}
   {FS.subset N2.eqdown N1.eqdown}
   {FS.subset N1.equp   N2.equp  }
   {FS.subset N1.side   N2.side  }
end

The equality constraint is simply implemented by unification:

<DC: equal>=
proc {Equal N1 N2} N1=N2 end

The disequality constraint states that the Eq sets of N1 and N2 must be disjoint:

<DC: not equal>=
proc {NotEqual N1 N2}
   {FS.disjoint N1.eq N2.eq}
end

N1 strictly dominates N2 iff it dominates N2 and is not equal to N2:

<DC: strictly dominates>=
proc {StrictlyDominates N1 N2}
   {Dominates N1 N2}
   {NotEqual  N1 N2}
end

If N1 is to the side of N2 (and reciprocally), then N1 and everything below it is to the side of N2 (and resp.):

<DC: side>=
proc {Side N1 N2}
   {FS.subset N1.eqdown N2.side}
   {FS.subset N2.eqdown N1.side}
end

Finally, here is the constraint that deals with immediate dominance by specifying explicitly the daughters of a node N as a list Nodes of nodes. The set of nodes that are weakly below each of the daughters form a partition of the set of nodes that are strictly below the mother. Furthermore, the set of nodes that are strictly above each daughter is precisely the set of nodes that are weakly above the mother.

<DC: daughters>=
proc {Daughters N L}
   N.daughters = L
   {FS.partition {Map L fun {$ D} D.eqdown end} N.down}
   for D in L do D.up=N.equp end 
end


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