Package org.xcsp.common.structures
Class Automaton
- java.lang.Object
-
- org.xcsp.common.structures.Automaton
-
public final class Automaton extends Object
This class allows us to represent finite automatons that are useful for postingregular
constraints. An automaton is composed of an initial state, a finite set of final states and a finite set of transitions.
-
-
Field Summary
Fields Modifier and Type Field Description String[]
finalStates
The set (array) of final states of the automaton, i.e., accepting stated of the automaton.String
startState
The start (initial) state of the automaton.Transition[]
transitions
The set (array) of transitions.
-
Constructor Summary
Constructors Constructor Description Automaton(String expression)
Constructs an automaton from the specified regular expression, given as a string.Automaton(String startState, Transition[] transitions, String... finalStates)
Constructs an automaton from the specified arguments.Automaton(String startState, Transitions transitions, String... finalStates)
Constructs an automaton from the specified arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
_isDeterministic()
boolean
isDeterministic()
String
toString()
-
-
-
Field Detail
-
startState
public final String startState
The start (initial) state of the automaton.
-
transitions
public final Transition[] transitions
The set (array) of transitions. Each transition is an object composed of a first state, a symbol (that may be an integer or a string) and a second state that is reached from the first state after reading the symbol.
-
finalStates
public final String[] finalStates
The set (array) of final states of the automaton, i.e., accepting stated of the automaton.
-
-
Constructor Detail
-
Automaton
public Automaton(String startState, Transition[] transitions, String... finalStates)
Constructs an automaton from the specified arguments.- Parameters:
startState
- the start state of the automatontransitions
- the set (array) of transitions where each transition is an object composed of a first state, a symbol (that may be an integer or a string) and a second state that is reached from the first state after reading the symbolfinalStates
- the set (array) of final states of the automaton, i.e., accepting stated of the automaton
-
Automaton
public Automaton(String startState, Transitions transitions, String... finalStates)
Constructs an automaton from the specified arguments.- Parameters:
startState
- the start state of the automatontransitions
- the object encapsulating the list of transitions where each transition is an object composed of a first state, a symbol (that may be an integer or a string) and a second state that is reached from the first state after reading the symbolfinalStates
- the set (array) of final states of the automaton, i.e., accepting stated of the automaton
-
Automaton
public Automaton(String expression)
Constructs an automaton from the specified regular expression, given as a string.- Parameters:
expression
- the expression representing a regular expression.
-
-