Package org.jacop.util.fsm
Class FSM
java.lang.Object
org.jacop.util.fsm.FSM
Deterministic Finite Acyclic graph.
- Version:
- 4.9
-
Field Summary
FieldsModifier and TypeFieldDescriptionIt specifies all states including the initial one and final ones.It specifies final states of DFA.(package private) static AtomicInteger
It specifies number of states created in DFA class.It specifies the intial state of DFA. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconcatenation
(FSM other) It does concatenation of two FSM.getState
(int id) It gets state of a given id.private void
recursiveCall
(int prevSuc, int level, int stateNumber, IntervalDomain[][][] outarc, int[] tuple, List<int[]> tuples) private void
recursiveCall
(int prevSuc, int level, int stateNumber, IntervalDomain[][][] outarc, int[] tuple, MDD result) void
resize()
It resizes the Finite State Machine.star()
It performs star operation on this FSM.toString()
transformDirectlyIntoMDD
(IntVar[] vars) It generates one by one tuples allowed by a Regular constraint, which are added to the MDD being built.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.It computes a union of two Finite State Machines.
-
Field Details
-
idNumber
It specifies number of states created in DFA class. -
initState
It specifies the intial state of DFA. -
finalStates
It specifies final states of DFA. -
allStates
It specifies all states including the initial one and final ones.
-
-
Constructor Details
-
FSM
It creates a Finite State Machine.- Parameters:
initState
- it specifies the initial state.finalStates
- it specifies the final states.allStates
- it specifies all the states.
-
FSM
public FSM()It creates a Finite State Machine used by Regular constraint constructor.
-
-
Method Details
-
union
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
It does concatenation of two FSM.- Parameters:
other
- the FSM with which the concatenation takes place.- Returns:
- the resulting FSM.
-
star
It performs star operation on this FSM.- Returns:
- the resulting FSM.
-
getState
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
-
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
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.
-
recursiveCall
private void recursiveCall(int prevSuc, int level, int stateNumber, IntervalDomain[][][] outarc, int[] tuple, List<int[]> tuples) -
transformIntoMDD
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.
-
recursiveCall
private void recursiveCall(int prevSuc, int level, int stateNumber, IntervalDomain[][][] outarc, int[] tuple, MDD result) -
transformDirectlyIntoMDD
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.
-