Package de.breakpointsec.pushdown.fsm
Class WeightedAutomaton<L,S,W extends Semiring>
- java.lang.Object
-
- de.breakpointsec.pushdown.fsm.WeightedAutomaton<L,S,W>
-
- 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.
-
-
Constructor Summary
Constructors Constructor Description WeightedAutomaton(S initialState)
-
Method Summary
-
-
-
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:
-
getTransitions
public Collection<Transition<L,S>> getTransitions()
-
addTransition
public void addTransition(Transition<L,S> trans, W weight)
-
addTransition
public boolean addTransition(Transition<L,S> trans)
-
getInitialState
public S getInitialState()
-
toDotString
public String toDotString()
-
toLabelGroupedDotString
public String toLabelGroupedDotString()
-
getEdges
public Set<Transition<L,S>> getEdges()
-
setWeightForTransition
public void setWeightForTransition(Transition<L,S> trans, W weight) throws IllegalTransitionException
- Throws:
IllegalTransitionException
-
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()
-
getTransitionsOutOf
public Collection<Transition<L,S>> getTransitionsOutOf(S s)
-
getTransitionsInto
public Collection<Transition<L,S>> getTransitionsInto(S s)
-
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()
-
-