Class TotalFSATransformer<L extends LabelInterface>

  extended by laser.regularlanguage.fsa.TotalFSATransformer<L>
Type Parameters:
L - The type of labels used by the FSA

public class TotalFSATransformer<L extends LabelInterface>
extends java.lang.Object

The TotalFSATransformer class transforms the given FSA into a total FSA.

Nathan Jokel (, Heather M. Conboy

Constructor Summary
          Creates a new TotalFSATransformer.
Method Summary
protected  java.util.Set<L> getLabels(AlphabetInterface<L> alphabet, FSATransitionInterface<L> transition)
          Gets the set of labels used by the given transition.
 FSAStateInterface<L> makeTotal(MutableFSAInterface<L> fsa, java.lang.Object[] trapStateArgs, java.lang.Object[] trapTransitionArgs)
          Makes the given FSA total if it is not already.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public TotalFSATransformer()
Creates a new TotalFSATransformer.

Method Detail


public FSAStateInterface<L> makeTotal(MutableFSAInterface<L> fsa,
                                      java.lang.Object[] trapStateArgs,
                                      java.lang.Object[] trapTransitionArgs)
Makes the given FSA total if it is not already. Making an FSA total does not change the set of input strings that it accepts.

A non-accepting state is added to the FSA and a reference to it is returned. Transitions on Labels are added as necessary from every state in the FSA to target this new state to make the FSA total. Call the added state qtrap. (∀ l ∈ Σ, qQ : (∄ tT : source(t) = qlabel(t) = l) → add a transition t' to T such that source(t') = qlabel(t') = ltarget(t') = qtrap). This takes into account any transitions in T specified by transitions on LabelPatterns.

If this FSA was already total, no state is added, and instead null is returned. PRECONDITIONS: The given FSA must be non-null.

fsa - The given FSA to be made total
trapStateArgs - Any required arguments for the new trap state
trapTransitionArgs - Any required arguments for the new trap transitions
A reference to the non-accepting state that was added, or null if no state was added.
See Also:


protected java.util.Set<L> getLabels(AlphabetInterface<L> alphabet,
                                     FSATransitionInterface<L> transition)
Gets the set of labels used by the given transition.

alphabet - The alphabet of the FSA
transition - The transition to be considered
The set of labels used by the given transition
java.lang.UnsupportedOperationException - if the transition is not supported