Generated on Wed Nov 1 15:05:13 2006 for Gecode by doxygen 1.4.5

Gecode::DFA Class Reference
[Regular constraints]

#include <int.hh>

List of all members.


Detailed Description

Deterministic finite automaton.

After initialization, the start state is always zero. The final states are contiguous ranging from the first to the last final state.

Definition at line 672 of file int.hh.

Public Member Functions

 DFA (void)
 Default constructor (empty DFA).
 DFA (int s, Transition t[], int f[], bool minimize=true)
 Initialize DFA by transitions.
 DFA (REG &r)
 Initialize DFA by regular expression r.
 DFA (const DFA &d)
 Initialize by DFA d (DFA is shared).
const DFAoperator= (const DFA &)
 Initialize by DFA d (DFA is shared).
 ~DFA (void)
 Destructor.
void update (bool share, DFA &d)
 Update this DFA to d.
unsigned int n_states (void) const
 Return the number of states.
unsigned int n_transitions (void) const
 Return the number of transitions.
int final_fst (void) const
 Return the number of the first final state.
int final_lst (void) const
 Return the number of the last final state.
int symbol_min (void) const
 Return smallest symbol in DFA.
int symbol_max (void) const
 Return largest symbol in DFA.

Protected Member Functions

void init (int start, Transition t_spec[], int f_spec[], bool minimize)
 Initialize automaton.

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &, const Gecode::DFA &d)

Classes

class  DFAI
 Data stored for a DFA. More...
class  Transitions
 Iterator for transitions (sorted by symbols/values). More...
class  Transition
 Specification of a DFA transition. More...


Constructor & Destructor Documentation

Gecode::DFA::DFA void   )  [inline]
 

Default constructor (empty DFA).

Definition at line 69 of file dfa.icc.

Gecode::DFA::DFA int  s,
Transition  t[],
int  f[],
bool  minimize = true
[inline]
 

Initialize DFA by transitions.

  • Start state is given by s.
  • Transitions are described by t, where the last element must have -1 as value for i_state.
  • Final states are given by f, where the last final element must be -1.
  • Minimizes the DFA, if minimize is true.

Definition at line 72 of file dfa.icc.

Gecode::DFA::DFA REG r  ) 
 

Initialize DFA by regular expression r.

Definition at line 657 of file reg.cc.

Gecode::DFA::DFA const DFA d  )  [inline]
 

Initialize by DFA d (DFA is shared).

Definition at line 78 of file dfa.icc.

Gecode::DFA::~DFA void   )  [inline]
 

Destructor.

Definition at line 94 of file dfa.icc.


Member Function Documentation

void Gecode::DFA::init int  start,
Transition  t_spec[],
int  f_spec[],
bool  minimize
[protected]
 

Initialize automaton.

Start state start, transition specification t_spec, final state specification f_spec and a flag minimize whether the automaton should be minimized

Definition at line 143 of file dfa.cc.

const DFA & Gecode::DFA::operator= const DFA  )  [inline]
 

Initialize by DFA d (DFA is shared).

Definition at line 100 of file dfa.icc.

void Gecode::DFA::update bool  share,
DFA d
[inline]
 

Update this DFA to d.

If share is true, share the same d. If not, create an independent copy from d.

Definition at line 84 of file dfa.icc.

unsigned int Gecode::DFA::n_states void   )  const [inline]
 

Return the number of states.

Definition at line 111 of file dfa.icc.

unsigned int Gecode::DFA::n_transitions void   )  const [inline]
 

Return the number of transitions.

Definition at line 116 of file dfa.icc.

int Gecode::DFA::final_fst void   )  const [inline]
 

Return the number of the first final state.

Definition at line 121 of file dfa.icc.

int Gecode::DFA::final_lst void   )  const [inline]
 

Return the number of the last final state.

Definition at line 126 of file dfa.icc.

int Gecode::DFA::symbol_min void   )  const [inline]
 

Return smallest symbol in DFA.

Definition at line 131 of file dfa.icc.

int Gecode::DFA::symbol_max void   )  const [inline]
 

Return largest symbol in DFA.

Definition at line 137 of file dfa.icc.


Friends And Related Function Documentation

std::ostream & operator<< std::ostream &  ,
const Gecode::DFA d
[related]
 

Print DFA d

Definition at line 421 of file dfa.cc.


The documentation for this class was generated from the following files: