de.upb.swt.mcie.robdds
Class ChangeSet

java.lang.Object
  extended by de.upb.swt.mcie.robdds.ChangeSet

public class ChangeSet
extends java.lang.Object

This class represents a set of variables, which restrict the changed variables in a transition relation. This set can be used to calculate the predecessors of a state more efficiently. The hash table with results of earlier results will be maintained with this set.

Author:
Ekkart Kindler, kindler@upb.de

Field Summary
(package private)  Context context
          The context.
(package private)  java.util.Map predecessorTable
          Table of predecessors calculated for this ChangeSet.
private  java.util.Set set
          The set.
(package private)  java.util.Map successorTable
          Table of successors calculated for this ChangeSet.
 
Constructor Summary
ChangeSet(Context context)
          Constructs an empty change set for a given context.
ChangeSet(Context context, Variable[] variables)
          Constructs a set of variables in a given context.
 
Method Summary
 void add(java.lang.String name)
          Adds a variable with the given name in the current context to the change set.
 void clearHashTables()
          Clears the hash tables for the predecessor calculations with respect to this changeset.
 boolean contains(Variable v)
          Checks whether the given variable is in this set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

set

private java.util.Set set
The set.


context

Context context
The context.


predecessorTable

java.util.Map predecessorTable
Table of predecessors calculated for this ChangeSet.


successorTable

java.util.Map successorTable
Table of successors calculated for this ChangeSet.

Constructor Detail

ChangeSet

public ChangeSet(Context context)
Constructs an empty change set for a given context.

Parameters:
context - the context of the variables

ChangeSet

public ChangeSet(Context context,
                 Variable[] variables)
          throws IncorrectUseException
Constructs a set of variables in a given context. The variables are given as an array. All variables must be from the given context.

Parameters:
context - the context of the variables
variables - an array with all variables
Throws:
IncorrectUseException - if a variable is from a different context
Method Detail

add

public void add(java.lang.String name)
Adds a variable with the given name in the current context to the change set. If the variable does not exist in the given context, it will be created.

Parameters:
name -

contains

public boolean contains(Variable v)
Checks whether the given variable is in this set.

Parameters:
v -
Returns:
true, if the variable is in this set

clearHashTables

public void clearHashTables()
Clears the hash tables for the predecessor calculations with respect to this changeset. This method can be called any time without compromising the correctness. But, calling it can significantly reduce the efficiency of subsequent applications of binary operations.