Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
CompactNFA.h
Go to the documentation of this file.
1
6/*
7 * This file is part of Algorithms library toolkit.
8 * Copyright (C) 2017 Jan Travnicek (jan.travnicek@fit.cvut.cz)
9
10 * Algorithms library toolkit is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14
15 * Algorithms library toolkit is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19
20 * You should have received a copy of the GNU General Public License
21 * along with Algorithms library toolkit. If not, see <http://www.gnu.org/licenses/>.
22 */
23
24#pragma once
25
26#include <ostream>
27
28#include <alib/multimap>
29#include <alib/set>
30
31#include <ext/algorithm>
32
33#include <core/components.hpp>
35
38
40
42
43#include <core/normalize.hpp>
46
48#include "EpsilonNFA.h"
50#include "NFA.h"
51#include "CompactDFA.h"
52#include "DFA.h"
53
54namespace automaton {
55
56class InputAlphabet;
57class States;
58class FinalStates;
59class InitialState;
60
77template < class SymbolTypeT = DefaultSymbolType, class StateTypeT = DefaultStateType >
78class CompactNFA final : public core::Components < CompactNFA < SymbolTypeT, StateTypeT >, ext::set < SymbolTypeT >, component::Set, InputAlphabet, ext::set < StateTypeT >, component::Set, std::tuple < States, FinalStates >, StateTypeT, component::Value, InitialState > {
79public:
80 typedef SymbolTypeT SymbolType;
81 typedef StateTypeT StateType;
82
83private:
88
89public:
95 explicit CompactNFA ( StateType initialState );
96
105 explicit CompactNFA ( ext::set < StateType > states, ext::set < SymbolType > inputAlphabet, StateType initialState, ext::set < StateType > finalStates );
106
107 /*
108 * \brief Creates a new instance of the automaton based on the Multi Initial State Epsilon Nondeterministic finite automaton.
109 *
110 * \param other the Multi Initial State Epsilon Nondeterministic finite automaton
111 */
113
114 /*
115 * \brief Creates a new instance of the automaton based on the Epsilon Nondeterministic finite automaton.
116 *
117 * \param other the Epsilon nondeterministic finite automaton
118 */
119 explicit CompactNFA ( const EpsilonNFA < SymbolType, StateType > & other );
120
121 /*
122 * \brief Creates a new instance of the automaton based on the Nondeterministic finite automaton with multiple initial states.
123 *
124 * \param other the Nondeterministic finite automaton with multiple initial states
125 */
127
128 /*
129 * \brief Creates a new instance of the automaton based on the Nondeterministic finite automaton.
130 *
131 * \param other the Nondeterministic finite automaton
132 */
133 explicit CompactNFA ( const NFA < SymbolType, StateType > & other );
134
135 /*
136 * \brief Creates a new instance of the automaton based on the Deterministic finite automaton.
137 *
138 * \param other the Deterministic finite automaton
139 */
140 explicit CompactNFA ( const CompactDFA < SymbolType, StateType > & other );
141
142 /*
143 * \brief Creates a new instance of the automaton based on the Deterministic finite automaton.
144 *
145 * \param other the Deterministic finite automaton
146 */
147 explicit CompactNFA ( const DFA < SymbolType, StateType > & other );
148
154 const StateType & getInitialState ( ) const & {
155 return this->template accessComponent < InitialState > ( ).get ( );
156 }
157
164 return std::move ( this->template accessComponent < InitialState > ( ).get ( ) );
165 }
166
174 bool setInitialState ( StateType state ) {
175 return this->template accessComponent < InitialState > ( ).set ( std::move ( state ) );
176 }
177
183 const ext::set < StateType > & getStates ( ) const & {
184 return this->template accessComponent < States > ( ).get ( );
185 }
186
193 return std::move ( this->template accessComponent < States > ( ).get ( ) );
194 }
195
203 bool addState ( StateType state ) {
204 return this->template accessComponent < States > ( ).add ( std::move ( state ) );
205 }
206
213 this->template accessComponent < States > ( ).set ( std::move ( states ) );
214 }
215
223 void removeState ( const StateType & state ) {
224 this->template accessComponent < States > ( ).remove ( state );
225 }
226
233 return this->template accessComponent < FinalStates > ( ).get ( );
234 }
235
242 return std::move ( this->template accessComponent < FinalStates > ( ).get ( ) );
243 }
244
252 bool addFinalState ( StateType state ) {
253 return this->template accessComponent < FinalStates > ( ).add ( std::move ( state ) );
254 }
255
262 this->template accessComponent < FinalStates > ( ).set ( std::move ( states ) );
263 }
264
272 void removeFinalState ( const StateType & state ) {
273 this->template accessComponent < FinalStates > ( ).remove ( state );
274 }
275
282 return this->template accessComponent < InputAlphabet > ( ).get ( );
283 }
284
291 return std::move ( this->template accessComponent < InputAlphabet > ( ).get ( ) );
292 }
293
301 bool addInputSymbol ( SymbolType symbol ) {
302 return this->template accessComponent < InputAlphabet > ( ).add ( std::move ( symbol ) );
303 }
304
311 this->template accessComponent < InputAlphabet > ( ).add ( std::move ( symbols ) );
312 }
313
320 this->template accessComponent < InputAlphabet > ( ).set ( std::move ( symbols ) );
321 }
322
330 void removeInputSymbol ( const SymbolType & symbol ) {
331 this->template accessComponent < InputAlphabet > ( ).remove ( symbol );
332 }
333
348
360 bool removeTransition ( const StateType & from, const ext::vector < SymbolType > & input, const StateType & to );
361
368
374 ext::multimap < ext::pair < StateType, ext::vector < SymbolType > >, StateType > && getTransitions ( ) &&;
375
383 ext::multimap < ext::pair < StateType, ext::vector < SymbolType > >, StateType > getTransitionsFromState ( const StateType & from ) const;
384
392 ext::multimap < ext::pair < StateType, ext::vector < SymbolType > >, StateType > getTransitionsToState ( const StateType & to ) const;
393
401 auto operator <=> ( const CompactNFA & other ) const {
402 return std::tie ( getStates ( ), getInputAlphabet ( ), getInitialState ( ), getFinalStates ( ), transitions ) <=> std::tie ( other.getStates ( ), other.getInputAlphabet ( ), other.getInitialState ( ), other.getFinalStates ( ), other.getTransitions ( ) );
403 }
404
412 bool operator == ( const CompactNFA & other ) const {
413 return std::tie ( getStates ( ), getInputAlphabet ( ), getInitialState ( ), getFinalStates ( ), transitions ) == std::tie ( other.getStates ( ), other.getInputAlphabet ( ), other.getInitialState ( ), other.getFinalStates ( ), other.getTransitions ( ) );
414 }
415
424 friend ext::ostream & operator << ( ext::ostream & out, const CompactNFA & instance ) {
425 return out << "(CompactNFA"
426 << " states = " << instance.getStates ( )
427 << " inputAlphabet = " << instance.getInputAlphabet ( )
428 << " initialState = " << instance.getInitialState ( )
429 << " finalStates = " << instance.getFinalStates ( )
430 << " transitions = " << instance.getTransitions ( )
431 << ")";
432 }
433};
434
440template < class T >
441class isCompactNFA_impl : public std::false_type {};
442
451template < class SymbolType, class StateType >
452class isCompactNFA_impl < CompactNFA < SymbolType, StateType > > : public std::true_type {};
453
459template < class T >
461
462template < class SymbolType, class StateType >
463CompactNFA < SymbolType, StateType >::CompactNFA ( ext::set < StateType > states, ext::set < SymbolType > inputAlphabet, StateType initialState, ext::set < StateType > finalStates ) : core::Components < CompactNFA, ext::set < SymbolType >, component::Set, InputAlphabet, ext::set < StateType >, component::Set, std::tuple < States, FinalStates >, StateType, component::Value, InitialState > ( std::move ( inputAlphabet ), std::move ( states ), std::move ( finalStates ), std::move ( initialState ) ) {
464}
465
466template < class SymbolType, class StateType >
468}
469
470template < class SymbolType, class StateType >
471CompactNFA < SymbolType, StateType >::CompactNFA ( const MultiInitialStateEpsilonNFA < SymbolType, StateType > & other ) : CompactNFA ( other.getStates ( ) + ext::set < StateType > { common::createUnique ( label::InitialStateLabel::instance < StateType > ( ), other.getStates ( ) ) }, other.getInputAlphabet ( ), common::createUnique ( label::InitialStateLabel::instance < StateType > ( ), other.getStates ( ) ), other.getFinalStates ( ) ) {
472 for ( const auto & transition : other.getTransitions ( ) )
473 if ( transition.first.second.is_epsilon ( ) )
474 transitions.insert ( ext::make_pair ( transition.first.first, ext::vector < SymbolType > { } ), transition.second );
475 else
476 transitions.insert ( ext::make_pair ( transition.first.first, ext::vector < SymbolType > { transition.first.second.getSymbol ( ) } ), transition.second );
477
478 for ( const auto & state : other.getInitialStates ( ) )
479 transitions.insert ( ext::make_pair ( this->getInitialState ( ), ext::vector < SymbolType > { } ), state );
480}
481
482template < class SymbolType, class StateType >
483CompactNFA < SymbolType, StateType >::CompactNFA ( const EpsilonNFA < SymbolType, StateType > & other ) : CompactNFA ( other.getStates ( ), other.getInputAlphabet ( ), other.getInitialState ( ), other.getFinalStates ( ) ) {
484 for ( const auto & transition : other.getTransitions ( ) )
485 if ( transition.first.second.is_epsilon ( ) )
486 transitions.insert ( ext::make_pair ( transition.first.first, ext::vector < SymbolType > { } ), transition.second );
487 else
488 transitions.insert ( ext::make_pair ( transition.first.first, ext::vector < SymbolType > { transition.first.second.getSymbol ( ) } ), transition.second );
489}
490
491template < class SymbolType, class StateType >
492CompactNFA < SymbolType, StateType >::CompactNFA ( const MultiInitialStateNFA < SymbolType, StateType > & other ) : CompactNFA ( other.getStates ( ) + ext::set < StateType > { common::createUnique ( label::InitialStateLabel::instance < StateType > ( ), other.getStates ( ) ) }, other.getInputAlphabet ( ), common::createUnique ( label::InitialStateLabel::instance < StateType > ( ), other.getStates ( ) ), other.getFinalStates ( ) ) {
493 for ( const auto & transition : other.getTransitions ( ) )
494 transitions.insert ( ext::make_pair ( transition.first.first, ext::vector < SymbolType > { transition.first.second } ), transition.second );
495
496 for ( const auto & state : other.getInitialStates ( ) )
497 transitions.insert ( ext::make_pair ( this->getInitialState ( ), ext::vector < SymbolType > { } ), state );
498}
499
500template < class SymbolType, class StateType >
501CompactNFA < SymbolType, StateType >::CompactNFA ( const NFA < SymbolType, StateType > & other ) : CompactNFA ( other.getStates ( ), other.getInputAlphabet ( ), other.getInitialState ( ), other.getFinalStates ( ) ) {
502 for ( const auto & transition : other.getTransitions ( ) )
503 transitions.insert ( ext::make_pair ( transition.first.first, ext::vector < SymbolType > { transition.first.second } ), transition.second );
504}
505
506template < class SymbolType, class StateType >
507CompactNFA < SymbolType, StateType >::CompactNFA ( const CompactDFA < SymbolType, StateType > & other ) : CompactNFA ( other.getStates ( ), other.getInputAlphabet ( ), other.getInitialState ( ), other.getFinalStates ( ) ) {
508 transitions.insert ( other.getTransitions ( ).begin ( ), other.getTransitions ( ).end ( ) );
509}
510
511template < class SymbolType, class StateType >
512CompactNFA < SymbolType, StateType >::CompactNFA ( const DFA < SymbolType, StateType > & other ) : CompactNFA ( other.getStates ( ), other.getInputAlphabet ( ), other.getInitialState ( ), other.getFinalStates ( ) ) {
513 for ( const auto & transition : other.getTransitions ( ) )
514 transitions.insert ( ext::make_pair ( transition.first.first, ext::vector < SymbolType > { transition.first.second } ), transition.second );
515}
516
517template < class SymbolType, class StateType >
519 if ( ! getStates ( ).contains ( from ) )
520 throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist." );
521
522 ext::set < SymbolType > inputStringAlphabet ( input.begin ( ), input.end ( ) );
523
524 // Transition regexp's alphabet must be subset of automaton's alphabet
525 if ( ! std::includes ( getInputAlphabet ( ).begin ( ), getInputAlphabet ( ).end ( ), inputStringAlphabet.begin ( ), inputStringAlphabet.end ( ) ) )
526 throw AutomatonException ( "Input string is over different alphabet than automaton" );
527
528 if ( ! getStates ( ).contains ( to ) )
529 throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist." );
530
531 auto upper_bound = transitions.upper_bound ( ext::tie ( from, input ) );
532 auto lower_bound = transitions.lower_bound ( ext::tie ( from, input ) );
533 auto iter = std::lower_bound ( lower_bound, upper_bound, to, [ ] ( const auto & transition, const auto & target ) { return transition.second < target; } );
534 if ( iter != upper_bound && to >= iter->second )
535 return false;
536
537 ext::pair < StateType, ext::vector < SymbolType > > key = ext::make_pair ( std::move ( from ), std::move ( input ) );
538 transitions.insert ( iter, std::make_pair ( std::move ( key ), std::move ( to ) ) );
539 return true;
540}
541
542template < class SymbolType, class StateType >
544 auto upper_bound = transitions.upper_bound ( ext::tie ( from, input ) );
545 auto lower_bound = transitions.lower_bound ( ext::tie ( from, input ) );
546 auto iter = std::find_if ( lower_bound, upper_bound, [ & ] ( const auto & transition ) { return transition.second == to; } );
547 if ( iter == upper_bound )
548 return false;
549
550 transitions.erase ( iter );
551 return true;
552}
553
554template < class SymbolType, class StateType >
556 return transitions;
557}
558
559template < class SymbolType, class StateType >
561 return std::move ( transitions );
562}
563
564template < class SymbolType, class StateType >
566 if ( ! getStates ( ).contains ( from ) )
567 throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist" );
568
570
571 for ( const std::pair < const ext::pair < StateType, ext::vector < SymbolType > >, StateType > & transition : transitions )
572 if ( transition.first.first == from )
573 transitionsFromState.insert ( transition );
574
575 return transitionsFromState;
576}
577
578template < class SymbolType, class StateType >
580 if ( ! getStates ( ).contains ( to ) )
581 throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist" );
582
584
585 for ( const std::pair < const ext::pair < StateType, ext::vector < SymbolType > >, StateType > & transition : transitions )
586 if ( transition.second == to )
587 transitionsToState.insert ( transition );
588
589 return transitionsToState;
590}
591
592} /* namespace automaton */
593
594namespace core {
595
602template < class SymbolType, class StateType >
603class SetConstraint< automaton::CompactNFA < SymbolType, StateType >, SymbolType, automaton::InputAlphabet > {
604public:
614 for ( const std::pair < const ext::pair < StateType, ext::vector < SymbolType > >, StateType > & transition : automaton.getTransitions ( ) ) {
615 ext::set < SymbolType > alphabet ( transition.first.second.begin ( ), transition.first.second.end ( ) );
616 if ( alphabet.contains ( symbol ) )
617 return true;
618 }
619
620 return false;
621 }
622
632 return true;
633 }
634
642 }
643};
644
651template < class SymbolType, class StateType >
652class SetConstraint< automaton::CompactNFA < SymbolType, StateType >, StateType, automaton::States > {
653public:
663 if ( automaton.getInitialState ( ) == state )
664 return true;
665
666 if ( automaton.getFinalStates ( ).contains ( state ) )
667 return true;
668
669 for ( const std::pair < const ext::pair < StateType, ext::vector < SymbolType > >, StateType > & t : automaton.getTransitions ( ) )
670 if ( t.first.first == state || t.second == state )
671 return true;
672
673 return false;
674 }
675
685 return true;
686 }
687
695 }
696};
697
704template < class SymbolType, class StateType >
705class SetConstraint< automaton::CompactNFA < SymbolType, StateType >, StateType, automaton::FinalStates > {
706public:
716 return false;
717 }
718
728 return automaton.template accessComponent < automaton::States > ( ).get ( ).contains ( state );
729 }
730
738 }
739};
740
747template < class SymbolType, class StateType >
748class ElementConstraint< automaton::CompactNFA < SymbolType, StateType >, StateType, automaton::InitialState > {
749public:
759 return automaton.template accessComponent < automaton::States > ( ).get ( ).contains ( state );
760 }
761
769 }
770};
771
777template < class SymbolType, class StateType >
778struct normalize < automaton::CompactNFA < SymbolType, StateType > > {
780 ext::set < DefaultSymbolType > alphabet = alphabet::SymbolNormalize::normalizeAlphabet ( std::move ( value ).getInputAlphabet ( ) );
781 ext::set < DefaultStateType > states = automaton::AutomatonNormalize::normalizeStates ( std::move ( value ).getStates ( ) );
782 DefaultStateType initialState = automaton::AutomatonNormalize::normalizeState ( std::move ( value ).getInitialState ( ) );
783 ext::set < DefaultStateType > finalStates = automaton::AutomatonNormalize::normalizeStates ( std::move ( value ).getFinalStates ( ) );
784
785 automaton::CompactNFA < > res ( std::move ( states ), std::move ( alphabet ), std::move ( initialState ), std::move ( finalStates ) );
786
787 for ( std::pair < ext::pair < StateType, ext::vector < SymbolType > >, StateType > && transition : ext::make_mover ( std::move ( value ).getTransitions ( ) ) ) {
788 DefaultStateType from = automaton::AutomatonNormalize::normalizeState ( std::move ( transition.first.first ) );
789 ext::vector < DefaultSymbolType > input = alphabet::SymbolNormalize::normalizeSymbols ( std::move ( transition.first.second ) );
790 DefaultStateType target = automaton::AutomatonNormalize::normalizeState ( std::move ( transition.second ) );
791
792 res.addTransition ( std::move ( from ), std::move ( input ), std::move ( target ) );
793 }
794
795 return res;
796 }
797};
798
799} /* namespace core */
800
801extern template class automaton::CompactNFA < >;
802
static ext::set< DefaultSymbolType > normalizeAlphabet(ext::set< SymbolType > &&symbols)
Definition: SymbolNormalize.h:50
static ext::vector< DefaultSymbolType > normalizeSymbols(ext::vector< SymbolType > &&symbols)
Definition: SymbolNormalize.h:86
Definition: AutomatonException.h:15
static DefaultStateType normalizeState(StateType &&state)
Definition: AutomatonNormalize.h:76
static ext::multiset< DefaultStateType > normalizeStates(ext::multiset< StateType > &&states)
Definition: AutomatonNormalize.h:49
Compact deterministic finite automaton. Accepts regular languages. The automaton has a list of symbol...
Definition: CompactDFA.h:73
Compact nondeterministic finite automaton. Accepts regular languages. The automaton has a list of sym...
Definition: CompactNFA.h:78
SymbolTypeT SymbolType
Definition: CompactNFA.h:80
StateType && getInitialState() &&
Definition: CompactNFA.h:163
void removeFinalState(const StateType &state)
Definition: CompactNFA.h:272
const ext::set< StateType > & getFinalStates() const &
Definition: CompactNFA.h:232
void removeState(const StateType &state)
Definition: CompactNFA.h:223
CompactNFA(StateType initialState)
Creates a new instance of the automaton with a concrete initial state.
Definition: CompactNFA.h:467
const ext::multimap< ext::pair< StateType, ext::vector< SymbolType > >, StateType > & getTransitions() const &
Definition: CompactNFA.h:555
ext::multimap< ext::pair< StateType, ext::vector< SymbolType > >, StateType > getTransitionsToState(const StateType &to) const
Definition: CompactNFA.h:579
bool addFinalState(StateType state)
Definition: CompactNFA.h:252
bool setInitialState(StateType state)
Definition: CompactNFA.h:174
void setStates(ext::set< StateType > states)
Definition: CompactNFA.h:212
const ext::set< StateType > & getStates() const &
Definition: CompactNFA.h:183
const StateType & getInitialState() const &
Definition: CompactNFA.h:154
bool addState(StateType state)
Definition: CompactNFA.h:203
const ext::set< SymbolType > & getInputAlphabet() const &
Definition: CompactNFA.h:281
void setFinalStates(ext::set< StateType > states)
Definition: CompactNFA.h:261
bool operator==(const CompactNFA &other) const
Definition: CompactNFA.h:412
StateTypeT StateType
Definition: CompactNFA.h:81
ext::set< SymbolType > && getInputAlphabet() &&
Definition: CompactNFA.h:290
ext::multimap< ext::pair< StateType, ext::vector< SymbolType > >, StateType > getTransitionsFromState(const StateType &from) const
Definition: CompactNFA.h:565
ext::set< StateType > && getStates() &&
Definition: CompactNFA.h:192
bool addInputSymbol(SymbolType symbol)
Definition: CompactNFA.h:301
void removeInputSymbol(const SymbolType &symbol)
Definition: CompactNFA.h:330
bool addTransition(StateType from, ext::vector< SymbolType > input, StateType to)
Add a transition to the automaton.
Definition: CompactNFA.h:518
bool removeTransition(const StateType &from, const ext::vector< SymbolType > &input, const StateType &to)
Removes a transition from the automaton.
Definition: CompactNFA.h:543
void setInputAlphabet(ext::set< SymbolType > symbols)
Definition: CompactNFA.h:319
ext::set< StateType > && getFinalStates() &&
Definition: CompactNFA.h:241
void addInputSymbols(ext::set< SymbolType > symbols)
Definition: CompactNFA.h:310
friend ext::ostream & operator<<(ext::ostream &out, const CompactNFA &instance)
Definition: CompactNFA.h:424
Deterministic finite automaton. Accepts regular languages.
Definition: DFA.h:71
Epsilon nondeterministic finite automaton. Accepts regular languages.
Definition: EpsilonNFA.h:74
Epsilon nondeterministic finite automaton. Accepts regular languages.
Definition: MultiInitialStateEpsilonNFA.h:75
Nondeterministic finite automaton with multiple initial states. Accepts regular languages.
Definition: MultiInitialStateNFA.h:69
Nondeterministic finite automaton. Accepts regular languages.
Definition: NFA.h:66
Definition: CompactNFA.h:441
Definition: components.hpp:181
static void valid(const automaton::CompactNFA< SymbolType, StateType > &, const StateType &)
Definition: CompactNFA.h:768
static bool available(const automaton::CompactNFA< SymbolType, StateType > &automaton, const StateType &state)
Definition: CompactNFA.h:758
Definition: components.hpp:25
static void valid(const automaton::CompactNFA< SymbolType, StateType > &, const StateType &)
Definition: CompactNFA.h:737
static bool available(const automaton::CompactNFA< SymbolType, StateType > &automaton, const StateType &state)
Definition: CompactNFA.h:727
static bool used(const automaton::CompactNFA< SymbolType, StateType > &, const StateType &)
Definition: CompactNFA.h:715
static void valid(const automaton::CompactNFA< SymbolType, StateType > &, const StateType &)
Definition: CompactNFA.h:694
static bool used(const automaton::CompactNFA< SymbolType, StateType > &automaton, const StateType &state)
Definition: CompactNFA.h:662
static bool available(const automaton::CompactNFA< SymbolType, StateType > &, const StateType &)
Definition: CompactNFA.h:684
static void valid(const automaton::CompactNFA< SymbolType, StateType > &, const SymbolType &)
Definition: CompactNFA.h:641
static bool available(const automaton::CompactNFA< SymbolType, StateType > &, const SymbolType &)
Definition: CompactNFA.h:631
static bool used(const automaton::CompactNFA< SymbolType, StateType > &automaton, const SymbolType &symbol)
Definition: CompactNFA.h:613
Definition: setComponents.hpp:26
Class extending the multimap class from the standard library. Original reason is to allow printing of...
Definition: multimap.hpp:48
iterator insert(const T &key, const R &value)
Insert variant with explicit key and value parameters.
Definition: multimap.hpp:118
Definition: ostream.h:14
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
Definition: set.hpp:44
auto begin() &
Inherited behavior of begin for non-const instance.
Definition: set.hpp:99
auto end() &
Inherited behavior of end for non-const instance.
Definition: set.hpp:129
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
Definition: BarSymbol.cpp:12
typename T::StateType StateType
Definition: ToGrammarLeftRG.h:64
typename T::SymbolType SymbolType
Definition: ReachableStates.h:176
return res
Definition: MinimizeByPartitioning.h:145
Definition: ToGrammar.h:31
constexpr bool isCompactNFA
Definition: CompactNFA.h:460
T createUnique(T object, const Alphabets &... alphabets)
Definition: createUnique.hpp:46
Definition: normalize.hpp:10
Definition: sigHandler.cpp:20
constexpr tuple< Elements &... > tie(Elements &... args) noexcept
Helper of extended tuple of references construction. The tuple is constructed to reffer to values in ...
Definition: tuple.hpp:218
reference_mover< T > make_mover(T &param)
Move adaptor construction function specialized to lvalue reference parameter.
Definition: iterator.hpp:468
bool contains(InputIt first, InputIt last, const Element &elem)
Linear version of search in a range of values.
Definition: algorithm.hpp:170
std::string to_string(const T &value)
To string method designated for objects that can be casted to string.
Definition: string.hpp:131
constexpr auto make_pair(T1 &&x, T2 &&y)
Definition: pair.hpp:79
auto begin(Container &&cont) -> decltype(std::forward(cont).begin())
Definition: iterator.hpp:900
void end()
Definition: measurements.cpp:19
auto & get(ext::ptr_array< Type, N > &tpl)
Specialisation of get function for pointer arrays.
Definition: ptr_array.hpp:693
static automaton::CompactNFA< > eval(automaton::CompactNFA< SymbolType, StateType > &&value)
Definition: CompactNFA.h:779
Definition: normalize.hpp:13