var2node method

Whenever, in a literal, we encounter an atom naming a variable, we invoke method var2node to make sure that this variable is already encoded and to retrieve the corresponding node representation. If this is the first time we encounter this variable x, we allocate for it a new integer and create a node representation \NODE{x} for it. Further, we also create R_{xy} for all variables y that were known sofar (i.e. all variables encoded by integers smaller than the one encoding x).

<Dominance: Solver class, var2node method>=
meth var2node(X Node)
   I = {Dictionary.condGet @var2int X unit}
   if I==unit then 
      {FS.include I @vars}
      Node={MakeNode I @vars}
      @var2int.X  := I
      @int2node.I := Node
      for J in 1..(I-1) do 
         @choices.(I*1000+J) := { 1#4}
   else Node=@int2node.end 

Denys Duchier
Version 1.2.0 (20010221)