edu.toronto.cs.boolpg.parser
Class VariableTable

java.lang.Object
  extended by edu.toronto.cs.boolpg.parser.VariableTable

public class VariableTable
extends java.lang.Object

Describe class VariableTable here. Symbol table that keeps track of variables. Since we often need several copies of the same variable, for example, current and next state, or even next next state, we support arbitrary number of shadow variables.

Version:
1.0
Author:
Arie Gurfinkel

Nested Class Summary
 class VariableTable.ProcessCounter
           
 class VariableTable.StateVariable
           
 class VariableTable.Variable
           
 
Constructor Summary
VariableTable()
           
VariableTable(int _shadows)
          Creates a new VariableTable instance.
 
Method Summary
 VariableTable.StateVariable declarePropositional(java.lang.String name)
          Describe declarePropositional method here.
 void dump()
           
 VariableTable.Variable getByName(java.lang.String name)
           
 MvSetFactory getMvSetFactory()
           
 int getNumVars()
           
 int[] getVariableIds(int set)
          Describe getVariableIds method here.
 java.util.Collection getVariables()
           
 java.lang.String[] getVarNames()
          Describe getVarNames method here.
 void setMvSetFactory(MvSetFactory _factory)
           
 java.lang.String toString()
           
 int[] variableMap(int fromSet, int toSet)
          Describe variableMap method here.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VariableTable

public VariableTable(int _shadows)
Creates a new VariableTable instance.

Parameters:
_shadows - an int number of shadow variables

VariableTable

public VariableTable()
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setMvSetFactory

public void setMvSetFactory(MvSetFactory _factory)

getMvSetFactory

public MvSetFactory getMvSetFactory()

declarePropositional

public VariableTable.StateVariable declarePropositional(java.lang.String name)
Describe declarePropositional method here.

Parameters:
name - a String value
Returns:
a StateVariable value

getNumVars

public int getNumVars()

getByName

public VariableTable.Variable getByName(java.lang.String name)

getVariables

public java.util.Collection getVariables()

getVarNames

public java.lang.String[] getVarNames()
Describe getVarNames method here. currently called to construct a KripkeStructure but not used there.

Returns:
a String[] value

dump

public void dump()

variableMap

public int[] variableMap(int fromSet,
                         int toSet)
Describe variableMap method here. returns an integer array that maps variables in the 'fromSet' to variables in the 'toSet'. For example, variableMap (0, 1) returns a map that maps 0 variables to 1 variables. The intention is that 0 variables are current variables, and 1 variables are next state variables, in which case we get a map from current to next state

Parameters:
fromSet - an int value
toSet - an int value
Returns:
an int[] value

getVariableIds

public int[] getVariableIds(int set)
Describe getVariableIds method here. returns ids of all of the variables in set set

Parameters:
set - an int value
Returns:
an int[] value