Next: , Previous: LinkingEnd, Up: Principles list


7.2.41 LinkingMother principle

This principle assumes that the Graph principle (Graph) is used on dimensions D1 and D2.

This principle is from the family of linking principles. The constraint for all edges from v to v' labeled l on D1 is:

That is, Which specifies that the daughter v' of v on D1 can be found again as a mother of v on D2. In other words, Which specifies the direction and distance of the path from v to v' on D2.

Here is the definition of the LinkingMother constraint functor:

%% Copyright 2001-2008
%% by Ralph Debusmann <rade@ps.uni-sb.de> (Saarland University) and
%%    Denys Duchier <duchier@ps.uni-sb.de> (LIFO, Orleans) and
%%    Jorge Marques Pelizzoni <jpeliz@icmc.usp.br> (ICMC, Sao Paulo) and
%%    Jochen Setz <info@jochensetz.de> (Saarland University)
%%
functor
import
%   System(show)

   Helpers(checkModel) at 'Helpers.ozf'
   Opti(isIn) at 'Opti.ozf'
export
   Constraint
define
   proc {Constraint Nodes G Principle FD FS Select}
      DVA2DIDA = Principle.dVA2DIDA
      ArgRecProc = Principle.argRecProc
      %%
      D1DIDA = {DVA2DIDA 'D1'}
      D2DIDA = {DVA2DIDA 'D2'}
      D2DIDALabelLat = G.dIDA2LabelLat
      D1LabelLat = {D2DIDALabelLat D1DIDA}
      D1LAs = D1LabelLat.constants
   in
      if {Helpers.checkModel 'LinkingMother.oz' Nodes
	  [D1DIDA#daughtersL
	   D2DIDA#mothers]} then
	 for Node1 in Nodes do
	    for Node2 in Nodes do
	       for LA in D1LAs do
		  if {Not {Opti.isIn Node2.index Node1.D1DIDA.model.daughtersL.LA}=='out'} then
		     %% LinkingMother
		     %%
		     %% m -l->1 d =>
		     %%   l in Which =>
		     %%     d ->2 m
		     LI = {D1LabelLat.aI2I LA}
		     Node2I = Node2.index
		     %%
		     WhichM = {ArgRecProc 'Which' o('^': Node1)}
		  in
		     {FD.impl
		      {FS.reified.include Node2.index Node1.D1DIDA.model.daughtersL.LA}
		      {FD.impl
		       {FS.reified.include LI WhichM}
		       {FS.reified.include Node2I Node1.D2DIDA.model.mothers}} 1}
		  end
	       end
	    end
	 end
      end
   end
end