JaCoP.util.fsm
Class FSM

java.lang.Object
  extended by JaCoP.util.fsm.FSM

public class FSM
extends java.lang.Object

Deterministic Finite Acyclic graph.

Version:
3.1
Author:
Polina Makeeva and Radoslaw Szymanek

Field Summary
 java.util.HashSet<FSMState> allStates
          It specifies all states including the initial one and final ones.
 java.util.HashSet<FSMState> finalStates
          It specifies final states of DFA.
 FSMState initState
          It specifies the intial state of DFA.
static int stateId
          It specifies number of states created in DFA class.
static java.lang.String[] xmlAttributes
          It specifies the arguments required to be saved by an XML format as well as the constructor being called to recreate an object from an XML format.
 
Constructor Summary
FSM()
          It creates a Finite State Machine used by Regular constraint constructor.
FSM(FSMState initState, java.util.HashSet<FSMState> finalStates, java.util.HashSet<FSMState> allStates)
          It creates a Finite State Machine.
 
Method Summary
 FSM concatenation(FSM other)
          It does concatenation of two FSM.
 FSMState getState(int id)
          It gets state of a given id.
 void resize()
          It resizes the Finite State Machine.
 FSM star()
          It performs star operation on this FSM.
 java.lang.String toString()
           
 MDD transformDirectlyIntoMDD(IntVar[] vars)
          It generates one by one tuples allowed by a Regular constraint, which are added to the MDD being built.
 MDD transformIntoMDD(IntVar[] vars)
          It generates one by one tuples allowed by a Regular constraint, which are added to the MDD being built.
 int[][] transformIntoTuples(IntVar[] vars)
          It creates an array of tuples representing this Regular context.
 FSM union(FSM other)
          It computes a union of two Finite State Machines.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

stateId

public static int stateId
It specifies number of states created in DFA class.


initState

public FSMState initState
It specifies the intial state of DFA.


finalStates

public java.util.HashSet<FSMState> finalStates
It specifies final states of DFA.


allStates

public java.util.HashSet<FSMState> allStates
It specifies all states including the initial one and final ones.


xmlAttributes

public static java.lang.String[] xmlAttributes
It specifies the arguments required to be saved by an XML format as well as the constructor being called to recreate an object from an XML format.

Constructor Detail

FSM

public FSM(FSMState initState,
           java.util.HashSet<FSMState> finalStates,
           java.util.HashSet<FSMState> allStates)
It creates a Finite State Machine.

Parameters:
initState - it specifies the initial state.
allStates - it specifies all the states.
finalStates - it specifies the final states.

FSM

public FSM()
It creates a Finite State Machine used by Regular constraint constructor.

Method Detail

union

public FSM union(FSM other)
It computes a union of two Finite State Machines.

Parameters:
other - the other FSM which is used in the union computation.
Returns:
the resulting FSM.

concatenation

public FSM concatenation(FSM other)
It does concatenation of two FSM.

Parameters:
other - the FSM with which the concatenation takes place.
Returns:
the resulting FSM.

star

public FSM star()
It performs star operation on this FSM.

Returns:
the resulting FSM.

getState

public FSMState getState(int id)
It gets state of a given id.

Parameters:
id - the id of the searched state.
Returns:
the state of FSM with a given id.

toString

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

resize

public void resize()
It resizes the Finite State Machine. All states get a new id between 0..n-1, where n is the number of states.


transformIntoTuples

public int[][] transformIntoTuples(IntVar[] vars)
It creates an array of tuples representing this Regular context. It generates only the tuples which are allowed in the current context of the store.

Parameters:
vars - variables in which context a list of tuples is created.
Returns:
an array of tuples.

transformIntoMDD

public MDD transformIntoMDD(IntVar[] vars)
It generates one by one tuples allowed by a Regular constraint, which are added to the MDD being built. After all tuples are added MDD is being reduced. The standard MDD creating procedure employed in paper presenting MDD based extensional constraint. It generates only the tuples which are allowed in the current context of the store.

Parameters:
vars - variables in which context MDD is being created from Regular constraint.
Returns:
MDD representing the same constraint as Regular.

transformDirectlyIntoMDD

public MDD transformDirectlyIntoMDD(IntVar[] vars)
It generates one by one tuples allowed by a Regular constraint, which are added to the MDD being built. After all tuples are added MDD is being reduced. The standard MDD creating procedure employed in paper presenting MDD based extensional constraint. It generates only the tuples which are allowed in the current context of the store.

Parameters:
vars - variables in which context MDD is being created from Regular constraint.
Returns:
MDD representing the same constraint as Regular.