jInfer

cz.cuni.mff.ksi.jinfer.twostep.processing.automatonmergingstate.regexping.stateremoval
Class StateRemovalRegexpAutomaton<T>

java.lang.Object
  extended by cz.cuni.mff.ksi.jinfer.base.automaton.Automaton<Regexp<T>>
      extended by cz.cuni.mff.ksi.jinfer.twostep.processing.automatonmergingstate.regexping.RegexpAutomaton<T>
          extended by cz.cuni.mff.ksi.jinfer.twostep.processing.automatonmergingstate.regexping.stateremoval.StateRemovalRegexpAutomaton<T>

public class StateRemovalRegexpAutomaton<T>
extends RegexpAutomaton<T>

Extending automaton to support operations for method of state removal conversion of automaton into regular expression. By subsequently calling removeState automaton gets smaller and smaller, and combines regular expressions on transitions being removed. Resulting an automaton with two phantom states and one transition with final regular expression.

Two phantom states are superInitialState and superFinalState, they are created as new states when creating automaton from another automaton. All other states have to be removed to obtain regular expression.


Field Summary
 
Fields inherited from class cz.cuni.mff.ksi.jinfer.base.automaton.Automaton
delta, initialState, mergedStates, nameMap, newStateName, reverseDelta, reverseMergedStates
 
Constructor Summary
StateRemovalRegexpAutomaton(RegexpAutomaton<T> anotherAutomaton)
          Given RegexpAutomaton, creates state removal automaton with superFinal and superInitial state.
StateRemovalRegexpAutomaton(StateRemovalRegexpAutomaton<T> anotherAutomaton)
          Cloning constructor.
 
Method Summary
 Step<Regexp<T>> collapseStateParallelSteps(State<Regexp<T>> state)
           
 void finalStep()
           
 List<Step<Regexp<T>>> getLoopSteps(State<Regexp<T>> state)
          Get loops of state.
 State<Regexp<T>> getSuperFinalState()
          Get superFinalState.
 State<Regexp<T>> getSuperInitialState()
          Get superInitialState.
 void removeState(State<Regexp<T>> _state)
          Removes from automaton state given by by-passing its {in | out}-transitions.
 
Methods inherited from class cz.cuni.mff.ksi.jinfer.base.automaton.Automaton
buildPTAOnRegexp, buildPTAOnSymbol, createNewState, getDelta, getInitialState, getMergedStates, getNewStateName, getOutStepOnSymbol, getRealState, getReverseDelta, getReverseMergedStates, mergeStates, mergeStates, toString, toTestString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StateRemovalRegexpAutomaton

public StateRemovalRegexpAutomaton(RegexpAutomaton<T> anotherAutomaton)
Given RegexpAutomaton, creates state removal automaton with superFinal and superInitial state.

Parameters:
anotherAutomaton - regexp automaton whose structure we will copy

StateRemovalRegexpAutomaton

public StateRemovalRegexpAutomaton(StateRemovalRegexpAutomaton<T> anotherAutomaton)
Cloning constructor.

Parameters:
anotherAutomaton - another StateRemovalRegexpAutomaton we will be clone of
Method Detail

collapseStateParallelSteps

public Step<Regexp<T>> collapseStateParallelSteps(State<Regexp<T>> state)

removeState

public void removeState(State<Regexp<T>> _state)
Removes from automaton state given by by-passing its {in | out}-transitions.

Parameters:
state - to be removed from automaton

finalStep

public void finalStep()

getSuperFinalState

public State<Regexp<T>> getSuperFinalState()
Get superFinalState.

Returns:
superFinalState superFinal state

getSuperInitialState

public State<Regexp<T>> getSuperInitialState()
Get superInitialState.

Returns:
superInitialState superInitial state

getLoopSteps

public List<Step<Regexp<T>>> getLoopSteps(State<Regexp<T>> state)
Get loops of state. If someone is interested which steps of state are loops, this method will tell him.

Parameters:
state - to inspect
Returns:
steps which are loops (destination == state)

jInfer

Generated on Fri Dec 9 00:01:25 CET 2011