Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Concepts
AutomatonNormalize.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <alib/deque>
9#include <alib/vector>
10#include <alib/set>
11#include <alib/multiset>
12#include <alib/map>
13
16
20
21namespace automaton {
22
27public:
28 template < class StateType >
30
31 template < class StateType >
33
34 template < class StateType >
36
37 template < class StateType >
38 static DefaultStateType normalizeState ( StateType && state);
39
40 template < class SymbolType >
42
43 template < class SymbolType >
45
46};
47
48template < class StateType >
51 for ( StateType && state : ext::make_mover ( states ) )
52 res.insert ( normalizeState ( std::move ( state ) ) );
53
54 return res;
55}
56
57template < class StateType >
60 for ( StateType && state : ext::make_mover ( states ) )
61 res.insert ( normalizeState ( std::move ( state ) ) );
62
63 return res;
64}
65
66template < class StateType >
69 for ( StateType & state : states )
70 res.push_back ( normalizeState ( std::move ( state ) ) );
71
72 return res;
73}
74
75template < class StateType >
77 return DefaultStateType ( std::forward < StateType > ( state ) );
78}
79
80template < class SymbolType >
82 if ( symbol.is_epsilon ( ) )
84 else
86}
87
88template < class SymbolType >
90 return std::move ( regexp ).normalize ( );
91
92}
93
94} /* namespace automaton */
95
96
static DefaultSymbolType normalizeSymbol(SymbolType &&symbol)
Definition: SymbolNormalize.h:68
Definition: AutomatonNormalize.h:26
static common::symbol_or_epsilon< DefaultSymbolType > normalizeSymbolEpsilon(common::symbol_or_epsilon< SymbolType > &&symbol)
Definition: AutomatonNormalize.h:81
static DefaultStateType normalizeState(StateType &&state)
Definition: AutomatonNormalize.h:76
static ext::multiset< DefaultStateType > normalizeStates(ext::multiset< StateType > &&states)
Definition: AutomatonNormalize.h:49
static regexp::UnboundedRegExpStructure< DefaultSymbolType > normalizeRegExp(regexp::UnboundedRegExpStructure< SymbolType > &&regexp)
Definition: AutomatonNormalize.h:89
Definition: symbol_or_epsilon.hpp:24
Definition: multiset.hpp:44
Definition: set.hpp:44
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Definition: Object.h:16
Represents unbounded regular expression structure. Regular expression is stored as a tree of Unbounde...
Definition: UnboundedRegExpStructure.h:47
object::Object DefaultStateType
Definition: DefaultStateType.h:10
typename T::StateType StateType
Definition: ToGrammarLeftRG.h:64
return res
Definition: MinimizeByPartitioning.h:145
Definition: ToGrammar.h:31
reference_mover< T > make_mover(T &param)
Move adaptor construction function specialized to lvalue reference parameter.
Definition: iterator.hpp:468
Definition: ToAutomaton.h:15