Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
LG.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
27#include <ext/algorithm>
28
29#include <alib/map>
30#include <alib/set>
31#include <alib/tuple>
32#include <alib/vector>
33#include <alib/variant>
34
35#include <core/components.hpp>
36
38
40
41#include <core/normalize.hpp>
44
45namespace grammar {
46
47class TerminalAlphabet;
48class NonterminalAlphabet;
49class InitialSymbol;
50
66template < class TerminalSymbolType = DefaultSymbolType, class NonterminalSymbolType = DefaultSymbolType >
67class LG final : public core::Components < LG < TerminalSymbolType, NonterminalSymbolType >, ext::set < TerminalSymbolType >, component::Set, TerminalAlphabet, ext::set < NonterminalSymbolType >, component::Set, NonterminalAlphabet, NonterminalSymbolType, component::Value, InitialSymbol > {
72
73public:
79 explicit LG ( NonterminalSymbolType initialSymbol );
80
88 explicit LG ( ext::set < NonterminalSymbolType > nonterminalAlphabet, ext::set < TerminalSymbolType > terminalAlphabet, NonterminalSymbolType initialSymbol );
89
100 bool addRule ( NonterminalSymbolType leftHandSide, ext::variant < ext::vector < TerminalSymbolType >, ext::tuple < ext::vector < TerminalSymbolType >, NonterminalSymbolType, ext::vector < TerminalSymbolType > > > rightHandSide );
101
110 void addRules ( NonterminalSymbolType leftHandSide, ext::set < ext::variant < ext::vector < TerminalSymbolType >, ext::tuple < ext::vector < TerminalSymbolType >, NonterminalSymbolType, ext::vector < TerminalSymbolType > > > > rightHandSide );
111
118
125
134 bool removeRule ( const NonterminalSymbolType & leftHandSide, const ext::variant < ext::vector < TerminalSymbolType >, ext::tuple < ext::vector < TerminalSymbolType >, NonterminalSymbolType, ext::vector < TerminalSymbolType > > > & rightHandSide );
135
144 bool removeRule ( const NonterminalSymbolType & leftHandSide, const ext::vector < TerminalSymbolType > & rightHandSide );
145
154 bool removeRule ( const NonterminalSymbolType & leftHandSide, const ext::tuple < ext::vector < TerminalSymbolType >, NonterminalSymbolType, ext::vector < TerminalSymbolType > > & rightHandSide );
155
161 const NonterminalSymbolType & getInitialSymbol ( ) const & {
162 return this->template accessComponent < InitialSymbol > ( ).get ( );
163 }
164
170 NonterminalSymbolType && getInitialSymbol ( ) && {
171 return std::move ( this->template accessComponent < InitialSymbol > ( ).get ( ) );
172 }
173
181 bool setInitialSymbol ( NonterminalSymbolType symbol ) {
182 return this->template accessComponent < InitialSymbol > ( ).set ( std::move ( symbol ) );
183 }
184
191 return this->template accessComponent < NonterminalAlphabet > ( ).get ( );
192 }
193
200 return std::move ( this->template accessComponent < NonterminalAlphabet > ( ).get ( ) );
201 }
202
210 bool addNonterminalSymbol ( NonterminalSymbolType symbol ) {
211 return this->template accessComponent < NonterminalAlphabet > ( ).add ( std::move ( symbol ) );
212 }
213
220 this->template accessComponent < NonterminalAlphabet > ( ).set ( std::move ( symbols ) );
221 }
222
229 return this->template accessComponent < TerminalAlphabet > ( ).get ( );
230 }
231
238 return std::move ( this->template accessComponent < TerminalAlphabet > ( ).get ( ) );
239 }
240
248 bool addTerminalSymbol ( TerminalSymbolType symbol ) {
249 return this->template accessComponent < TerminalAlphabet > ( ).add ( std::move ( symbol ) );
250 }
251
258 this->template accessComponent < TerminalAlphabet > ( ).set ( std::move ( symbols ) );
259 }
260
268 auto operator <=> ( const LG & other ) const {
269 return std::tie ( getTerminalAlphabet ( ), getNonterminalAlphabet ( ), getInitialSymbol ( ), rules ) <=> std::tie ( other.getTerminalAlphabet ( ), other.getNonterminalAlphabet ( ), other.getInitialSymbol ( ), other.rules );
270 }
271
279 bool operator == ( const LG & other ) const {
280 return std::tie ( getTerminalAlphabet ( ), getNonterminalAlphabet ( ), getInitialSymbol ( ), rules ) == std::tie ( other.getTerminalAlphabet ( ), other.getNonterminalAlphabet ( ), other.getInitialSymbol ( ), other.rules );
281 }
282
291 friend ext::ostream & operator << ( ext::ostream & out, const LG & instance ) {
292 return out << "(LG"
293 << " nonterminalAlphabet = " << instance.getNonterminalAlphabet ( )
294 << " terminalAlphabet = " << instance.getTerminalAlphabet ( )
295 << " initialSymbol = " << instance.getInitialSymbol ( )
296 << " rules = " << instance.getRules ( )
297 << ")";
298 }
299};
300
301template < class TerminalSymbolType, class NonterminalSymbolType >
302LG < TerminalSymbolType, NonterminalSymbolType >::LG ( NonterminalSymbolType initialSymbol ) : LG ( ext::set < NonterminalSymbolType > { initialSymbol }, ext::set < TerminalSymbolType > ( ), initialSymbol ) {
303}
304
305template < class TerminalSymbolType, class NonterminalSymbolType >
306LG < TerminalSymbolType, NonterminalSymbolType >::LG ( ext::set < NonterminalSymbolType > nonterminalAlphabet, ext::set < TerminalSymbolType > terminalAlphabet, NonterminalSymbolType initialSymbol ) : core::Components < LG, ext::set < TerminalSymbolType >, component::Set, TerminalAlphabet, ext::set < NonterminalSymbolType >, component::Set, NonterminalAlphabet, NonterminalSymbolType, component::Value, InitialSymbol > ( std::move ( terminalAlphabet), std::move ( nonterminalAlphabet ), std::move ( initialSymbol ) ) {
307}
308
309template < class TerminalSymbolType, class NonterminalSymbolType >
311 if ( !getNonterminalAlphabet ( ).count ( leftHandSide ) )
312 throw GrammarException ( "Rule must rewrite nonterminal symbol" );
313
314 if ( rightHandSide.template is < ext::vector < TerminalSymbolType > > ( ) ) {
315 const ext::vector < TerminalSymbolType > & rhs = rightHandSide.template get < ext::vector < TerminalSymbolType > > ( );
316
317 for ( const TerminalSymbolType & symbol : rhs )
318 if ( !getTerminalAlphabet ( ).count ( symbol ) )
319 throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" );
320 } else {
321 const ext::tuple < ext::vector < TerminalSymbolType >, NonterminalSymbolType, ext::vector < TerminalSymbolType > > & rhs = rightHandSide.template get < ext::tuple < ext::vector < TerminalSymbolType >, NonterminalSymbolType, ext::vector < TerminalSymbolType > > > ( );
322
323 for ( const TerminalSymbolType & symbol : std::get < 0 > ( rhs ) )
324 if ( !getTerminalAlphabet ( ).count ( symbol ) )
325 throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" );
326
327 if ( !getNonterminalAlphabet ( ).count ( std::get < 1 > ( rhs ) ) )
328 throw GrammarException ( "Symbol " + ext::to_string ( std::get < 1 > ( rhs ) ) + " is not a nonterminal symbol" );
329
330 for ( const TerminalSymbolType & symbol : std::get < 2 > ( rhs ) )
331 if ( !getTerminalAlphabet ( ).count ( symbol ) )
332 throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" );
333 }
334
335 return rules[std::move ( leftHandSide )].insert ( std::move ( rightHandSide ) ).second;
336}
337
338template < class TerminalSymbolType, class NonterminalSymbolType >
340 if ( !getNonterminalAlphabet ( ).count ( leftHandSide ) )
341 throw GrammarException ( "Rule must rewrite nonterminal symbol" );
342
343 for ( const ext::variant < ext::vector < TerminalSymbolType >, ext::tuple < ext::vector < TerminalSymbolType >, NonterminalSymbolType, ext::vector < TerminalSymbolType > > > & element : rightHandSide ) {
344 if ( element.template is < ext::vector < TerminalSymbolType > > ( ) ) {
345 const ext::vector < TerminalSymbolType > & rhs = element.template get < ext::vector < TerminalSymbolType > > ( );
346
347 for ( const TerminalSymbolType & symbol : rhs )
348 if ( !getTerminalAlphabet ( ).count ( symbol ) )
349 throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" );
350 } else {
351 const ext::tuple < ext::vector < TerminalSymbolType >, NonterminalSymbolType, ext::vector < TerminalSymbolType > > & rhs = element.template get < ext::tuple < ext::vector < TerminalSymbolType >, NonterminalSymbolType, ext::vector < TerminalSymbolType > > > ( );
352
353 for ( const TerminalSymbolType & symbol : std::get < 0 > ( rhs ) )
354 if ( !getTerminalAlphabet ( ).count ( symbol ) )
355 throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" );
356
357 if ( !getNonterminalAlphabet ( ).count ( std::get < 1 > ( rhs ) ) )
358 throw GrammarException ( "Symbol " + ext::to_string ( std::get < 1 > ( rhs ) ) + " is not a nonterminal symbol" );
359
360 for ( const TerminalSymbolType & symbol : std::get < 2 > ( rhs ) )
361 if ( !getTerminalAlphabet ( ).count ( symbol ) )
362 throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" );
363 }
364 }
365
366 rules [ std::move ( leftHandSide ) ].insert ( ext::make_mover ( rightHandSide ).begin ( ), ext::make_mover ( rightHandSide ).end ( ) );
367}
368
369template < class TerminalSymbolType, class NonterminalSymbolType >
371 return rules;
372}
373
374template < class TerminalSymbolType, class NonterminalSymbolType >
376 return std::move ( rules );
377}
378
379template < class TerminalSymbolType, class NonterminalSymbolType >
381 return rules[leftHandSide].erase ( rightHandSide );
382}
383
384template < class TerminalSymbolType, class NonterminalSymbolType >
385bool LG < TerminalSymbolType, NonterminalSymbolType >::removeRule ( const NonterminalSymbolType & leftHandSide, const ext::vector < TerminalSymbolType > & rightHandSide ) {
387
388 return removeRule ( leftHandSide, rhs );
389}
390
391template < class TerminalSymbolType, class NonterminalSymbolType >
392bool LG < TerminalSymbolType, NonterminalSymbolType >::removeRule ( const NonterminalSymbolType & leftHandSide, const ext::tuple < ext::vector < TerminalSymbolType >, NonterminalSymbolType, ext::vector < TerminalSymbolType > > & rightHandSide ) {
394
395 return removeRule ( leftHandSide, rhs );
396}
397
398} /* namespace grammar */
399
400namespace core {
401
408template < class TerminalSymbolType, class NonterminalSymbolType >
409class SetConstraint< grammar::LG < TerminalSymbolType, NonterminalSymbolType >, TerminalSymbolType, grammar::TerminalAlphabet > {
410public:
419 static bool used ( const grammar::LG < TerminalSymbolType, NonterminalSymbolType > & grammar, const TerminalSymbolType & symbol ) {
420 for ( const std::pair < const NonterminalSymbolType, ext::set < ext::variant < ext::vector < TerminalSymbolType >, ext::tuple < ext::vector < TerminalSymbolType >, NonterminalSymbolType, ext::vector < TerminalSymbolType > > > > > & rule : grammar.getRules ( ) ) {
422 if ( rhsTmp.template is < ext::vector < TerminalSymbolType > > ( ) ) {
423 const ext::vector < TerminalSymbolType > & rhs = rhsTmp.template get < ext::vector < TerminalSymbolType > > ( );
424
425 if ( std::find ( rhs.begin ( ), rhs.end ( ), symbol ) != rhs.end ( ) )
426 return true;
427 } else {
428 const ext::tuple < ext::vector < TerminalSymbolType >, NonterminalSymbolType, ext::vector < TerminalSymbolType > > & rhs = rhsTmp.template get < ext::tuple < ext::vector < TerminalSymbolType >, NonterminalSymbolType, ext::vector < TerminalSymbolType > > > ( );
429
430 const ext::vector < TerminalSymbolType > & lPart = std::get < 0 > ( rhs );
431
432 if ( std::find ( lPart.begin ( ), lPart.end ( ), symbol ) != lPart.end ( ) )
433 return true;
434
435 const ext::vector < TerminalSymbolType > & rPart = std::get < 2 > ( rhs );
436
437 if ( std::find ( rPart.begin ( ), rPart.end ( ), symbol ) != rPart.end ( ) )
438 return true;
439 }
440
441 }
442
443 return false;
444 }
445
454 static bool available ( const grammar::LG < TerminalSymbolType, NonterminalSymbolType > &, const TerminalSymbolType & ) {
455 return true;
456 }
457
466 static void valid ( const grammar::LG < TerminalSymbolType, NonterminalSymbolType > & grammar, const TerminalSymbolType & symbol ) {
467 if ( grammar.template accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( ext::poly_comp ( symbol ) ) )
468 throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + " cannot be in the terminal alphabet since it is already in the nonterminal alphabet." );
469 }
470};
471
478template < class TerminalSymbolType, class NonterminalSymbolType >
479class SetConstraint< grammar::LG < TerminalSymbolType, NonterminalSymbolType >, NonterminalSymbolType, grammar::NonterminalAlphabet > {
480public:
489 static bool used ( const grammar::LG < TerminalSymbolType, NonterminalSymbolType > & grammar, const NonterminalSymbolType & symbol ) {
490 for ( const std::pair < const NonterminalSymbolType, ext::set < ext::variant < ext::vector < TerminalSymbolType >, ext::tuple < ext::vector < TerminalSymbolType >, NonterminalSymbolType, ext::vector < TerminalSymbolType > > > > > & rule : grammar.getRules ( ) ) {
491 if ( rule.first == symbol )
492 return true;
493
495 if ( rhsTmp.template is < ext::tuple < ext::vector < TerminalSymbolType >, NonterminalSymbolType, ext::vector < TerminalSymbolType > > > ( ) ) {
496 const ext::tuple < ext::vector < TerminalSymbolType >, NonterminalSymbolType, ext::vector < TerminalSymbolType > > & rhs = rhsTmp.template get < ext::tuple < ext::vector < TerminalSymbolType >, NonterminalSymbolType, ext::vector < TerminalSymbolType > > > ( );
497
498 if ( std::get < 1 > ( rhs ) == symbol )
499 return true;
500 }
501
502 }
503
504 return grammar.template accessComponent < grammar::InitialSymbol > ( ).get ( ) == symbol;
505 }
506
515 static bool available ( const grammar::LG < TerminalSymbolType, NonterminalSymbolType > &, const NonterminalSymbolType & ) {
516 return true;
517 }
518
527 static void valid ( const grammar::LG < TerminalSymbolType, NonterminalSymbolType > & grammar, const NonterminalSymbolType & symbol ) {
528 if ( grammar.template accessComponent < grammar::TerminalAlphabet > ( ).get ( ).count ( ext::poly_comp ( symbol ) ) )
529 throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + " cannot be in the nonterminal alphabet since it is already in the terminal alphabet." );
530 }
531};
532
539template < class TerminalSymbolType, class NonterminalSymbolType >
540class ElementConstraint< grammar::LG < TerminalSymbolType, NonterminalSymbolType >, NonterminalSymbolType, grammar::InitialSymbol > {
541public:
550 static bool available ( const grammar::LG < TerminalSymbolType, NonterminalSymbolType > & grammar, const NonterminalSymbolType & symbol ) {
551 return grammar.template accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol );
552 }
553
560 static void valid ( const grammar::LG < TerminalSymbolType, NonterminalSymbolType > &, const NonterminalSymbolType & ) {
561 }
562};
563
569template < class TerminalSymbolType, class NonterminalSymbolType >
570struct normalize < grammar::LG < TerminalSymbolType, NonterminalSymbolType > > {
572 ext::set < DefaultSymbolType > nonterminals = alphabet::SymbolNormalize::normalizeAlphabet ( std::move ( value ).getNonterminalAlphabet ( ) );
573 ext::set < DefaultSymbolType > terminals = alphabet::SymbolNormalize::normalizeAlphabet ( std::move ( value ).getTerminalAlphabet ( ) );
574 DefaultSymbolType initialSymbol = alphabet::SymbolNormalize::normalizeSymbol ( std::move ( value ).getInitialSymbol ( ) );
575
576 grammar::LG < > res ( std::move ( nonterminals ), std::move ( terminals ), std::move ( initialSymbol ) );
577
578 for ( std::pair < NonterminalSymbolType, ext::set < ext::variant < ext::vector < TerminalSymbolType >, ext::tuple < ext::vector < TerminalSymbolType >, NonterminalSymbolType, ext::vector < TerminalSymbolType > > > > > && rule : ext::make_mover ( std::move ( value ).getRules ( ) ) ) {
579
582 rhs.insert ( grammar::GrammarNormalize::normalizeRHS ( std::move ( target ) ) );
583
584 DefaultSymbolType lhs = alphabet::SymbolNormalize::normalizeSymbol ( std::move ( rule.first ) );
585
586 res.addRules ( std::move ( lhs ), std::move ( rhs ) );
587 }
588
589 return res;
590 }
591};
592
593} /* namespace core */
594
595extern template class grammar::LG < >;
596
static ext::set< DefaultSymbolType > normalizeAlphabet(ext::set< SymbolType > &&symbols)
Definition: SymbolNormalize.h:50
static DefaultSymbolType normalizeSymbol(SymbolType &&symbol)
Definition: SymbolNormalize.h:68
Definition: components.hpp:181
static bool available(const grammar::LG< TerminalSymbolType, NonterminalSymbolType > &grammar, const NonterminalSymbolType &symbol)
Definition: LG.h:550
static void valid(const grammar::LG< TerminalSymbolType, NonterminalSymbolType > &, const NonterminalSymbolType &)
Definition: LG.h:560
Definition: components.hpp:25
static void valid(const grammar::LG< TerminalSymbolType, NonterminalSymbolType > &grammar, const TerminalSymbolType &symbol)
Definition: LG.h:466
static bool available(const grammar::LG< TerminalSymbolType, NonterminalSymbolType > &, const TerminalSymbolType &)
Definition: LG.h:454
static bool used(const grammar::LG< TerminalSymbolType, NonterminalSymbolType > &grammar, const TerminalSymbolType &symbol)
Definition: LG.h:419
static bool available(const grammar::LG< TerminalSymbolType, NonterminalSymbolType > &, const NonterminalSymbolType &)
Definition: LG.h:515
static void valid(const grammar::LG< TerminalSymbolType, NonterminalSymbolType > &grammar, const NonterminalSymbolType &symbol)
Definition: LG.h:527
static bool used(const grammar::LG< TerminalSymbolType, NonterminalSymbolType > &grammar, const NonterminalSymbolType &symbol)
Definition: LG.h:489
Definition: setComponents.hpp:26
Class extending the map class from the standard library. Original reason is to allow printing of the ...
Definition: map.hpp:48
Definition: ostream.h:14
Definition: set.hpp:44
Class extending the tuple class from the standard library. Original reason is to allow printing of th...
Definition: tuple.hpp:42
Implementation of the variant class allowing to store any type of those listed in the template parame...
Definition: variant.hpp:98
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
auto begin() &
Inherited behavior of begin for non-const instance.
Definition: vector.hpp:125
auto end() &
Inherited behavior of end for non-const instance.
Definition: vector.hpp:155
Definition: GrammarException.h:15
static ext::pair< DefaultSymbolType, ext::vector< DefaultSymbolType > > normalizeRHS(ext::pair< FirstSymbolType, ext::vector< SecondSymbolType > > &&symbol)
Definition: GrammarNormalize.h:40
Context free grammar in Chomsky hierarchy or type 2 in Chomsky hierarchy. Generates context free lang...
Definition: LG.h:67
const NonterminalSymbolType & getInitialSymbol() const &
Definition: LG.h:161
void addRules(NonterminalSymbolType leftHandSide, ext::set< ext::variant< ext::vector< TerminalSymbolType >, ext::tuple< ext::vector< TerminalSymbolType >, NonterminalSymbolType, ext::vector< TerminalSymbolType > > > > rightHandSide)
Add new rules of a grammar.
Definition: LG.h:339
bool addRule(NonterminalSymbolType leftHandSide, ext::variant< ext::vector< TerminalSymbolType >, ext::tuple< ext::vector< TerminalSymbolType >, NonterminalSymbolType, ext::vector< TerminalSymbolType > > > rightHandSide)
Add a new rule of a grammar.
Definition: LG.h:310
bool addNonterminalSymbol(NonterminalSymbolType symbol)
Definition: LG.h:210
auto operator<=>(const LG &other) const
Definition: LG.h:268
const ext::set< NonterminalSymbolType > & getNonterminalAlphabet() const &
Definition: LG.h:190
bool setInitialSymbol(NonterminalSymbolType symbol)
Definition: LG.h:181
bool addTerminalSymbol(TerminalSymbolType symbol)
Definition: LG.h:248
bool operator==(const LG &other) const
Definition: LG.h:279
ext::set< TerminalSymbolType > && getTerminalAlphabet() &&
Definition: LG.h:237
const ext::map< NonterminalSymbolType, ext::set< ext::variant< ext::vector< TerminalSymbolType >, ext::tuple< ext::vector< TerminalSymbolType >, NonterminalSymbolType, ext::vector< TerminalSymbolType > > > > > & getRules() const &
Definition: LG.h:370
ext::set< NonterminalSymbolType > && getNonterminalAlphabet() &&
Definition: LG.h:199
NonterminalSymbolType && getInitialSymbol() &&
Definition: LG.h:170
LG(NonterminalSymbolType initialSymbol)
Creates a new instance of the grammar with a concrete initial symbol.
Definition: LG.h:302
const ext::set< TerminalSymbolType > & getTerminalAlphabet() const &
Definition: LG.h:228
bool removeRule(const NonterminalSymbolType &leftHandSide, const ext::variant< ext::vector< TerminalSymbolType >, ext::tuple< ext::vector< TerminalSymbolType >, NonterminalSymbolType, ext::vector< TerminalSymbolType > > > &rightHandSide)
Definition: LG.h:380
friend ext::ostream & operator<<(ext::ostream &out, const LG &instance)
Definition: LG.h:291
void setTerminalAlphabet(ext::set< TerminalSymbolType > symbols)
Definition: LG.h:257
void setNonterminalAlphabet(ext::set< NonterminalSymbolType > symbols)
Definition: LG.h:219
Definition: Object.h:16
object::Object DefaultSymbolType
Definition: DefaultSymbolType.h:10
return res
Definition: MinimizeByPartitioning.h:145
Definition: normalize.hpp:10
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
std::string to_string(const T &value)
To string method designated for objects that can be casted to string.
Definition: string.hpp:131
PolyComp< T > poly_comp(const T &inst)
Definition: functional.hpp:60
auto begin(Container &&cont) -> decltype(std::forward(cont).begin())
Definition: iterator.hpp:900
Definition: ToAutomaton.h:24
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 grammar::LG< > eval(grammar::LG< TerminalSymbolType, NonterminalSymbolType > &&value)
Definition: LG.h:571
Definition: normalize.hpp:13