Class WeightedAutomaton<L,​S,​W extends Semiring>

  • Type Parameters:
    L -
    S -
    W -

    public abstract class WeightedAutomaton<L,​S,​W extends Semiring>
    extends Object
    A P-automaton that represents accepts a given configuration c = (L, S, W). The automaton is initially created by WPDS.waccept() and can be saturated using post* or pre*. Generic L refers to control locations of WPDS. Generic S refers to stack symbols of WPDS. Generic W refers to weights.
    • Field Detail

      • states

        protected Set<S> states
    • Constructor Detail

      • WeightedAutomaton

        public WeightedAutomaton​(S initialState)
    • Method Detail

      • createState

        public abstract S createState​(S d,
                                      L loc)
        Implement this with specific instances of S and L.
        Parameters:
        d -
        loc -
        Returns:
      • isGeneratedState

        public abstract boolean isGeneratedState​(S d)
        Implement this for a specific S.
        Parameters:
        d -
        Returns:
      • epsilon

        public abstract L epsilon()
        Implement this for a specific L.
        Returns:
      • addTransition

        public void addTransition​(Transition<L,​S> trans,
                                  W weight)
      • addTransition

        public boolean addTransition​(Transition<L,​S> trans)
      • getInitialState

        public S getInitialState()
      • getFinalState

        public Set<S> getFinalState()
      • toDotString

        public String toDotString()
      • toLabelGroupedDotString

        public String toLabelGroupedDotString()
      • getStates

        public Set<S> getStates()
      • getNodes

        public Set<S> getNodes()
      • combineWeightForTransition

        public boolean combineWeightForTransition​(Transition<L,​S> trans,
                                                  W weight)
      • getWeightFor

        public W getWeightFor​(Transition<L,​S> trans)
      • addFinalState

        public void addFinalState​(S state)
      • getZero

        public abstract W getZero()
      • getOne

        public abstract W getOne()
      • getTransitionTargetsIgnoringEpsilon

        public Collection<S> getTransitionTargetsIgnoringEpsilon​(S start,
                                                                 L label)
        Gets targets q of the relation p~γ~>q.
        Parameters:
        start -
        label -
        Returns:
      • addUnbalancedState

        public void addUnbalancedState​(S state)
      • getTransitionsToFinalWeights

        public Map<Transition<L,​S>,​W> getTransitionsToFinalWeights()
      • containsLoop

        public boolean containsLoop()
      • getLongestPath

        public Set<L> getLongestPath()