Package owl.automaton
Interface MutableAutomaton<S,A extends EmersonLeiAcceptance>
-
- Type Parameters:
S
- the type of the states of the automatonA
- the type of the omega-acceptance condition of the automaton
- All Superinterfaces:
Automaton<S,A>
- All Known Implementing Classes:
HashMapAutomaton
public interface MutableAutomaton<S,A extends EmersonLeiAcceptance> extends Automaton<S,A>
A mutation interface extendingAutomaton
. As the super interface requires that only from the initial states reachable states are present, after any operation that might introduce unreachable states (a list is given below) it is required to calltrim()
before calling any method of theAutomaton
interface. For methods that do not change the reachability (a list is given below) callingtrim()
has no effect and is not required.Methods that do require calling
trim()
afterwards:initialStates(Collection)
removeInitialState(Object)
addState(Object)
removeState(Object)
removeStateIf(Predicate)
removeEdge(Object, BitSet, Object)
removeEdge(Object, BddSet, Object)
updateEdges(BiFunction)
updateEdges(Set, BiFunction)
Methods that do not require calling
trim()
afterwards:
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface owl.automaton.Automaton
Automaton.Property
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
acceptance(A acceptance)
default void
addEdge(S source, BitSet valuation, Edge<? extends S> edge)
Adds a transition from thesource
state undervaluation
.void
addEdge(S source, BddSet valuations, Edge<? extends S> edge)
Adds transitions from thesource
state undervaluations
.void
addInitialState(S initialState)
Add an initial state to the automaton.void
addState(S state)
Adds astate
without outgoing edges to the set of states.void
initialStates(Collection<? extends S> initialStates)
Sets the set of initial states of the automaton.default void
removeEdge(S source, BitSet valuation, S destination)
Removes all transition fromsource
undervaluation
todestination
.void
removeEdge(S source, BddSet valuations, S destination)
Removes all transition fromsource
undervaluations
todestination
.void
removeInitialState(S state)
default void
removeState(S state)
Removes a state and all transitions involving it from the automaton.void
removeStateIf(Predicate<? super S> states)
Removes the specifiedstates
and all transitions involving them from the automaton.void
trim()
Removes unreachable states and adjust internal data structures after mutation.default void
updateAcceptance(Function<? super A,? extends A> updater)
void
updateEdges(BiFunction<S,Edge<S>,Edge<S>> updater)
Remaps each edge of the automaton according toupdater
.void
updateEdges(Set<? extends S> states, BiFunction<? super S,Edge<S>,Edge<S>> updater)
Remaps each outgoing edge of the specifiedstates
according toupdater
.-
Methods inherited from interface owl.automaton.Automaton
acceptance, atomicPropositions, edge, edgeMap, edges, edges, edgeTree, factory, initialState, initialStates, is, predecessors, states, successor, successors, successors
-
-
-
-
Method Detail
-
acceptance
void acceptance(A acceptance)
-
initialStates
void initialStates(Collection<? extends S> initialStates)
Sets the set of initial states of the automaton.- Parameters:
initialStates
- The new set of initial states (potentially empty)
-
addInitialState
void addInitialState(S initialState)
Add an initial state to the automaton.- Parameters:
initialState
- The added initial state.
-
removeInitialState
void removeInitialState(S state)
-
addState
void addState(S state)
Adds astate
without outgoing edges to the set of states. If the state is already present, nothing is changed.- Parameters:
state
- The state to be added.
-
removeState
default void removeState(S state)
Removes a state and all transitions involving it from the automaton. If the automaton does not contain the specified state, nothing is changed.- Parameters:
state
- The state to be removed.
-
removeStateIf
void removeStateIf(Predicate<? super S> states)
Removes the specifiedstates
and all transitions involving them from the automaton.- Parameters:
states
- The states to be removed.
-
addEdge
default void addEdge(S source, BitSet valuation, Edge<? extends S> edge)
Adds a transition from thesource
state undervaluation
.- Parameters:
source
- The source state.valuation
- The valuation under which this transition is possible.edge
- The respective edge, containing destination and acceptance information. If the successor is not already present, it gets added to the transition table.- Throws:
IllegalArgumentException
- Ifsource
is not contained in the automaton.
-
addEdge
void addEdge(S source, BddSet valuations, Edge<? extends S> edge)
Adds transitions from thesource
state undervaluations
.- Parameters:
source
- The source state.valuations
- The valuations under which this transition is possible.edge
- The respective edge, containing destination and acceptance information.- Throws:
IllegalArgumentException
- Ifsource
is not contained in the automaton
-
removeEdge
default void removeEdge(S source, BitSet valuation, S destination)
Removes all transition fromsource
undervaluation
todestination
. Requires both states to be present in the automaton.- Parameters:
source
- The source state.valuation
- The valuation.destination
- The destination state.- Throws:
IllegalArgumentException
- If eithersource
ordestination
are not present in the automaton.- See Also:
removeEdge(Object, BddSet, Object)
-
removeEdge
void removeEdge(S source, BddSet valuations, S destination)
Removes all transition fromsource
undervaluations
todestination
. Requires both states to be present in the automaton.- Parameters:
source
- The source state.valuations
- The valuations.destination
- The destination state.- Throws:
IllegalArgumentException
- If eithersource
ordestination
are not present in the automaton.
-
updateEdges
void updateEdges(Set<? extends S> states, BiFunction<? super S,Edge<S>,Edge<S>> updater)
Remaps each outgoing edge of the specifiedstates
according toupdater
.The function is allowed to return
null
which indicates that the edge should be removed. Requires allstates
to be present in the automaton.- Parameters:
states
- The states whose outgoing edges are to be remapped.updater
- The remapping function. The updater needs to be stateless, since it might be called with unreachable states.- Throws:
IllegalArgumentException
- If any state ofstates
is not present in the automaton.
-
updateEdges
void updateEdges(BiFunction<S,Edge<S>,Edge<S>> updater)
Remaps each edge of the automaton according toupdater
.The function is allowed to return
null
which indicates that the edge should be removed.- Parameters:
updater
- The remapping function. The updater needs to be stateless, since it might be called with unreachable states.- See Also:
updateEdges(Set, BiFunction)
-
trim
void trim()
Removes unreachable states and adjust internal data structures after mutation.
-
-