regal::DFAAutomaton< StateLabel_t, Sigma > Class Template Reference

#include <DFAAutomaton.hpp>

Inheritance diagram for regal::DFAAutomaton< StateLabel_t, Sigma >:

regal::AbstractAutomaton< StateLabel_t, Sigma > List of all members.

Public Member Functions

void addTransition (const StateLabel_t &start, const StateLabel_t &end, const Sigma &value)
Pair< int, int > createState (const Pair< int, int > &value)
int createState (const int &value=0)
void deleteLastState ()
 DFAAutomaton (const int &sSize, const Alphabet< Sigma > &a)
int getArrivalNumericalState (const int &start, const Sigma &word)
StateLabel_t getArrivalState (const StateLabel_t &start, const Sigma &word)
int getSize ()
bool isFinal (const StateLabel_t &sl)
bool isInitial (const StateLabel_t &sl)
void setStateAsFinal (const StateLabel_t &sl, const bool &value)
void setStateAsInitial (const StateLabel_t &sl, const bool &value)
void toDOT (DotConverter *dc)
void toGasteX (GasteXConverter *gc)
StateLabel_t undefinedTransition () const
virtual ~DFAAutomaton ()

Friends

ostream & operator<< (ostream &o, const DFAAutomaton< Pair< int, int >, char > &a)
ostream & operator<< (ostream &o, const DFAAutomaton< int, char > &a)

template<typename StateLabel_t, typename Sigma>
class regal::DFAAutomaton< StateLabel_t, Sigma >


Constructor & Destructor Documentation

template<typename StateLabel_t, typename Sigma>
regal::DFAAutomaton< StateLabel_t, Sigma >::DFAAutomaton ( const int &  sSize,
const Alphabet< Sigma > &  a 
) [inline]

Creates a DFAAutomaton.

Parameters:
sSize is the maximal number of states in the automaton. (Actually max-1 since we let the possibility to complete the automaton
a is the alphabet

template<typename StateLabel_t, typename Sigma>
virtual regal::DFAAutomaton< StateLabel_t, Sigma >::~DFAAutomaton (  )  [inline, virtual]

Destroy the current DFAAutomaton


Member Function Documentation

template<typename StateLabel_t, typename Sigma>
void regal::DFAAutomaton< StateLabel_t, Sigma >::addTransition ( const StateLabel_t &  start,
const StateLabel_t &  end,
const Sigma &  value 
) [inline, virtual]

Adds a transtition between start and end.

Parameters:
start is the state where the transition comes from.
end is the state pointed by the transition
value is the label associated to the transition.

Implements regal::AbstractAutomaton< StateLabel_t, Sigma >.

template<typename StateLabel_t, typename Sigma>
Pair<int,int> regal::DFAAutomaton< StateLabel_t, Sigma >::createState ( const Pair< int, int > &  value  )  [inline]

template<typename StateLabel_t, typename Sigma>
int regal::DFAAutomaton< StateLabel_t, Sigma >::createState ( const int &  value = 0  )  [inline]

This function returns a label for a new state and reallocate memory if it's necessary.

Parameters:
value isn't used in this specification
Returns:
the state added in the automaton

template<typename StateLabel_t, typename Sigma>
void regal::DFAAutomaton< StateLabel_t, Sigma >::deleteLastState (  )  [inline]

This function descreases the number of definied states. Since the automaton is defined as a matrix, it doesn't reduces the memory space used by the automaton

template<typename StateLabel_t, typename Sigma>
int regal::DFAAutomaton< StateLabel_t, Sigma >::getArrivalNumericalState ( const int &  start,
const Sigma &  word 
) [inline]

Returns q, with p-->w-->q

Parameters:
start is the starting state
word is the label on the transition coming out from start
Returns:
q, with p-->w-->q

template<typename StateLabel_t, typename Sigma>
StateLabel_t regal::DFAAutomaton< StateLabel_t, Sigma >::getArrivalState ( const StateLabel_t &  start,
const Sigma &  word 
) [inline]

Returns q, with p-->w-->q

Parameters:
start is the starting state
word is the label on the transition coming out from start
Returns:
q, with p-->w-->q

template<typename StateLabel_t, typename Sigma>
int regal::DFAAutomaton< StateLabel_t, Sigma >::getSize (  )  [inline, virtual]

Returns the actual size of the automaton

Returns:
the actual size of the automaton

Implements regal::AbstractAutomaton< StateLabel_t, Sigma >.

template<typename StateLabel_t, typename Sigma>
bool regal::DFAAutomaton< StateLabel_t, Sigma >::isFinal ( const StateLabel_t &  sl  )  [inline, virtual]

Checks if a state is Final

Parameters:
s1 is the state we want to verify
Returns:
true if s1 is final, false otherwise

Implements regal::AbstractAutomaton< StateLabel_t, Sigma >.

template<typename StateLabel_t, typename Sigma>
bool regal::DFAAutomaton< StateLabel_t, Sigma >::isInitial ( const StateLabel_t &  sl  )  [inline, virtual]

Checks if a state is initial

Parameters:
s1 is the state we want to verify
Returns:
true if s1 is initial, false otherwise

Implements regal::AbstractAutomaton< StateLabel_t, Sigma >.

template<typename StateLabel_t, typename Sigma>
void regal::DFAAutomaton< StateLabel_t, Sigma >::setStateAsFinal ( const StateLabel_t &  sl,
const bool &  value 
) [inline, virtual]

Set a state as final

Parameters:
s1 is the state to parameter

Implements regal::AbstractAutomaton< StateLabel_t, Sigma >.

template<typename StateLabel_t, typename Sigma>
void regal::DFAAutomaton< StateLabel_t, Sigma >::setStateAsInitial ( const StateLabel_t &  sl,
const bool &  value 
) [inline, virtual]

Set a state as initial

Parameters:
s1 is the state to parameter

Implements regal::AbstractAutomaton< StateLabel_t, Sigma >.

template<typename StateLabel_t, typename Sigma>
void regal::DFAAutomaton< StateLabel_t, Sigma >::toDOT ( DotConverter dc  )  [inline]

Convert the current automaton into a DOT file

Parameters:
F is the file where the DOT format automaton will be saved

template<typename StateLabel_t, typename Sigma>
void regal::DFAAutomaton< StateLabel_t, Sigma >::toGasteX ( GasteXConverter gc  )  [inline]

Translate a DFA into gasteX file format, in order to have a graphical view of the object.

Parameters:
gc is the object which generate gasteX code.

template<typename StateLabel_t, typename Sigma>
StateLabel_t regal::DFAAutomaton< StateLabel_t, Sigma >::undefinedTransition (  )  const [inline, virtual]

Returns the value associated to an undefined transition according to the type of the states

Returns:
the value associated to an undefined transition

Implements regal::AbstractAutomaton< StateLabel_t, Sigma >.


Friends And Related Function Documentation

template<typename StateLabel_t, typename Sigma>
ostream& operator<< ( ostream &  o,
const DFAAutomaton< Pair< int, int >, char > &  a 
) [friend]

Print a DFA automaton

Parameters:
o is the stream in which we add the DFA's description
a is the DFA we want to print
Returns:
the modified stream

template<typename StateLabel_t, typename Sigma>
ostream& operator<< ( ostream &  o,
const DFAAutomaton< int, char > &  a 
) [friend]

Print a DFA automaton

Parameters:
o is the stream in which we add the DFA's description
a is the DFA we want to print
Returns:
the modified stream


The documentation for this class was generated from the following file:
Generated on Mon Sep 29 16:33:59 2008 for REGAL by  doxygen 1.5.1