Package org.svvrl.goal.core.aut.fsa
Class FSA
java.lang.Object
org.svvrl.goal.core.AbstractEditable
org.svvrl.goal.core.aut.Automaton
org.svvrl.goal.core.aut.fsa.FSA
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,Editable
- Direct Known Subclasses:
ConfigurationAutomaton
,ProfileAutomaton
public class FSA extends Automaton
An
FSA
is a finite state automaton, including nondeterministic
classic finite word automaton (NFW), nondeterministic Büchi word
automaton (NBW), nondeterministic co-Büchi word automaton (NCW),
nondeterministic generalized Büchi word automaton (NGBW),
nondeterministic Muller word automaton (NMW), nondeterministic Rabin word
automaton (NRW), nondeterministic Streett word automaton (NSW), and
nondeterministic parity word automaton (NPW).- Author:
- Ming-Hsien Tsai
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class org.svvrl.goal.core.aut.Automaton
aps, complete_transition, FORMULA, from_map, from_to_map, gsid, gtid, inits, invisible_inits, invisible_states, invisible_trans, states, to_map, trans
-
Constructor Summary
Constructors Constructor Description FSA(AlphabetType atype, Position lpos)
Constructor with the alphabet type and the label position. -
Method Summary
Modifier and Type Method Description boolean
addState(State s)
Inserts a state created outside to this automaton.FSA
clone()
FSAState
createState()
Creates a new state of the automaton.FSAState
createState(java.awt.Point p)
Creates a new state of the automaton at a specified location.FSATransition
createTransition(State from, State to, java.lang.String label)
Creates a transition to the automaton.InputSequence
getInputForPath(StateRun run)
Returns an input sequence that has a specified run of this automaton,null
if there is no input sequence that has such a run.java.util.List<StateRun>
getRunsForInput(InputSequence input)
Returns all possible runs of this automaton on a specified (unexpanded) input sequence starting from some initial state.java.util.List<StateRun>
getRunsForInput(State start, InputSequence input)
Returns all possible traces of this automaton starting from a specified state on a specified (unexpanded) input sequence.protected Automaton
newInstance()
Creates a new automaton that has the same type of this automaton.FSAState
newState(int id)
Creates a new state with an ID.FSATransition
newTransition(int id, State from, State to)
Creates a new instance of a transition.Methods inherited from class org.svvrl.goal.core.aut.Automaton
addAutomatonListener, addInitialState, addState, addTransition, clone, completeTransitions, completeTransitions, containsEquivalentTransition, containsInitialState, containsState, containsTransition, containsTransition, contractAlphabet, copyInfo, dispatchAutomatonEvent, dumpPredecessorMap, dumpStateLocations, dumpSuccessorMap, expandAlphabet, expandAlphabet, expandAlphabet, expandAlphabet, getAcc, getAlphabet, getAlphabetType, getAtomicPropositions, getBuiltinPropertyNames, getEpsilonPredecessors, getEpsilonPredecessors, getEpsilonSuccessors, getEpsilonSuccessors, getEquivalentTransition, getFixpointPostImage, getFixpointPreImage, getFormula, getGraphicComponents, getInitialState, getInitialStates, getInvisibleLayerSize, getLabelPosition, getPostImage, getPredecessors, getPredecessors, getPredecessors, getPredecessors, getPredecessorsWithEpsilon, getPredecessorsWithEpsilon, getPreImage, getPropositions, getStateByID, getStates, getStatesByIDs, getStateSize, getSuccessors, getSuccessors, getSuccessors, getSuccessors, getSuccessorsWithEpsilon, getSuccessorsWithEpsilon, getSymbolsFromState, getSymbolsToState, getTransitionByID, getTransitionFromStateToState, getTransitions, getTransitionsByIDs, getTransitionsFromState, getTransitionsFromState, getTransitionsFromStateToState, getTransitionSize, getTransitionsToState, getTransitionsToState, getUsedAtomicPropositions, groupTransitions, isCompleteTransition, isConsistent, isMergable, isValidateTransitionLabel, newTransition, popInvisibleLayer, pushInvisibleLayer, recomputeTransitionMaps, removeAutomatonListener, removeComponent, removeInitialState, removeState, removeStates, removeStates, removeTransition, removeTransitions, removeTransitions, renameProposition, renamePropositions, reorder, reorder, restrict, setAcc, setAlphabetType, setAtomicPropositions, setCompleteTransitions, setCompleteTransitions, setFormula, setInitialState, setValidateTransitionLabel, simplifyTransitions, simplifyTransitions, simplifyTransitions, simplifyTransitions, toString, updateTransitionDisplay
Methods inherited from class org.svvrl.goal.core.AbstractEditable
addEditableListener, fireEditableEvent, getDescription, getName, getProperties, propertyChange, removeEditableListener, setDescription, setName
-
Constructor Details
-
FSA
Constructor with the alphabet type and the label position.- Parameters:
atype
- the alphabet typelpos
- the label position
-
-
Method Details
-
addState
Description copied from class:Automaton
Inserts a state created outside to this automaton. The state will not be inserted if there is another existing state with the same ID. -
newState
Description copied from class:Automaton
Creates a new state with an ID. Different automata types can override this function to create state objects from different classes. -
createState
Description copied from class:Automaton
Creates a new state of the automaton. The state will be placed at a random location. The created state is guaranteed to be in this automaton.- Overrides:
createState
in classAutomaton
- Returns:
- a new state of the automaton
-
createState
Description copied from class:Automaton
Creates a new state of the automaton at a specified location. The created state is guaranteed to be in this automaton.- Overrides:
createState
in classAutomaton
- Parameters:
p
- the position of the state- Returns:
- a new state of the automaton
-
newTransition
Description copied from class:Automaton
Creates a new instance of a transition.- Specified by:
newTransition
in classAutomaton
- Parameters:
id
- the unique transition IDfrom
- the source state of the transitionto
- the destination state of the transition- Returns:
- a new transition with ID
id
fromfrom
toto
-
createTransition
Description copied from class:Automaton
Creates a transition to the automaton. The returned transition is guaranteed to be in this automaton.- Overrides:
createTransition
in classAutomaton
- Parameters:
from
- the source state of the transitionto
- the destination state of the transitionlabel
- the label on the transition- Returns:
- a new transition from
from
toto
with labelsymbol
if there is no such transition, the existing transition if this automaton has a transition fromfrom
toto
with the labelsymbol
,null
iffrom
isnull
,to
isnull
, or the symbol is not valid
-
clone
-
newInstance
Description copied from class:Automaton
Creates a new automaton that has the same type of this automaton. Note that this methods should only create an instance.- Specified by:
newInstance
in classAutomaton
- Returns:
- a new automaton that has the same type of this automaton
-
getRunsForInput
Returns all possible runs of this automaton on a specified (unexpanded) input sequence starting from some initial state. Note that each run will start with an initial state.- Parameters:
input
- an unexpanded input sequence- Returns:
- all possible runs of this automaton on
input
-
getRunsForInput
Returns all possible traces of this automaton starting from a specified state on a specified (unexpanded) input sequence. Note that each trace will start with the specified state. If the input sequence is empty, this method will return a state list containing only the starting state.- Parameters:
start
- a starting stateinput
- an unexpanded input sequence- Returns:
- all possible traces of this automaton starting from
start
oninput
-
getInputForPath
Returns an input sequence that has a specified run of this automaton,null
if there is no input sequence that has such a run.- Parameters:
run
- a state run- Returns:
- an input sequence that has the run
path
of this automaton,null
if there is no input sequence that has such a run
-