Package owl.automaton

Interface MutableAutomaton<S,​A extends EmersonLeiAcceptance>

    • Method Detail

      • acceptance

        void acceptance​(A acceptance)
      • updateAcceptance

        default void updateAcceptance​(Function<? super A,​? extends A> updater)
      • 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 a state 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 specified states 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 the source state under valuation.
        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 - If source is not contained in the automaton.
      • addEdge

        void addEdge​(S source,
                     BddSet valuations,
                     Edge<? extends S> edge)
        Adds transitions from the source state under valuations.
        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 - If source is not contained in the automaton
      • removeEdge

        default void removeEdge​(S source,
                                BitSet valuation,
                                S destination)
        Removes all transition from source under valuation to destination. Requires both states to be present in the automaton.
        Parameters:
        source - The source state.
        valuation - The valuation.
        destination - The destination state.
        Throws:
        IllegalArgumentException - If either source or destination are not present in the automaton.
        See Also:
        removeEdge(Object, BddSet, Object)
      • removeEdge

        void removeEdge​(S source,
                        BddSet valuations,
                        S destination)
        Removes all transition from source under valuations to destination. Requires both states to be present in the automaton.
        Parameters:
        source - The source state.
        valuations - The valuations.
        destination - The destination state.
        Throws:
        IllegalArgumentException - If either source or destination 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 specified states according to updater.

        The function is allowed to return null which indicates that the edge should be removed. Requires all states 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 of states is not present in the automaton.
      • updateEdges

        void updateEdges​(BiFunction<S,​Edge<S>,​Edge<S>> updater)
        Remaps each edge of the automaton according to updater.

        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.