Next: , Previous: CSD1, Up: Principles list


7.2.9 Chorus principle

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

It is fairly specialized, and is so far only used in the Chorus grammar (Chorus) for optimization (hence its name).

It creates for each node v the two sets S1 and S2. S1 is the set of nodes below edges labeled by l' in Chorus which emanate from v on D1. S2 is the set of nodes equal or below the mother of v on D2.

It then stipulates for all nodes v that S1 must be subset of S2.

Here is the definition of the Chorus 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'
export
   Constraint
define
   proc {Constraint Nodes G Principle FD FS Select}
      DVA2DIDA = Principle.dVA2DIDA
      ArgRecProc = Principle.argRecProc
      %%
      D1DIDA = {DVA2DIDA 'D1'}
      D2DIDA = {DVA2DIDA 'D2'}
      DIDA2LabelLat = G.dIDA2LabelLat
      D1LabelLat = {DIDA2LabelLat D1DIDA}
      D1LAs = D1LabelLat.constants
   in
      %% check features
      if {Helpers.checkModel 'Chorus.oz' Nodes
	  [D2DIDA#eqdown
	   D1DIDA#downL
	   D2DIDA#mothers]} then
	 D2EqdownMs = {Map Nodes
		       fun {$ Node} Node.D2DIDA.model.eqdown end}
      in
	 for Node in Nodes do
	    Dom1LM = {ArgRecProc 'Chorus' o('_': Node)}
	    %%
	    D1DownLMs = {Map D1LAs
			 fun {$ LA} Node.D1DIDA.model.downL.LA end}
	    D1DownLM = {Select.union D1DownLMs Dom1LM}
	    %%
	    D2MothersM = Node.D2DIDA.model.mothers
	    D2EqdownM = {Select.union D2EqdownMs D2MothersM}
	 in
	    {FS.subset D1DownLM D2EqdownM}
	 end
      end
   end
end

Footnotes

[1] This principle does not work in conjunction with the Graph1 principle (Graph1) on D1 as it accesses the model record feature downL only introduced by the Graph principle (Graph).