From 88247925aaec2fa6d94ac67b47d5f168312b9bad Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Tue, 2 Aug 2016 16:07:43 +0200 Subject: [PATCH] rename components2 to components --- alib2common/src/core/components.hpp | 216 ++++----- alib2common/src/core/components2.hpp | 432 ------------------ alib2common/test-src/core/ComponentsTest.cpp | 18 +- alib2data/src/automaton/FSM/CompactNFA.cpp | 2 +- alib2data/src/automaton/FSM/CompactNFA.h | 12 +- alib2data/src/automaton/FSM/DFA.cpp | 2 +- alib2data/src/automaton/FSM/DFA.h | 12 +- alib2data/src/automaton/FSM/EpsilonNFA.cpp | 2 +- alib2data/src/automaton/FSM/EpsilonNFA.h | 12 +- alib2data/src/automaton/FSM/ExtendedNFA.cpp | 2 +- alib2data/src/automaton/FSM/ExtendedNFA.h | 12 +- .../automaton/FSM/MultiInitialStateNFA.cpp | 2 +- .../src/automaton/FSM/MultiInitialStateNFA.h | 12 +- alib2data/src/automaton/FSM/NFA.cpp | 2 +- alib2data/src/automaton/FSM/NFA.h | 12 +- alib2data/src/automaton/PDA/DPDA.cpp | 2 +- alib2data/src/automaton/PDA/DPDA.h | 16 +- .../src/automaton/PDA/InputDrivenDPDA.cpp | 2 +- alib2data/src/automaton/PDA/InputDrivenDPDA.h | 16 +- .../src/automaton/PDA/InputDrivenNPDA.cpp | 2 +- alib2data/src/automaton/PDA/InputDrivenNPDA.h | 16 +- alib2data/src/automaton/PDA/NPDA.cpp | 2 +- alib2data/src/automaton/PDA/NPDA.h | 16 +- alib2data/src/automaton/PDA/NPDTA.cpp | 2 +- alib2data/src/automaton/PDA/NPDTA.h | 18 +- .../PDA/RealTimeHeightDeterministicDPDA.cpp | 2 +- .../PDA/RealTimeHeightDeterministicDPDA.h | 16 +- .../PDA/RealTimeHeightDeterministicNPDA.cpp | 2 +- .../PDA/RealTimeHeightDeterministicNPDA.h | 16 +- alib2data/src/automaton/PDA/SinglePopDPDA.cpp | 2 +- alib2data/src/automaton/PDA/SinglePopDPDA.h | 16 +- alib2data/src/automaton/PDA/SinglePopNPDA.cpp | 2 +- alib2data/src/automaton/PDA/SinglePopNPDA.h | 16 +- .../src/automaton/PDA/VisiblyPushdownDPDA.cpp | 2 +- .../src/automaton/PDA/VisiblyPushdownDPDA.h | 20 +- .../src/automaton/PDA/VisiblyPushdownNPDA.cpp | 2 +- .../src/automaton/PDA/VisiblyPushdownNPDA.h | 20 +- alib2data/src/automaton/TA/DFTA.cpp | 2 +- alib2data/src/automaton/TA/DFTA.h | 10 +- alib2data/src/automaton/TA/NFTA.cpp | 2 +- alib2data/src/automaton/TA/NFTA.h | 10 +- alib2data/src/automaton/TM/OneTapeDTM.cpp | 2 +- alib2data/src/automaton/TM/OneTapeDTM.h | 16 +- alib2data/src/grammar/ContextFree/CFG.cpp | 2 +- alib2data/src/grammar/ContextFree/CFG.h | 10 +- alib2data/src/grammar/ContextFree/CNF.cpp | 2 +- alib2data/src/grammar/ContextFree/CNF.h | 10 +- .../grammar/ContextFree/EpsilonFreeCFG.cpp | 2 +- .../src/grammar/ContextFree/EpsilonFreeCFG.h | 10 +- alib2data/src/grammar/ContextFree/GNF.cpp | 2 +- alib2data/src/grammar/ContextFree/GNF.h | 10 +- alib2data/src/grammar/ContextFree/LG.cpp | 2 +- alib2data/src/grammar/ContextFree/LG.h | 10 +- .../src/grammar/ContextSensitive/CSG.cpp | 2 +- alib2data/src/grammar/ContextSensitive/CSG.h | 10 +- .../NonContractingGrammar.cpp | 2 +- .../ContextSensitive/NonContractingGrammar.h | 10 +- alib2data/src/grammar/Regular/LeftLG.cpp | 2 +- alib2data/src/grammar/Regular/LeftLG.h | 10 +- alib2data/src/grammar/Regular/LeftRG.cpp | 2 +- alib2data/src/grammar/Regular/LeftRG.h | 10 +- alib2data/src/grammar/Regular/RightLG.cpp | 2 +- alib2data/src/grammar/Regular/RightLG.h | 10 +- alib2data/src/grammar/Regular/RightRG.cpp | 2 +- alib2data/src/grammar/Regular/RightRG.h | 10 +- .../ContextPreservingUnrestrictedGrammar.cpp | 2 +- .../ContextPreservingUnrestrictedGrammar.h | 10 +- .../Unrestricted/UnrestrictedGrammar.cpp | 2 +- .../Unrestricted/UnrestrictedGrammar.h | 10 +- .../suffixTrie/SuffixTrieFinalMark.cpp | 8 +- .../indexes/suffixTrie/SuffixTrieFinalMark.h | 6 +- .../SuffixTrieTerminatingSymbol.cpp | 6 +- .../suffixTrie/SuffixTrieTerminatingSymbol.h | 8 +- alib2data/src/regexp/formal/FormalRegExp.cpp | 2 +- alib2data/src/regexp/formal/FormalRegExp.h | 6 +- .../src/regexp/unbounded/UnboundedRegExp.cpp | 2 +- .../src/regexp/unbounded/UnboundedRegExp.h | 6 +- alib2data/src/rte/formal/FormalRTE.cpp | 6 +- alib2data/src/rte/formal/FormalRTE.h | 8 +- alib2data/src/string/CyclicString.cpp | 2 +- alib2data/src/string/CyclicString.h | 6 +- alib2data/src/string/Epsilon.cpp | 2 +- alib2data/src/string/Epsilon.h | 6 +- alib2data/src/string/LinearString.cpp | 2 +- alib2data/src/string/LinearString.h | 6 +- .../string/LinearStringTerminatingSymbol.cpp | 2 +- .../string/LinearStringTerminatingSymbol.h | 8 +- .../PrefixRankedBarNonlinearPattern.cpp | 2 +- .../ranked/PrefixRankedBarNonlinearPattern.h | 14 +- .../tree/ranked/PrefixRankedBarPattern.cpp | 2 +- .../src/tree/ranked/PrefixRankedBarPattern.h | 12 +- .../src/tree/ranked/PrefixRankedBarTree.cpp | 2 +- .../src/tree/ranked/PrefixRankedBarTree.h | 8 +- .../ranked/PrefixRankedNonlinearPattern.cpp | 2 +- .../ranked/PrefixRankedNonlinearPattern.h | 10 +- .../src/tree/ranked/PrefixRankedPattern.cpp | 2 +- .../src/tree/ranked/PrefixRankedPattern.h | 8 +- .../src/tree/ranked/PrefixRankedTree.cpp | 2 +- alib2data/src/tree/ranked/PrefixRankedTree.h | 6 +- .../tree/ranked/RankedNonlinearPattern.cpp | 6 +- .../src/tree/ranked/RankedNonlinearPattern.h | 10 +- alib2data/src/tree/ranked/RankedPattern.cpp | 6 +- alib2data/src/tree/ranked/RankedPattern.h | 8 +- alib2data/src/tree/ranked/RankedTree.cpp | 6 +- alib2data/src/tree/ranked/RankedTree.h | 6 +- alib2data/src/tree/unranked/PrefixBarTree.cpp | 2 +- alib2data/src/tree/unranked/PrefixBarTree.h | 8 +- .../unranked/UnrankedNonlinearPattern.cpp | 6 +- .../tree/unranked/UnrankedNonlinearPattern.h | 10 +- .../src/tree/unranked/UnrankedPattern.cpp | 6 +- alib2data/src/tree/unranked/UnrankedPattern.h | 8 +- alib2data/src/tree/unranked/UnrankedTree.cpp | 6 +- alib2data/src/tree/unranked/UnrankedTree.h | 6 +- 113 files changed, 492 insertions(+), 920 deletions(-) delete mode 100644 alib2common/src/core/components2.hpp diff --git a/alib2common/src/core/components.hpp b/alib2common/src/core/components.hpp index 89c49c6e09..27376408dc 100644 --- a/alib2common/src/core/components.hpp +++ b/alib2common/src/core/components.hpp @@ -1,12 +1,12 @@ /* - * Component.hpp + * Components.hpp * * Created on: Mar 16, 2016 * Author: Jan Travnicek */ -#ifndef COMPONENT_HPP_ -#define COMPONENT_HPP_ +#ifndef COMPONENTS2_HPP_ +#define COMPONENTS2_HPP_ #include <set> #include <algorithm> @@ -16,27 +16,63 @@ namespace std { +template < class Derived, class DataType, class SetType > +class ComponentConstraint { +public: + /** + * Checks whether a concrete element is used in context of the datatype where the set is used + * + * To be implemented by all template instantiations explicitly + * + * @param element to check + * @return true if element is used + * false if element is not used + */ + static bool used ( const Derived & object, const DataType & symbol ); + + /** + * Checks whether a concrete element is available in context of the datatype where the set is used + * + * To be implemented by all template instantiations explicitly + * + * @param element to check + * @return true if element is available + * false if element is not available + */ + static bool available ( const Derived & object, const DataType & symbol ); + + /** + * Checks whether a concrete element is valid in context of the datatype where the set is used + * + * To be implemented by all template instantiations explicitly + * + * @param element to check + * @throw CommonException if the element in any way invalid + */ + static void valid ( const Derived & object, const DataType & symbol ); +}; + /** * Represents a set of elements. * @param Derived class representing datatype using this set. - * @param SymbolType underlying type of symbols in the set. + * @param DataType underlying type of symbols in the set. * @param SetType arbitrary type used to distinguish different sets. */ -template < class Derived, class SymbolType, class SetType > +template < class Derived, class DataType, class SetType > class Component { /** * The set. */ - std::set < SymbolType > data; + std::set < DataType > data; /** * Checks whether symbol can be added to the set. Calls valid and available functions. * @throws CommonException if symbol cannot be added. */ - void checkAdd ( const SymbolType & symbol ) { - valid ( symbol ); + void checkAdd ( const DataType & symbol ) { + ComponentConstraint < Derived, DataType, SetType >::valid ( static_cast < const Derived & > ( * this ), symbol ); - if ( !available ( symbol ) ) + if ( !ComponentConstraint < Derived, DataType, SetType >::available ( static_cast < const Derived & > ( * this ), symbol ) ) throw::exception::CommonException ( "Symbol " + ( std::string ) symbol + " is not available." ); } @@ -44,8 +80,8 @@ class Component { * Checks whether symbol can be removed from the set. Calls used function. * @throws CommonException if symbol cannot be removed. */ - void checkRemove ( const SymbolType & symbol ) { - if ( used ( symbol ) ) + void checkRemove ( const DataType & symbol ) { + if ( ComponentConstraint < Derived, DataType, SetType >::used ( static_cast < const Derived & > ( * this ), symbol ) ) throw::exception::CommonException ( "Symbol " + ( std::string ) symbol + " is used." ); } @@ -53,22 +89,16 @@ protected: /** Checks the state of the set. */ void checkState ( ) { - for ( const SymbolType & symbol : data ) + for ( const DataType & symbol : data ) checkAdd ( symbol ); } public: - /* - * Constructs an empty set. - */ - Component ( ) { - } - /** * Constructs a set containing given elements. * @throw CommonException if elements are not available in context of datatype where the set is used */ - Component ( std::set < SymbolType > symbols ) : data ( std::move ( symbols ) ) { + Component ( std::set < DataType > symbols ) : data ( std::move ( symbols ) ) { } /** @@ -78,7 +108,7 @@ public: * @return true if element was indeed added * false if element was present in the set */ - bool add ( SymbolType symbol ) { + bool add ( DataType symbol ) { checkAdd ( symbol ); return data.insert ( std::move ( symbol ) ).second; } @@ -88,8 +118,8 @@ public: * @param elements to add to the set * @throw CommonException if one of the elements is not available in context of datatype where the set is used */ - void add ( std::set < SymbolType > symbols ) { - for ( SymbolType symbol : std::make_moveable_set ( symbols ) ) + void add ( std::set < DataType > symbols ) { + for ( DataType symbol : std::make_moveable_set ( symbols ) ) add ( std::move ( symbol ) ); } @@ -99,14 +129,14 @@ public: * @throw CommonException if one of the removed elements is used in context of datatype where the set is used * CommonException if one of the added elements is not available in context of datatype where the set is used */ - void set ( std::set < SymbolType > symbols ) { - std::set < SymbolType > removed; + void set ( std::set < DataType > symbols ) { + std::set < DataType > removed; std::set_difference ( data.begin ( ), data.end ( ), symbols.begin ( ), symbols.end ( ), std::inserter ( removed, removed.end ( ) ) ); - for ( const SymbolType & symbol : removed ) + for ( const DataType & symbol : removed ) checkRemove ( symbol ); - for ( const SymbolType & symbol : symbols ) + for ( const DataType & symbol : symbols ) checkAdd ( symbol ); data = std::move ( symbols ); @@ -115,14 +145,14 @@ public: /** * @return the set. */ - std::set < SymbolType > & get ( ) { + std::set < DataType > & get ( ) { return data; } /** * @return the set. */ - const std::set < SymbolType > & get ( ) const { + const std::set < DataType > & get ( ) const { return data; } @@ -132,7 +162,7 @@ public: * @return true if element was indeed removed * false if element was not present in the set */ - bool remove ( const SymbolType & symbol ) { + bool remove ( const DataType & symbol ) { checkRemove ( symbol ); return data.erase ( symbol ); } @@ -141,8 +171,8 @@ public: * Removes a set of elements from alphabet if not used. * @throw CommonException if element is used in context of datatype where the set is used */ - void remove ( const std::set < SymbolType > & symbols ) { - for ( const SymbolType & symbol : symbols ) + void remove ( const std::set < DataType > & symbols ) { + for ( const DataType & symbol : symbols ) remove ( symbol ); } @@ -154,19 +184,13 @@ public: return data.empty ( ); } - /** - * Checks whether a concrete element is used in context of the datatype where the set is used - * - * To be implemented by all template instantiations explicitly - * - * @param element to check - * @return true if element is used - * false if element is not used - */ - bool used ( const SymbolType & symbol ) const; +}; +template < class Derived, class DataType, class SetType > +class ElementConstraint { +public: /** - * Checks whether a concrete element is available in context of the datatype where the set is used + * Checks whether a concrete symbol is available in context of the datatype instance using this class * * To be implemented by all template instantiations explicitly * @@ -174,40 +198,40 @@ public: * @return true if element is available * false if element is not available */ - bool available ( const SymbolType & symbol ) const; + static bool available ( const Derived & object, const DataType & symbol ); /** - * Checks whether a concrete element is valid in context of the datatype where the set is used + * Checks whether a concrete symbol is valid in context of the datatype instance using this class * * To be implemented by all template instantiations explicitly * * @param element to check * @throw CommonException if the element in any way invalid */ - void valid ( const SymbolType & symbol ) const; + static void valid ( const Derived & object, const DataType & symbol ); }; /** * Represents an notable element. * @param Derived class representing datatype using this notable element. - * @param SymbolType underlying type of element. + * @param DataType underlying type of element. * @param ElementType arbitrary type used to distinguish different notable elements. */ -template < class Derived, class SymbolType, class ElementType > +template < class Derived, class DataType, class ElementType > class Element { /** * The element. */ - SymbolType data; + DataType data; /** * Checks whether element can be set. Calls valid and available functions. * @throws CommonException if element cannot be added. */ - void checkSet ( const SymbolType & symbol ) { - valid ( symbol ); + void checkSet ( const DataType & symbol ) { + ElementConstraint < Derived, DataType, ElementType >::valid ( static_cast < const Derived & > ( * this ), symbol ); - if ( !available ( symbol ) ) + if ( !ElementConstraint < Derived, DataType, ElementType >::available ( static_cast < const Derived & > ( * this ), symbol ) ) throw::exception::CommonException ( "Symbol " + ( std::string ) symbol + " is not available." ); } @@ -223,7 +247,7 @@ public: * Constructs a notable element. * @throw CommonException if element is not available in context of datatype where the class is used */ - Element ( SymbolType symbol ) : data ( std::move ( symbol ) ) { + Element ( DataType symbol ) : data ( std::move ( symbol ) ) { } /** @@ -233,7 +257,7 @@ public: * false if the element was the same as already present * @throw CommonException if the new element is not available in context of datatype where the class is used */ - bool set ( SymbolType symbol ) { + bool set ( DataType symbol ) { checkSet ( symbol ); if ( data == symbol ) return false; @@ -246,7 +270,7 @@ public: * Returns the current notable element of ElementType. * @return the notable element */ - SymbolType & get ( ) { + DataType & get ( ) { return data; } @@ -254,49 +278,29 @@ public: * Returns the current notable element of ElementType. * @return the notable element */ - const SymbolType & get ( ) const { + const DataType & get ( ) const { return data; } - /** - * Checks whether a concrete symbol is available in context of the datatype instance using this class - * - * To be implemented by all template instantiations explicitly - * - * @param element to check - * @return true if element is available - * false if element is not available - */ - bool available ( const SymbolType & symbol ) const; - - /** - * Checks whether a concrete symbol is valid in context of the datatype instance using this class - * - * To be implemented by all template instantiations explicitly - * - * @param element to check - * @throw CommonException if the element in any way invalid - */ - void valid ( const SymbolType & symbol ) const; }; /** * Auxiliary base handling all sets of elements from components */ -template < class Derived, class SymbolType, class ... SetTypes > +template < class Derived, class DataType, class ... SetTypes > struct ComponentAux; /** * Specialisation for tuple. */ -template < class Derived, class SymbolType, class ... SetTypes > -struct ComponentAux < Derived, SymbolType, tuple < SetTypes ... > > : public Component < Derived, SymbolType, SetTypes > ... { +template < class Derived, class DataType, class ... SetTypes > +struct ComponentAux < Derived, DataType, tuple < SetTypes ... > > : public Component < Derived, DataType, SetTypes > ... { /** * Constructor */ template < class ... RealSetTypes, size_t ... Indexes > - ComponentAux ( tuple < RealSetTypes ... > params, std::index_sequence < Indexes ... > ) : Component < Derived, SymbolType, SetTypes > ( std::move ( get < Indexes > ( params ) ) ) ... { + ComponentAux ( tuple < RealSetTypes ... > params, std::index_sequence < Indexes ... > ) : Component < Derived, DataType, SetTypes > ( std::move ( get < Indexes > ( params ) ) ) ... { ( void ) params; // No-op } @@ -306,8 +310,8 @@ struct ComponentAux < Derived, SymbolType, tuple < SetTypes ... > > : public Com * @return sub-component */ template < class SetType, typename std::enable_if < std::is_in < SetType, SetTypes ... >::value >::type * = nullptr > - const Component < Derived, SymbolType, SetType > & accessComponent ( ) const { - return static_cast < const Component < Derived, SymbolType, SetType > & > ( * this ); + const Component < Derived, DataType, SetType > & accessComponent ( ) const { + return static_cast < const Component < Derived, DataType, SetType > & > ( * this ); } /** @@ -316,8 +320,8 @@ struct ComponentAux < Derived, SymbolType, tuple < SetTypes ... > > : public Com * @return sub-component */ template < class SetType, typename std::enable_if < std::is_in < SetType, SetTypes ... >::value >::type * = nullptr > - Component < Derived, SymbolType, SetType > & accessComponent ( ) { - return static_cast < Component < Derived, SymbolType, SetType > & > ( * this ); + Component < Derived, DataType, SetType > & accessComponent ( ) { + return static_cast < Component < Derived, DataType, SetType > & > ( * this ); } protected: @@ -325,7 +329,7 @@ protected: * postponed checker function */ void checkState ( ) { - ( void ) std::initializer_list < int > { ( Component < Derived, SymbolType, SetTypes >::checkState ( ), 0 ) ... }; + ( void ) std::initializer_list < int > { ( Component < Derived, DataType, SetTypes >::checkState ( ), 0 ) ... }; } }; @@ -333,20 +337,20 @@ protected: /** * Auxiliary base handling all notable elements from components */ -template < class Derived, class SymbolType, class ... ElementTypes > +template < class Derived, class DataType, class ... ElementTypes > struct ElementAux; /** * Specialisation for tuple. */ -template < class Derived, class SymbolType, class ... ElementTypes > -struct ElementAux < Derived, SymbolType, tuple < ElementTypes ... > > : public Element < Derived, SymbolType, ElementTypes > ... { +template < class Derived, class DataType, class ... ElementTypes > +struct ElementAux < Derived, DataType, tuple < ElementTypes ... > > : public Element < Derived, DataType, ElementTypes > ... { /** * Constructor */ template < class ... RealElementTypes, size_t ... Indexes > - ElementAux ( tuple < RealElementTypes ... > params, std::index_sequence < Indexes ... > ) : Element < Derived, SymbolType, ElementTypes > ( std::move ( get < Indexes > ( params ) ) ) ... { + ElementAux ( tuple < RealElementTypes ... > params, std::index_sequence < Indexes ... > ) : Element < Derived, DataType, ElementTypes > ( std::move ( get < Indexes > ( params ) ) ) ... { ( void ) params; // No-op } @@ -356,8 +360,8 @@ struct ElementAux < Derived, SymbolType, tuple < ElementTypes ... > > : public E * @return sub-component */ template < class ElementType, typename std::enable_if < std::is_in < ElementType, ElementTypes ... >::value >::type * = nullptr > - const Element < Derived, SymbolType, ElementType > & accessElement ( ) const { - return static_cast < const Element < Derived, SymbolType, ElementType > & > ( * this ); + const Element < Derived, DataType, ElementType > & accessElement ( ) const { + return static_cast < const Element < Derived, DataType, ElementType > & > ( * this ); } /** @@ -366,8 +370,8 @@ struct ElementAux < Derived, SymbolType, tuple < ElementTypes ... > > : public E * @return sub-component */ template < class ElementType, typename std::enable_if < std::is_in < ElementType, ElementTypes ... >::value >::type * = nullptr > - Element < Derived, SymbolType, ElementType > & accessElement ( ) { - return static_cast < Element < Derived, SymbolType, ElementType > & > ( * this ); + Element < Derived, DataType, ElementType > & accessElement ( ) { + return static_cast < Element < Derived, DataType, ElementType > & > ( * this ); } protected: @@ -375,7 +379,7 @@ protected: * postponed checker function */ void checkState ( ) { - ( void ) std::initializer_list < int > { ( Element < Derived, SymbolType, ElementTypes >::checkState ( ), 0 ) ... }; + ( void ) std::initializer_list < int > { ( Element < Derived, DataType, ElementTypes >::checkState ( ), 0 ) ... }; } }; @@ -386,38 +390,38 @@ class Components; /** * Auxiliary class allowing simple access to the alphabets. */ -template < class Derived, class SymbolType, class SetTypesPack, class ElementTypesPack > -class Components < Derived, SymbolType, SetTypesPack, ElementTypesPack > : public ComponentAux < Derived, SymbolType, SetTypesPack >, public ElementAux < Derived, SymbolType, ElementTypesPack > { +template < class Derived, class DataType, class SetTypesPack, class ElementTypesPack > +class Components < Derived, DataType, SetTypesPack, ElementTypesPack > : public ComponentAux < Derived, DataType, SetTypesPack >, public ElementAux < Derived, DataType, ElementTypesPack > { public: /** * Construct an alphabet pack from two alphabets. */ template < class RealSetTypes, class RealElementTypes > - Components ( RealSetTypes params1, RealElementTypes params2 ) : ComponentAux < Derived, SymbolType, SetTypesPack > ( std::move ( params1 ), std::make_index_sequence < std::tuple_size < SetTypesPack >::value > { } ), ElementAux < Derived, SymbolType, ElementTypesPack > ( std::move ( params2 ), std::make_index_sequence < std::tuple_size < ElementTypesPack >::value > { } ) { - ComponentAux < Derived, SymbolType, SetTypesPack >::checkState ( ); + Components ( RealSetTypes params1, RealElementTypes params2 ) : ComponentAux < Derived, DataType, SetTypesPack > ( std::move ( params1 ), std::make_index_sequence < std::tuple_size < SetTypesPack >::value > { } ), ElementAux < Derived, DataType, ElementTypesPack > ( std::move ( params2 ), std::make_index_sequence < std::tuple_size < ElementTypesPack >::value > { } ) { + ComponentAux < Derived, DataType, SetTypesPack >::checkState ( ); - ElementAux < Derived, SymbolType, ElementTypesPack >::checkState ( ); + ElementAux < Derived, DataType, ElementTypesPack >::checkState ( ); } }; /** * Auxiliary class allowing simple access to the alphabets. */ -template < class Derived, class SymbolType, class SetTypesPack, class ElementTypesPack, class ... NextGroup > -class Components < Derived, SymbolType, SetTypesPack, ElementTypesPack, NextGroup ... > : public ComponentAux < Derived, SymbolType, SetTypesPack >, public ElementAux < Derived, SymbolType, ElementTypesPack >, public Components < Derived, NextGroup ... > { +template < class Derived, class DataType, class SetTypesPack, class ElementTypesPack, class ... NextGroup > +class Components < Derived, DataType, SetTypesPack, ElementTypesPack, NextGroup ... > : public ComponentAux < Derived, DataType, SetTypesPack >, public ElementAux < Derived, DataType, ElementTypesPack >, public Components < Derived, NextGroup ... > { public: /** * Construct an alphabet pack from two alphabets. */ template < class RealSetTypes, class RealElementTypes, class ... NextRealTypes > - Components ( RealSetTypes params1, RealElementTypes params2, NextRealTypes ... nextParams ) : ComponentAux < Derived, SymbolType, SetTypesPack > ( std::move ( params1 ), std::make_index_sequence < std::tuple_size < SetTypesPack >::value > { } ), ElementAux < Derived, SymbolType, ElementTypesPack > ( std::move ( params2 ), std::make_index_sequence < std::tuple_size < ElementTypesPack >::value > { } ), Components < Derived, NextGroup ... > ( std::move ( nextParams ) ... ) { - ComponentAux < Derived, SymbolType, SetTypesPack >::checkState ( ); + Components ( RealSetTypes params1, RealElementTypes params2, NextRealTypes ... nextParams ) : ComponentAux < Derived, DataType, SetTypesPack > ( std::move ( params1 ), std::make_index_sequence < std::tuple_size < SetTypesPack >::value > { } ), ElementAux < Derived, DataType, ElementTypesPack > ( std::move ( params2 ), std::make_index_sequence < std::tuple_size < ElementTypesPack >::value > { } ), Components < Derived, NextGroup ... > ( std::move ( nextParams ) ... ) { + ComponentAux < Derived, DataType, SetTypesPack >::checkState ( ); - ElementAux < Derived, SymbolType, ElementTypesPack >::checkState ( ); + ElementAux < Derived, DataType, ElementTypesPack >::checkState ( ); } - using ComponentAux < Derived, SymbolType, SetTypesPack >::accessComponent; - using ElementAux < Derived, SymbolType, ElementTypesPack >::accessElement; + using ComponentAux < Derived, DataType, SetTypesPack >::accessComponent; + using ElementAux < Derived, DataType, ElementTypesPack >::accessElement; using Components < Derived, NextGroup ... >::accessComponent; using Components < Derived, NextGroup ... >::accessElement; @@ -425,4 +429,4 @@ public: } /* namespace std */ -#endif /* COMPONENT_HPP_ */ +#endif /* COMPONENTS2_HPP_ */ diff --git a/alib2common/src/core/components2.hpp b/alib2common/src/core/components2.hpp deleted file mode 100644 index d26c561870..0000000000 --- a/alib2common/src/core/components2.hpp +++ /dev/null @@ -1,432 +0,0 @@ -/* - * Components2.hpp - * - * Created on: Mar 16, 2016 - * Author: Jan Travnicek - */ - -#ifndef COMPONENTS2_HPP_ -#define COMPONENTS2_HPP_ - -#include <set> -#include <algorithm> -#include <utility> -#include <tuple> -#include "../exception/CommonException.h" - -namespace std { - -template < class Derived, class DataType, class SetType > -class ComponentConstraint2 { -public: - /** - * Checks whether a concrete element is used in context of the datatype where the set is used - * - * To be implemented by all template instantiations explicitly - * - * @param element to check - * @return true if element is used - * false if element is not used - */ - static bool used ( const Derived & object, const DataType & symbol ); - - /** - * Checks whether a concrete element is available in context of the datatype where the set is used - * - * To be implemented by all template instantiations explicitly - * - * @param element to check - * @return true if element is available - * false if element is not available - */ - static bool available ( const Derived & object, const DataType & symbol ); - - /** - * Checks whether a concrete element is valid in context of the datatype where the set is used - * - * To be implemented by all template instantiations explicitly - * - * @param element to check - * @throw CommonException if the element in any way invalid - */ - static void valid ( const Derived & object, const DataType & symbol ); -}; - -/** - * Represents a set of elements. - * @param Derived class representing datatype using this set. - * @param DataType underlying type of symbols in the set. - * @param SetType arbitrary type used to distinguish different sets. - */ -template < class Derived, class DataType, class SetType > -class Component2 { - /** - * The set. - */ - std::set < DataType > data; - - /** - * Checks whether symbol can be added to the set. Calls valid and available functions. - * @throws CommonException if symbol cannot be added. - */ - void checkAdd ( const DataType & symbol ) { - ComponentConstraint2 < Derived, DataType, SetType >::valid ( static_cast < const Derived & > ( * this ), symbol ); - - if ( !ComponentConstraint2 < Derived, DataType, SetType >::available ( static_cast < const Derived & > ( * this ), symbol ) ) - throw::exception::CommonException ( "Symbol " + ( std::string ) symbol + " is not available." ); - } - - /** - * Checks whether symbol can be removed from the set. Calls used function. - * @throws CommonException if symbol cannot be removed. - */ - void checkRemove ( const DataType & symbol ) { - if ( ComponentConstraint2 < Derived, DataType, SetType >::used ( static_cast < const Derived & > ( * this ), symbol ) ) - throw::exception::CommonException ( "Symbol " + ( std::string ) symbol + " is used." ); - } - -protected: - /** Checks the state of the set. - */ - void checkState ( ) { - for ( const DataType & symbol : data ) - checkAdd ( symbol ); - } - -public: - /** - * Constructs a set containing given elements. - * @throw CommonException if elements are not available in context of datatype where the set is used - */ - Component2 ( std::set < DataType > symbols ) : data ( std::move ( symbols ) ) { - } - - /** - * Adds an elements to the set. - * @param element to add to the set - * @throw CommonException if element is not available in context of datatype where the set is used - * @return true if element was indeed added - * false if element was present in the set - */ - bool add ( DataType symbol ) { - checkAdd ( symbol ); - return data.insert ( std::move ( symbol ) ).second; - } - - /** - * Adds a set of elements to the set. - * @param elements to add to the set - * @throw CommonException if one of the elements is not available in context of datatype where the set is used - */ - void add ( std::set < DataType > symbols ) { - for ( DataType symbol : std::make_moveable_set ( symbols ) ) - add ( std::move ( symbol ) ); - } - - /** - * Changes the set. - * @param elements by which to replace those currently in the set - * @throw CommonException if one of the removed elements is used in context of datatype where the set is used - * CommonException if one of the added elements is not available in context of datatype where the set is used - */ - void set ( std::set < DataType > symbols ) { - std::set < DataType > removed; - std::set_difference ( data.begin ( ), data.end ( ), symbols.begin ( ), symbols.end ( ), std::inserter ( removed, removed.end ( ) ) ); - - for ( const DataType & symbol : removed ) - checkRemove ( symbol ); - - for ( const DataType & symbol : symbols ) - checkAdd ( symbol ); - - data = std::move ( symbols ); - } - - /** - * @return the set. - */ - std::set < DataType > & get ( ) { - return data; - } - - /** - * @return the set. - */ - const std::set < DataType > & get ( ) const { - return data; - } - - /** - * Removes an element from the set if not used. - * @throw CommonException if element is used in context of datatype where the set is used - * @return true if element was indeed removed - * false if element was not present in the set - */ - bool remove ( const DataType & symbol ) { - checkRemove ( symbol ); - return data.erase ( symbol ); - } - - /** - * Removes a set of elements from alphabet if not used. - * @throw CommonException if element is used in context of datatype where the set is used - */ - void remove ( const std::set < DataType > & symbols ) { - for ( const DataType & symbol : symbols ) - remove ( symbol ); - } - - /** - * Component2 emptiness checker. - * @return true if set is an empty - */ - bool empty ( ) const { - return data.empty ( ); - } - -}; - -template < class Derived, class DataType, class SetType > -class ElementConstraint2 { -public: - /** - * Checks whether a concrete symbol is available in context of the datatype instance using this class - * - * To be implemented by all template instantiations explicitly - * - * @param element to check - * @return true if element is available - * false if element is not available - */ - static bool available ( const Derived & object, const DataType & symbol ); - - /** - * Checks whether a concrete symbol is valid in context of the datatype instance using this class - * - * To be implemented by all template instantiations explicitly - * - * @param element to check - * @throw CommonException if the element in any way invalid - */ - static void valid ( const Derived & object, const DataType & symbol ); -}; - -/** - * Represents an notable element. - * @param Derived class representing datatype using this notable element. - * @param DataType underlying type of element. - * @param ElementType arbitrary type used to distinguish different notable elements. - */ -template < class Derived, class DataType, class ElementType > -class Element2 { - /** - * The element. - */ - DataType data; - - /** - * Checks whether element can be set. Calls valid and available functions. - * @throws CommonException if element cannot be added. - */ - void checkSet ( const DataType & symbol ) { - ElementConstraint2 < Derived, DataType, ElementType >::valid ( static_cast < const Derived & > ( * this ), symbol ); - - if ( !ElementConstraint2 < Derived, DataType, ElementType >::available ( static_cast < const Derived & > ( * this ), symbol ) ) - throw::exception::CommonException ( "Symbol " + ( std::string ) symbol + " is not available." ); - } - -protected: - /** Checks the state of the element. - */ - void checkState ( ) { - checkSet ( data ); - } - -public: - /** - * Constructs a notable element. - * @throw CommonException if element is not available in context of datatype where the class is used - */ - Element2 ( DataType symbol ) : data ( std::move ( symbol ) ) { - } - - /** - * Changes the notable element. - * @param new value of the element - * @return bool true if the element was set - * false if the element was the same as already present - * @throw CommonException if the new element is not available in context of datatype where the class is used - */ - bool set ( DataType symbol ) { - checkSet ( symbol ); - - if ( data == symbol ) return false; - - data = std::move ( symbol ); - return true; - } - - /** - * Returns the current notable element of ElementType. - * @return the notable element - */ - DataType & get ( ) { - return data; - } - - /** - * Returns the current notable element of ElementType. - * @return the notable element - */ - const DataType & get ( ) const { - return data; - } - -}; - -/** - * Auxiliary base handling all sets of elements from components - */ -template < class Derived, class DataType, class ... SetTypes > -struct ComponentAux2; - -/** - * Specialisation for tuple. - */ -template < class Derived, class DataType, class ... SetTypes > -struct ComponentAux2 < Derived, DataType, tuple < SetTypes ... > > : public Component2 < Derived, DataType, SetTypes > ... { - - /** - * Constructor - */ - template < class ... RealSetTypes, size_t ... Indexes > - ComponentAux2 ( tuple < RealSetTypes ... > params, std::index_sequence < Indexes ... > ) : Component2 < Derived, DataType, SetTypes > ( std::move ( get < Indexes > ( params ) ) ) ... { - ( void ) params; // No-op - } - - /** - * Allows access to sub-component using its type. - * @param SetType alphabet type used to distinguish different sub alphabets - * @return sub-component - */ - template < class SetType, typename std::enable_if < std::is_in < SetType, SetTypes ... >::value >::type * = nullptr > - const Component2 < Derived, DataType, SetType > & accessComponent ( ) const { - return static_cast < const Component2 < Derived, DataType, SetType > & > ( * this ); - } - - /** - * Allows access to sub-component using its type. - * @param SetType alphabet type used to distinguish different sub alphabets - * @return sub-component - */ - template < class SetType, typename std::enable_if < std::is_in < SetType, SetTypes ... >::value >::type * = nullptr > - Component2 < Derived, DataType, SetType > & accessComponent ( ) { - return static_cast < Component2 < Derived, DataType, SetType > & > ( * this ); - } - -protected: - /** - * postponed checker function - */ - void checkState ( ) { - ( void ) std::initializer_list < int > { ( Component2 < Derived, DataType, SetTypes >::checkState ( ), 0 ) ... }; - } - -}; - -/** - * Auxiliary base handling all notable elements from components - */ -template < class Derived, class DataType, class ... ElementTypes > -struct ElementAux2; - -/** - * Specialisation for tuple. - */ -template < class Derived, class DataType, class ... ElementTypes > -struct ElementAux2 < Derived, DataType, tuple < ElementTypes ... > > : public Element2 < Derived, DataType, ElementTypes > ... { - - /** - * Constructor - */ - template < class ... RealElementTypes, size_t ... Indexes > - ElementAux2 ( tuple < RealElementTypes ... > params, std::index_sequence < Indexes ... > ) : Element2 < Derived, DataType, ElementTypes > ( std::move ( get < Indexes > ( params ) ) ) ... { - ( void ) params; // No-op - } - - /** - * Allows access to sub-component using its type. - * @param ElementType alphabet type used to distinguish different sub alphabets - * @return sub-component - */ - template < class ElementType, typename std::enable_if < std::is_in < ElementType, ElementTypes ... >::value >::type * = nullptr > - const Element2 < Derived, DataType, ElementType > & accessElement ( ) const { - return static_cast < const Element2 < Derived, DataType, ElementType > & > ( * this ); - } - - /** - * Allows access to sub-component using its type. - * @param ElementType alphabet type used to distinguish different sub alphabets - * @return sub-component - */ - template < class ElementType, typename std::enable_if < std::is_in < ElementType, ElementTypes ... >::value >::type * = nullptr > - Element2 < Derived, DataType, ElementType > & accessElement ( ) { - return static_cast < Element2 < Derived, DataType, ElementType > & > ( * this ); - } - -protected: - /** - * postponed checker function - */ - void checkState ( ) { - ( void ) std::initializer_list < int > { ( Element2 < Derived, DataType, ElementTypes >::checkState ( ), 0 ) ... }; - } - -}; - -template < class ... Types > -class Components2; - -/** - * Auxiliary class allowing simple access to the alphabets. - */ -template < class Derived, class DataType, class SetTypesPack, class ElementTypesPack > -class Components2 < Derived, DataType, SetTypesPack, ElementTypesPack > : public ComponentAux2 < Derived, DataType, SetTypesPack >, public ElementAux2 < Derived, DataType, ElementTypesPack > { -public: - /** - * Construct an alphabet pack from two alphabets. - */ - template < class RealSetTypes, class RealElementTypes > - Components2 ( RealSetTypes params1, RealElementTypes params2 ) : ComponentAux2 < Derived, DataType, SetTypesPack > ( std::move ( params1 ), std::make_index_sequence < std::tuple_size < SetTypesPack >::value > { } ), ElementAux2 < Derived, DataType, ElementTypesPack > ( std::move ( params2 ), std::make_index_sequence < std::tuple_size < ElementTypesPack >::value > { } ) { - ComponentAux2 < Derived, DataType, SetTypesPack >::checkState ( ); - - ElementAux2 < Derived, DataType, ElementTypesPack >::checkState ( ); - } -}; - -/** - * Auxiliary class allowing simple access to the alphabets. - */ -template < class Derived, class DataType, class SetTypesPack, class ElementTypesPack, class ... NextGroup > -class Components2 < Derived, DataType, SetTypesPack, ElementTypesPack, NextGroup ... > : public ComponentAux2 < Derived, DataType, SetTypesPack >, public ElementAux2 < Derived, DataType, ElementTypesPack >, public Components2 < Derived, NextGroup ... > { -public: - /** - * Construct an alphabet pack from two alphabets. - */ - template < class RealSetTypes, class RealElementTypes, class ... NextRealTypes > - Components2 ( RealSetTypes params1, RealElementTypes params2, NextRealTypes ... nextParams ) : ComponentAux2 < Derived, DataType, SetTypesPack > ( std::move ( params1 ), std::make_index_sequence < std::tuple_size < SetTypesPack >::value > { } ), ElementAux2 < Derived, DataType, ElementTypesPack > ( std::move ( params2 ), std::make_index_sequence < std::tuple_size < ElementTypesPack >::value > { } ), Components2 < Derived, NextGroup ... > ( std::move ( nextParams ) ... ) { - ComponentAux2 < Derived, DataType, SetTypesPack >::checkState ( ); - - ElementAux2 < Derived, DataType, ElementTypesPack >::checkState ( ); - } - - using ComponentAux2 < Derived, DataType, SetTypesPack >::accessComponent; - using ElementAux2 < Derived, DataType, ElementTypesPack >::accessElement; - - using Components2 < Derived, NextGroup ... >::accessComponent; - using Components2 < Derived, NextGroup ... >::accessElement; -}; - -} /* namespace std */ - -#endif /* COMPONENTS2_HPP_ */ diff --git a/alib2common/test-src/core/ComponentsTest.cpp b/alib2common/test-src/core/ComponentsTest.cpp index 2715cfc7e2..a3ee2b5816 100644 --- a/alib2common/test-src/core/ComponentsTest.cpp +++ b/alib2common/test-src/core/ComponentsTest.cpp @@ -1,5 +1,5 @@ #include "ComponentsTest.h" -#include <core/components2.hpp> +#include <core/components.hpp> CPPUNIT_TEST_SUITE_NAMED_REGISTRATION ( ComponentsTest, "alphabet" ); CPPUNIT_TEST_SUITE_REGISTRATION ( ComponentsTest ); @@ -13,16 +13,16 @@ struct NonlinearAlphabet { struct SubtreeWildcard { }; -class A : public std::Components2 < A, std::string, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > { +class A : public std::Components < A, std::string, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > { public: - A ( std::string string ) : std::Components2 < A, std::string, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::set < std::string > { string, "aaa" }, std::set < std::string > { "aaa" } ), std::make_tuple ( string ) ) { + A ( std::string string ) : std::Components < A, std::string, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::set < std::string > { string, "aaa" }, std::set < std::string > { "aaa" } ), std::make_tuple ( string ) ) { } }; namespace std { template < > -class ComponentConstraint2< A, std::string, GeneralAlphabet > { +class ComponentConstraint< A, std::string, GeneralAlphabet > { public: static bool used ( const A & a, const std::string & string ) { return a.accessComponent < NonlinearAlphabet > ( ).get ( ).count ( string ) || a.accessElement < SubtreeWildcard > ( ).get ( ) == string; @@ -37,7 +37,7 @@ public: }; template < > -class ComponentConstraint2< A, std::string, NonlinearAlphabet > { +class ComponentConstraint< A, std::string, NonlinearAlphabet > { public: static bool used ( const A &, const std::string & ) { return false; @@ -54,7 +54,7 @@ public: }; template < > -class ElementConstraint2< A, std::string, SubtreeWildcard > { +class ElementConstraint< A, std::string, SubtreeWildcard > { public: static bool available ( const A & a, const std::string & string ) { return a.accessComponent < GeneralAlphabet > ( ).get ( ).count ( string ); @@ -68,13 +68,13 @@ public: } /* namespace std */ -class B : public std::Components2 < B, std::string, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < > > { +class B : public std::Components < B, std::string, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < > > { }; namespace std { template < > -class ComponentConstraint2< B, std::string, GeneralAlphabet > { +class ComponentConstraint< B, std::string, GeneralAlphabet > { public: static bool used ( const B &, const std::string & ) { return false; @@ -89,7 +89,7 @@ public: }; template < > -class ComponentConstraint2< B, std::string, NonlinearAlphabet > { +class ComponentConstraint< B, std::string, NonlinearAlphabet > { public: static bool used ( const B &, const std::string & ) { return false; diff --git a/alib2data/src/automaton/FSM/CompactNFA.cpp b/alib2data/src/automaton/FSM/CompactNFA.cpp index c2eba0547d..0c041a9eaa 100644 --- a/alib2data/src/automaton/FSM/CompactNFA.cpp +++ b/alib2data/src/automaton/FSM/CompactNFA.cpp @@ -24,7 +24,7 @@ namespace automaton { -CompactNFA::CompactNFA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, State initialState, std::set < State > finalStates ) : std::Components2 < CompactNFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ) ), std::tuple < > ( ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { +CompactNFA::CompactNFA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, State initialState, std::set < State > finalStates ) : std::Components < CompactNFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ) ), std::tuple < > ( ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { } CompactNFA::CompactNFA ( State initialState ) : CompactNFA ( std::set < State > { initialState }, std::set < alphabet::Symbol > { }, initialState, std::set < State > { } ) { diff --git a/alib2data/src/automaton/FSM/CompactNFA.h b/alib2data/src/automaton/FSM/CompactNFA.h index 5452ee8403..25af1abaf6 100644 --- a/alib2data/src/automaton/FSM/CompactNFA.h +++ b/alib2data/src/automaton/FSM/CompactNFA.h @@ -10,7 +10,7 @@ #include "../AutomatonException.h" #include <map> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../common/State.h" #include "../../alphabet/Symbol.h" @@ -31,7 +31,7 @@ class States; class FinalStates; class InitialState; -class CompactNFA : public AutomatonBase, public std::Components2 < CompactNFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { +class CompactNFA : public AutomatonBase, public std::Components < CompactNFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: std::map < std::pair < State, string::LinearString >, std::set < State > > transitions; @@ -168,7 +168,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::CompactNFA, alphabet::Symbol, automaton::InputAlphabet > { +class ComponentConstraint< automaton::CompactNFA, alphabet::Symbol, automaton::InputAlphabet > { public: static bool used ( const automaton::CompactNFA & automaton, const alphabet::Symbol & symbol ) { for ( const std::pair < const std::pair < automaton::State, ::string::LinearString >, std::set < automaton::State > > & transition : automaton.getTransitions ( ) ) @@ -187,7 +187,7 @@ public: }; template < > -class ComponentConstraint2< automaton::CompactNFA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::CompactNFA, automaton::State, automaton::States > { public: static bool used ( const automaton::CompactNFA & automaton, const automaton::State & state ) { if ( automaton.getInitialState ( ) == state ) @@ -212,7 +212,7 @@ public: }; template < > -class ComponentConstraint2< automaton::CompactNFA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::CompactNFA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::CompactNFA &, const automaton::State & ) { return false; @@ -227,7 +227,7 @@ public: }; template < > -class ElementConstraint2< automaton::CompactNFA, automaton::State, automaton::InitialState > { +class ElementConstraint< automaton::CompactNFA, automaton::State, automaton::InitialState > { public: static bool available ( const automaton::CompactNFA & automaton, const automaton::State & state ) { return automaton.accessComponent < automaton::States > ( ).get ( ).count ( state ); diff --git a/alib2data/src/automaton/FSM/DFA.cpp b/alib2data/src/automaton/FSM/DFA.cpp index 676c9233e1..16438c6a91 100644 --- a/alib2data/src/automaton/FSM/DFA.cpp +++ b/alib2data/src/automaton/FSM/DFA.cpp @@ -18,7 +18,7 @@ namespace automaton { -DFA::DFA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, State initialState, std::set < State > finalStates ) : std::Components2 < DFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ) ), std::tuple < > ( ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { +DFA::DFA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, State initialState, std::set < State > finalStates ) : std::Components < DFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ) ), std::tuple < > ( ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { } DFA::DFA ( State initialState ) : DFA ( std::set < State > { initialState }, std::set < alphabet::Symbol > { }, initialState, std::set < State > { } ) { diff --git a/alib2data/src/automaton/FSM/DFA.h b/alib2data/src/automaton/FSM/DFA.h index 0660b4680f..fbee8070d0 100644 --- a/alib2data/src/automaton/FSM/DFA.h +++ b/alib2data/src/automaton/FSM/DFA.h @@ -10,7 +10,7 @@ #include "../AutomatonException.h" #include <map> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../common/State.h" #include "../../alphabet/Symbol.h" @@ -26,7 +26,7 @@ class States; class FinalStates; class InitialState; -class DFA : public AutomatonBase, public std::Components2 < DFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { +class DFA : public AutomatonBase, public std::Components < DFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: std::map < std::pair < State, alphabet::Symbol >, State > transitions; @@ -168,7 +168,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::DFA, alphabet::Symbol, automaton::InputAlphabet > { +class ComponentConstraint< automaton::DFA, alphabet::Symbol, automaton::InputAlphabet > { public: static bool used ( const automaton::DFA & automaton, const alphabet::Symbol & symbol ) { for ( const std::pair < const std::pair < automaton::State, alphabet::Symbol >, automaton::State > & transition : automaton.getTransitions ( ) ) @@ -187,7 +187,7 @@ public: }; template < > -class ComponentConstraint2< automaton::DFA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::DFA, automaton::State, automaton::States > { public: static bool used ( const automaton::DFA & automaton, const automaton::State & state ) { if ( automaton.getInitialState ( ) == state ) @@ -212,7 +212,7 @@ public: }; template < > -class ComponentConstraint2< automaton::DFA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::DFA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::DFA &, const automaton::State & ) { return false; @@ -227,7 +227,7 @@ public: }; template < > -class ElementConstraint2< automaton::DFA, automaton::State, automaton::InitialState > { +class ElementConstraint< automaton::DFA, automaton::State, automaton::InitialState > { public: static bool available ( const automaton::DFA & automaton, const automaton::State & state ) { return automaton.accessComponent < automaton::States > ( ).get ( ).count ( state ); diff --git a/alib2data/src/automaton/FSM/EpsilonNFA.cpp b/alib2data/src/automaton/FSM/EpsilonNFA.cpp index 99ee59dffe..a294db6d21 100644 --- a/alib2data/src/automaton/FSM/EpsilonNFA.cpp +++ b/alib2data/src/automaton/FSM/EpsilonNFA.cpp @@ -22,7 +22,7 @@ namespace automaton { -EpsilonNFA::EpsilonNFA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, State initialState, std::set < State > finalStates ) : std::Components2 < EpsilonNFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ) ), std::tuple < > ( ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { +EpsilonNFA::EpsilonNFA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, State initialState, std::set < State > finalStates ) : std::Components < EpsilonNFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ) ), std::tuple < > ( ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { } EpsilonNFA::EpsilonNFA ( State initialState ) : EpsilonNFA ( std::set < State > { initialState }, std::set < alphabet::Symbol > { }, initialState, std::set < State > { } ) { diff --git a/alib2data/src/automaton/FSM/EpsilonNFA.h b/alib2data/src/automaton/FSM/EpsilonNFA.h index 2c767668c0..8f6bb4e3e4 100644 --- a/alib2data/src/automaton/FSM/EpsilonNFA.h +++ b/alib2data/src/automaton/FSM/EpsilonNFA.h @@ -11,7 +11,7 @@ #include "../AutomatonException.h" #include <map> #include <variant> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../../alphabet/Symbol.h" #include "../../string/Epsilon.h" @@ -30,7 +30,7 @@ class States; class FinalStates; class InitialState; -class EpsilonNFA : public AutomatonBase, public std::Components2 < EpsilonNFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { +class EpsilonNFA : public AutomatonBase, public std::Components < EpsilonNFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: std::map < std::pair < State, std::variant < string::Epsilon, alphabet::Symbol > >, std::set < State > > transitions; @@ -244,7 +244,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::EpsilonNFA, alphabet::Symbol, automaton::InputAlphabet > { +class ComponentConstraint< automaton::EpsilonNFA, alphabet::Symbol, automaton::InputAlphabet > { public: static bool used ( const automaton::EpsilonNFA & automaton, const alphabet::Symbol & symbol ) { for ( const std::pair < const std::pair < automaton::State, std::variant < ::string::Epsilon, alphabet::Symbol > >, std::set < automaton::State > > & transition : automaton.getTransitions ( ) ) @@ -263,7 +263,7 @@ public: }; template < > -class ComponentConstraint2< automaton::EpsilonNFA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::EpsilonNFA, automaton::State, automaton::States > { public: static bool used ( const automaton::EpsilonNFA & automaton, const automaton::State & state ) { if ( automaton.getInitialState ( ) == state ) @@ -288,7 +288,7 @@ public: }; template < > -class ComponentConstraint2< automaton::EpsilonNFA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::EpsilonNFA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::EpsilonNFA &, const automaton::State & ) { return false; @@ -303,7 +303,7 @@ public: }; template < > -class ElementConstraint2< automaton::EpsilonNFA, automaton::State, automaton::InitialState > { +class ElementConstraint< automaton::EpsilonNFA, automaton::State, automaton::InitialState > { public: static bool available ( const automaton::EpsilonNFA & automaton, const automaton::State & state ) { return automaton.accessComponent < automaton::States > ( ).get ( ).count ( state ); diff --git a/alib2data/src/automaton/FSM/ExtendedNFA.cpp b/alib2data/src/automaton/FSM/ExtendedNFA.cpp index 81ae24b425..eeb7ab28f5 100644 --- a/alib2data/src/automaton/FSM/ExtendedNFA.cpp +++ b/alib2data/src/automaton/FSM/ExtendedNFA.cpp @@ -26,7 +26,7 @@ namespace automaton { -ExtendedNFA::ExtendedNFA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, State initialState, std::set < State > finalStates ) : std::Components2 < ExtendedNFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ) ), std::tuple < > ( ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { +ExtendedNFA::ExtendedNFA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, State initialState, std::set < State > finalStates ) : std::Components < ExtendedNFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ) ), std::tuple < > ( ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { } ExtendedNFA::ExtendedNFA ( State initialState ) : ExtendedNFA ( std::set < State > { initialState }, std::set < alphabet::Symbol > { }, initialState, std::set < State > { } ) { diff --git a/alib2data/src/automaton/FSM/ExtendedNFA.h b/alib2data/src/automaton/FSM/ExtendedNFA.h index fbbe3fab97..e2480b77a7 100644 --- a/alib2data/src/automaton/FSM/ExtendedNFA.h +++ b/alib2data/src/automaton/FSM/ExtendedNFA.h @@ -10,7 +10,7 @@ #include "../AutomatonException.h" #include <map> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../common/State.h" #include "../../regexp/RegExp.h" @@ -31,7 +31,7 @@ class States; class FinalStates; class InitialState; -class ExtendedNFA : public AutomatonBase, public std::Components2 < ExtendedNFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { +class ExtendedNFA : public AutomatonBase, public std::Components < ExtendedNFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: std::map < std::pair < State, regexp::RegExp >, std::set < State > > transitions; @@ -169,7 +169,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::ExtendedNFA, alphabet::Symbol, automaton::InputAlphabet > { +class ComponentConstraint< automaton::ExtendedNFA, alphabet::Symbol, automaton::InputAlphabet > { public: static bool used ( const automaton::ExtendedNFA & automaton, const alphabet::Symbol & symbol ) { for ( const std::pair < const std::pair < automaton::State, regexp::RegExp >, std::set < automaton::State > > & transition : automaton.getTransitions ( ) ) @@ -188,7 +188,7 @@ public: }; template < > -class ComponentConstraint2< automaton::ExtendedNFA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::ExtendedNFA, automaton::State, automaton::States > { public: static bool used ( const automaton::ExtendedNFA & automaton, const automaton::State & state ) { if ( automaton.getInitialState ( ) == state ) @@ -213,7 +213,7 @@ public: }; template < > -class ComponentConstraint2< automaton::ExtendedNFA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::ExtendedNFA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::ExtendedNFA &, const automaton::State & ) { return false; @@ -228,7 +228,7 @@ public: }; template < > -class ElementConstraint2< automaton::ExtendedNFA, automaton::State, automaton::InitialState > { +class ElementConstraint< automaton::ExtendedNFA, automaton::State, automaton::InitialState > { public: static bool available ( const automaton::ExtendedNFA & automaton, const automaton::State & state ) { return automaton.accessComponent < automaton::States > ( ).get ( ).count ( state ); diff --git a/alib2data/src/automaton/FSM/MultiInitialStateNFA.cpp b/alib2data/src/automaton/FSM/MultiInitialStateNFA.cpp index 371bb6cddc..7874e4e8e0 100644 --- a/alib2data/src/automaton/FSM/MultiInitialStateNFA.cpp +++ b/alib2data/src/automaton/FSM/MultiInitialStateNFA.cpp @@ -21,7 +21,7 @@ namespace automaton { -MultiInitialStateNFA::MultiInitialStateNFA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < State > initialStates, std::set < State > finalStates ) : std::Components2 < MultiInitialStateNFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, InitialStates, FinalStates >, std::tuple < > > ( std::make_tuple ( std::move ( inputAlphabet ) ), std::tuple < > ( ), std::make_tuple ( std::move ( states ), std::move ( initialStates ), std::move ( finalStates ) ), std::tuple < > ( ) ) { +MultiInitialStateNFA::MultiInitialStateNFA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < State > initialStates, std::set < State > finalStates ) : std::Components < MultiInitialStateNFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, InitialStates, FinalStates >, std::tuple < > > ( std::make_tuple ( std::move ( inputAlphabet ) ), std::tuple < > ( ), std::make_tuple ( std::move ( states ), std::move ( initialStates ), std::move ( finalStates ) ), std::tuple < > ( ) ) { } MultiInitialStateNFA::MultiInitialStateNFA ( ) : MultiInitialStateNFA ( std::set < State > { }, std::set < alphabet::Symbol > { }, std::set < State > { }, std::set < State > { } ) { diff --git a/alib2data/src/automaton/FSM/MultiInitialStateNFA.h b/alib2data/src/automaton/FSM/MultiInitialStateNFA.h index 2cd5835b42..6525b93238 100644 --- a/alib2data/src/automaton/FSM/MultiInitialStateNFA.h +++ b/alib2data/src/automaton/FSM/MultiInitialStateNFA.h @@ -10,7 +10,7 @@ #include "../AutomatonException.h" #include <map> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../common/State.h" #include "../../alphabet/Symbol.h" @@ -28,7 +28,7 @@ class States; class FinalStates; class InitialStates; -class MultiInitialStateNFA : public AutomatonBase, public std::Components2 < MultiInitialStateNFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, InitialStates, FinalStates >, std::tuple < > > { +class MultiInitialStateNFA : public AutomatonBase, public std::Components < MultiInitialStateNFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, InitialStates, FinalStates >, std::tuple < > > { protected: std::map < std::pair < State, alphabet::Symbol >, std::set < State > > transitions; @@ -188,7 +188,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::MultiInitialStateNFA, alphabet::Symbol, automaton::InputAlphabet > { +class ComponentConstraint< automaton::MultiInitialStateNFA, alphabet::Symbol, automaton::InputAlphabet > { public: static bool used ( const automaton::MultiInitialStateNFA & automaton, const alphabet::Symbol & symbol ) { for ( const std::pair < const std::pair < automaton::State, alphabet::Symbol >, std::set < automaton::State > > & transition : automaton.getTransitions ( ) ) @@ -207,7 +207,7 @@ public: }; template < > -class ComponentConstraint2< automaton::MultiInitialStateNFA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::MultiInitialStateNFA, automaton::State, automaton::States > { public: static bool used ( const automaton::MultiInitialStateNFA & automaton, const automaton::State & state ) { if ( automaton.getInitialStates ( ).count ( state ) ) @@ -232,7 +232,7 @@ public: }; template < > -class ComponentConstraint2< automaton::MultiInitialStateNFA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::MultiInitialStateNFA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::MultiInitialStateNFA &, const automaton::State & ) { return false; @@ -247,7 +247,7 @@ public: }; template < > -class ComponentConstraint2< automaton::MultiInitialStateNFA, automaton::State, automaton::InitialStates > { +class ComponentConstraint< automaton::MultiInitialStateNFA, automaton::State, automaton::InitialStates > { public: static bool used ( const automaton::MultiInitialStateNFA &, const automaton::State & ) { return false; diff --git a/alib2data/src/automaton/FSM/NFA.cpp b/alib2data/src/automaton/FSM/NFA.cpp index 9c2e9f68e8..a79148e42a 100644 --- a/alib2data/src/automaton/FSM/NFA.cpp +++ b/alib2data/src/automaton/FSM/NFA.cpp @@ -19,7 +19,7 @@ namespace automaton { -NFA::NFA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, State initialState, std::set < State > finalStates ) : std::Components2 < NFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ) ), std::tuple < > ( ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { +NFA::NFA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, State initialState, std::set < State > finalStates ) : std::Components < NFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ) ), std::tuple < > ( ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { } NFA::NFA ( State initialState ) : NFA ( std::set < State > { initialState }, std::set < alphabet::Symbol > { }, initialState, std::set < State > { } ) { diff --git a/alib2data/src/automaton/FSM/NFA.h b/alib2data/src/automaton/FSM/NFA.h index e563d6222f..cbfb015638 100644 --- a/alib2data/src/automaton/FSM/NFA.h +++ b/alib2data/src/automaton/FSM/NFA.h @@ -10,7 +10,7 @@ #include "../AutomatonException.h" #include <map> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../common/State.h" #include "../../alphabet/Symbol.h" @@ -28,7 +28,7 @@ class States; class FinalStates; class InitialState; -class NFA : public AutomatonBase, public std::Components2 < NFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { +class NFA : public AutomatonBase, public std::Components < NFA, alphabet::Symbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: std::map < std::pair < State, alphabet::Symbol >, std::set < State > > transitions; @@ -182,7 +182,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::NFA, alphabet::Symbol, automaton::InputAlphabet > { +class ComponentConstraint< automaton::NFA, alphabet::Symbol, automaton::InputAlphabet > { public: static bool used ( const automaton::NFA & automaton, const alphabet::Symbol & symbol ) { for ( const std::pair < const std::pair < automaton::State, alphabet::Symbol >, std::set < automaton::State > > & transition : automaton.getTransitions ( ) ) @@ -201,7 +201,7 @@ public: }; template < > -class ComponentConstraint2< automaton::NFA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::NFA, automaton::State, automaton::States > { public: static bool used ( const automaton::NFA & automaton, const automaton::State & state ) { if ( automaton.getInitialState ( ) == state ) @@ -226,7 +226,7 @@ public: }; template < > -class ComponentConstraint2< automaton::NFA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::NFA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::NFA &, const automaton::State & ) { return false; @@ -241,7 +241,7 @@ public: }; template < > -class ElementConstraint2< automaton::NFA, automaton::State, automaton::InitialState > { +class ElementConstraint< automaton::NFA, automaton::State, automaton::InitialState > { public: static bool available ( const automaton::NFA & automaton, const automaton::State & state ) { return automaton.accessComponent < automaton::States > ( ).get ( ).count ( state ); diff --git a/alib2data/src/automaton/PDA/DPDA.cpp b/alib2data/src/automaton/PDA/DPDA.cpp index 23918f00b9..2f46a33ec2 100644 --- a/alib2data/src/automaton/PDA/DPDA.cpp +++ b/alib2data/src/automaton/PDA/DPDA.cpp @@ -19,7 +19,7 @@ namespace automaton { -DPDA::DPDA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, State initialState, alphabet::Symbol initialSymbol, std::set < State > finalStates ) : std::Components2 < DPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { +DPDA::DPDA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, State initialState, alphabet::Symbol initialSymbol, std::set < State > finalStates ) : std::Components < DPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { } DPDA::DPDA(State initialState, alphabet::Symbol initialPushdownSymbol) : DPDA ( std::set < State > { initialState }, std::set < alphabet::Symbol > { }, std::set < alphabet::Symbol > { initialPushdownSymbol }, initialState, initialPushdownSymbol, std::set < automaton::State > { }) { diff --git a/alib2data/src/automaton/PDA/DPDA.h b/alib2data/src/automaton/PDA/DPDA.h index 021bdb0b43..5bbb972e10 100644 --- a/alib2data/src/automaton/PDA/DPDA.h +++ b/alib2data/src/automaton/PDA/DPDA.h @@ -13,7 +13,7 @@ #include <map> #include <vector> #include <variant> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../common/State.h" #include "../../alphabet/Symbol.h" @@ -35,7 +35,7 @@ class InitialState; * if $\delta (q, a, \alpha) \neq \emptyset$, $\delta (q, a, \beta) \neq \emptyset$ and $\alpha \neq \beta$, then $\alpha$ is not suffix of $\beta$ and $\beta$ is not suffix of $\alpha$ (formally $\gamma \alpha \neq \beta and \alpha \neq \gamma \beta$). * if $\delta(q, a, \alpha) \neq \emptyset$, $\delta (q, \varepsilon, \beta) \neq \emptyset$, then $\alpha$ is not suffix of $\beta$ and $\beta$ is not suffix of $\alpha$ (fornally $\gamma \alpha \neq \beta and \alpha \neq \gamma \beta$). */ -class DPDA : public AutomatonBase, public std::Components2 < DPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { +class DPDA : public AutomatonBase, public std::Components < DPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: std::map < std::tuple < State, std::variant < string::Epsilon, alphabet::Symbol >, std::vector < alphabet::Symbol > >, std::pair < State, std::vector < alphabet::Symbol > > > transitions; @@ -203,7 +203,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::DPDA, alphabet::Symbol, automaton::InputAlphabet > { +class ComponentConstraint< automaton::DPDA, alphabet::Symbol, automaton::InputAlphabet > { public: static bool used ( const automaton::DPDA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::tuple<automaton::State, std::variant<::string::Epsilon, alphabet::Symbol>, std::vector<alphabet::Symbol> >, std::pair<automaton::State, std::vector<alphabet::Symbol> > >& transition : automaton.getTransitions()) @@ -222,7 +222,7 @@ public: }; template < > -class ComponentConstraint2< automaton::DPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { +class ComponentConstraint< automaton::DPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { public: static bool used ( const automaton::DPDA & automaton, const alphabet::Symbol & symbol ) { if(automaton.getInitialSymbol() == symbol) @@ -247,7 +247,7 @@ public: }; template < > -class ElementConstraint2< automaton::DPDA, alphabet::Symbol, automaton::InitialSymbol > { +class ElementConstraint< automaton::DPDA, alphabet::Symbol, automaton::InitialSymbol > { public: static bool available ( const automaton::DPDA & automaton, const alphabet::Symbol & symbol ) { return automaton.accessComponent < automaton::PushdownStoreAlphabet > ( ).get ( ).count ( symbol ); @@ -258,7 +258,7 @@ public: }; template < > -class ComponentConstraint2< automaton::DPDA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::DPDA, automaton::State, automaton::States > { public: static bool used ( const automaton::DPDA & automaton, const automaton::State & state ) { if ( automaton.getInitialState ( ) == state ) @@ -283,7 +283,7 @@ public: }; template < > -class ComponentConstraint2< automaton::DPDA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::DPDA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::DPDA &, const automaton::State & ) { return false; @@ -298,7 +298,7 @@ public: }; template < > -class ElementConstraint2< automaton::DPDA, automaton::State, automaton::InitialState > { +class ElementConstraint< automaton::DPDA, automaton::State, automaton::InitialState > { public: static bool available ( const automaton::DPDA & automaton, const automaton::State & state ) { return automaton.accessComponent < automaton::States > ( ).get ( ).count ( state ); diff --git a/alib2data/src/automaton/PDA/InputDrivenDPDA.cpp b/alib2data/src/automaton/PDA/InputDrivenDPDA.cpp index bed763e973..ab6ba18350 100644 --- a/alib2data/src/automaton/PDA/InputDrivenDPDA.cpp +++ b/alib2data/src/automaton/PDA/InputDrivenDPDA.cpp @@ -19,7 +19,7 @@ namespace automaton { -InputDrivenDPDA::InputDrivenDPDA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, State initialState, alphabet::Symbol initialSymbol, std::set < State > finalStates ) : std::Components2 < InputDrivenDPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { +InputDrivenDPDA::InputDrivenDPDA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, State initialState, alphabet::Symbol initialSymbol, std::set < State > finalStates ) : std::Components < InputDrivenDPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { } InputDrivenDPDA::InputDrivenDPDA(State initialState, alphabet::Symbol initialPushdownSymbol) : InputDrivenDPDA ( std::set < State > { initialState }, std::set < alphabet::Symbol > { }, std::set < alphabet::Symbol > { initialPushdownSymbol }, initialState, initialPushdownSymbol, std::set < automaton::State > { }) { diff --git a/alib2data/src/automaton/PDA/InputDrivenDPDA.h b/alib2data/src/automaton/PDA/InputDrivenDPDA.h index 2584a7c9ca..b6d25612e6 100644 --- a/alib2data/src/automaton/PDA/InputDrivenDPDA.h +++ b/alib2data/src/automaton/PDA/InputDrivenDPDA.h @@ -11,7 +11,7 @@ #include "../AutomatonException.h" #include <map> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../common/State.h" #include "../../alphabet/Symbol.h" @@ -29,7 +29,7 @@ class InitialState; * Represents Finite Automaton. * Can store nondeterministic finite automaton without epsilon transitions. */ -class InputDrivenDPDA : public AutomatonBase, public std::Components2 < InputDrivenDPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { +class InputDrivenDPDA : public AutomatonBase, public std::Components < InputDrivenDPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: std::map < std::pair < State, alphabet::Symbol >, State > transitions; std::map < alphabet::Symbol, std::pair < std::vector < alphabet::Symbol >, std::vector < alphabet::Symbol > > > inputSymbolToPushdownStoreOperation; @@ -205,7 +205,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::InputDrivenDPDA, alphabet::Symbol, automaton::InputAlphabet > { +class ComponentConstraint< automaton::InputDrivenDPDA, alphabet::Symbol, automaton::InputAlphabet > { public: static bool used ( const automaton::InputDrivenDPDA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::pair<automaton::State, alphabet::Symbol>, automaton::State>& transition : automaton.getTransitions()) @@ -224,7 +224,7 @@ public: }; template < > -class ComponentConstraint2< automaton::InputDrivenDPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { +class ComponentConstraint< automaton::InputDrivenDPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { public: static bool used ( const automaton::InputDrivenDPDA & automaton, const alphabet::Symbol & symbol ) { for (const auto& pushdownStoreOperation : automaton.getPushdownStoreOperations()) { @@ -249,7 +249,7 @@ public: }; template < > -class ElementConstraint2< automaton::InputDrivenDPDA, alphabet::Symbol, automaton::InitialSymbol > { +class ElementConstraint< automaton::InputDrivenDPDA, alphabet::Symbol, automaton::InitialSymbol > { public: static bool available ( const automaton::InputDrivenDPDA & automaton, const alphabet::Symbol & symbol ) { return automaton.accessComponent < automaton::PushdownStoreAlphabet > ( ).get ( ).count ( symbol ); @@ -260,7 +260,7 @@ public: }; template < > -class ComponentConstraint2< automaton::InputDrivenDPDA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::InputDrivenDPDA, automaton::State, automaton::States > { public: static bool used ( const automaton::InputDrivenDPDA & automaton, const automaton::State & state ) { if ( automaton.getInitialState ( ) == state ) @@ -285,7 +285,7 @@ public: }; template < > -class ComponentConstraint2< automaton::InputDrivenDPDA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::InputDrivenDPDA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::InputDrivenDPDA &, const automaton::State & ) { return false; @@ -300,7 +300,7 @@ public: }; template < > -class ElementConstraint2< automaton::InputDrivenDPDA, automaton::State, automaton::InitialState > { +class ElementConstraint< automaton::InputDrivenDPDA, automaton::State, automaton::InitialState > { public: static bool available ( const automaton::InputDrivenDPDA & automaton, const automaton::State & state ) { return automaton.accessComponent < automaton::States > ( ).get ( ).count ( state ); diff --git a/alib2data/src/automaton/PDA/InputDrivenNPDA.cpp b/alib2data/src/automaton/PDA/InputDrivenNPDA.cpp index abd4b6f1d0..539ce7a125 100644 --- a/alib2data/src/automaton/PDA/InputDrivenNPDA.cpp +++ b/alib2data/src/automaton/PDA/InputDrivenNPDA.cpp @@ -19,7 +19,7 @@ namespace automaton { -InputDrivenNPDA::InputDrivenNPDA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, State initialState, alphabet::Symbol initialSymbol, std::set < State > finalStates ) : std::Components2 < InputDrivenNPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { +InputDrivenNPDA::InputDrivenNPDA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, State initialState, alphabet::Symbol initialSymbol, std::set < State > finalStates ) : std::Components < InputDrivenNPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { } InputDrivenNPDA::InputDrivenNPDA(State initialState, alphabet::Symbol initialPushdownSymbol) : InputDrivenNPDA ( std::set < State > { initialState }, std::set < alphabet::Symbol > { }, std::set < alphabet::Symbol > { initialPushdownSymbol }, initialState, initialPushdownSymbol, std::set < automaton::State > { }) { diff --git a/alib2data/src/automaton/PDA/InputDrivenNPDA.h b/alib2data/src/automaton/PDA/InputDrivenNPDA.h index 393ebc8e7c..942690987c 100644 --- a/alib2data/src/automaton/PDA/InputDrivenNPDA.h +++ b/alib2data/src/automaton/PDA/InputDrivenNPDA.h @@ -11,7 +11,7 @@ #include "../AutomatonException.h" #include <map> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../common/State.h" #include "../../alphabet/Symbol.h" @@ -29,7 +29,7 @@ class InitialState; * Represents Finite Automaton. * Can store nondeterministic finite automaton without epsilon transitions. */ -class InputDrivenNPDA : public AutomatonBase, public std::Components2 < InputDrivenNPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { +class InputDrivenNPDA : public AutomatonBase, public std::Components < InputDrivenNPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: std::map < std::pair < State, alphabet::Symbol >, std::set < State > > transitions; std::map < alphabet::Symbol, std::pair < std::vector < alphabet::Symbol >, std::vector < alphabet::Symbol > > > inputSymbolToPushdownStoreOperation; @@ -205,7 +205,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::InputDrivenNPDA, alphabet::Symbol, automaton::InputAlphabet > { +class ComponentConstraint< automaton::InputDrivenNPDA, alphabet::Symbol, automaton::InputAlphabet > { public: static bool used ( const automaton::InputDrivenNPDA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::pair<automaton::State, alphabet::Symbol>, std::set<automaton::State>>& transition : automaton.getTransitions()) @@ -224,7 +224,7 @@ public: }; template < > -class ComponentConstraint2< automaton::InputDrivenNPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { +class ComponentConstraint< automaton::InputDrivenNPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { public: static bool used ( const automaton::InputDrivenNPDA & automaton, const alphabet::Symbol & symbol ) { for (const auto& pushdownStoreOperation : automaton.getPushdownStoreOperations()) { @@ -249,7 +249,7 @@ public: }; template < > -class ElementConstraint2< automaton::InputDrivenNPDA, alphabet::Symbol, automaton::InitialSymbol > { +class ElementConstraint< automaton::InputDrivenNPDA, alphabet::Symbol, automaton::InitialSymbol > { public: static bool available ( const automaton::InputDrivenNPDA & automaton, const alphabet::Symbol & symbol ) { return automaton.accessComponent < automaton::PushdownStoreAlphabet > ( ).get ( ).count ( symbol ); @@ -260,7 +260,7 @@ public: }; template < > -class ComponentConstraint2< automaton::InputDrivenNPDA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::InputDrivenNPDA, automaton::State, automaton::States > { public: static bool used ( const automaton::InputDrivenNPDA & automaton, const automaton::State & state ) { if ( automaton.getInitialState ( ) == state ) @@ -285,7 +285,7 @@ public: }; template < > -class ComponentConstraint2< automaton::InputDrivenNPDA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::InputDrivenNPDA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::InputDrivenNPDA &, const automaton::State & ) { return false; @@ -300,7 +300,7 @@ public: }; template < > -class ElementConstraint2< automaton::InputDrivenNPDA, automaton::State, automaton::InitialState > { +class ElementConstraint< automaton::InputDrivenNPDA, automaton::State, automaton::InitialState > { public: static bool available ( const automaton::InputDrivenNPDA & automaton, const automaton::State & state ) { return automaton.accessComponent < automaton::States > ( ).get ( ).count ( state ); diff --git a/alib2data/src/automaton/PDA/NPDA.cpp b/alib2data/src/automaton/PDA/NPDA.cpp index c847bb3a72..1c4b4c93ee 100644 --- a/alib2data/src/automaton/PDA/NPDA.cpp +++ b/alib2data/src/automaton/PDA/NPDA.cpp @@ -19,7 +19,7 @@ namespace automaton { -NPDA::NPDA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, State initialState, alphabet::Symbol initialSymbol, std::set < State > finalStates ) : std::Components2 < NPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { +NPDA::NPDA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, State initialState, alphabet::Symbol initialSymbol, std::set < State > finalStates ) : std::Components < NPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { } NPDA::NPDA(State initialState, alphabet::Symbol initialPushdownSymbol) : NPDA ( std::set < State > { initialState }, std::set < alphabet::Symbol > { }, std::set < alphabet::Symbol > { initialPushdownSymbol }, initialState, initialPushdownSymbol, std::set < automaton::State > { }) { diff --git a/alib2data/src/automaton/PDA/NPDA.h b/alib2data/src/automaton/PDA/NPDA.h index 7f44a8bcdc..47b8294fdf 100644 --- a/alib2data/src/automaton/PDA/NPDA.h +++ b/alib2data/src/automaton/PDA/NPDA.h @@ -13,7 +13,7 @@ #include <map> #include <vector> #include <variant> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../common/State.h" #include "../../alphabet/Symbol.h" @@ -31,7 +31,7 @@ class InitialState; /** * Push Down Automaton */ -class NPDA : public AutomatonBase, public std::Components2 < NPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { +class NPDA : public AutomatonBase, public std::Components < NPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: std::map < std::tuple < State, std::variant < string::Epsilon, alphabet::Symbol >, std::vector < alphabet::Symbol > >, std::set < std::pair < State, std::vector < alphabet::Symbol > > > > transitions; @@ -189,7 +189,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::NPDA, alphabet::Symbol, automaton::InputAlphabet > { +class ComponentConstraint< automaton::NPDA, alphabet::Symbol, automaton::InputAlphabet > { public: static bool used ( const automaton::NPDA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::tuple<automaton::State, std::variant<::string::Epsilon, alphabet::Symbol>, std::vector<alphabet::Symbol> >, std::set<std::pair<automaton::State, std::vector<alphabet::Symbol> > > >& transition : automaton.getTransitions()) @@ -208,7 +208,7 @@ public: }; template < > -class ComponentConstraint2< automaton::NPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { +class ComponentConstraint< automaton::NPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { public: static bool used ( const automaton::NPDA & automaton, const alphabet::Symbol & symbol ) { if(automaton.getInitialSymbol() == symbol) @@ -236,7 +236,7 @@ public: }; template < > -class ElementConstraint2< automaton::NPDA, alphabet::Symbol, automaton::InitialSymbol > { +class ElementConstraint< automaton::NPDA, alphabet::Symbol, automaton::InitialSymbol > { public: static bool available ( const automaton::NPDA & automaton, const alphabet::Symbol & symbol ) { return automaton.accessComponent < automaton::PushdownStoreAlphabet > ( ).get ( ).count ( symbol ); @@ -247,7 +247,7 @@ public: }; template < > -class ComponentConstraint2< automaton::NPDA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::NPDA, automaton::State, automaton::States > { public: static bool used ( const automaton::NPDA & automaton, const automaton::State & state ) { if ( automaton.getInitialState ( ) == state ) @@ -276,7 +276,7 @@ public: }; template < > -class ComponentConstraint2< automaton::NPDA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::NPDA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::NPDA &, const automaton::State & ) { return false; @@ -291,7 +291,7 @@ public: }; template < > -class ElementConstraint2< automaton::NPDA, automaton::State, automaton::InitialState > { +class ElementConstraint< automaton::NPDA, automaton::State, automaton::InitialState > { public: static bool available ( const automaton::NPDA & automaton, const automaton::State & state ) { return automaton.accessComponent < automaton::States > ( ).get ( ).count ( state ); diff --git a/alib2data/src/automaton/PDA/NPDTA.cpp b/alib2data/src/automaton/PDA/NPDTA.cpp index 852b47a270..51cb90c197 100644 --- a/alib2data/src/automaton/PDA/NPDTA.cpp +++ b/alib2data/src/automaton/PDA/NPDTA.cpp @@ -19,7 +19,7 @@ namespace automaton { -NPDTA::NPDTA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < alphabet::Symbol > outputAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, State initialState, alphabet::Symbol initialSymbol, std::set < State > finalStates ) : std::Components2 < NPDTA, alphabet::Symbol, std::tuple < InputAlphabet, OutputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ), std::move ( outputAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { +NPDTA::NPDTA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < alphabet::Symbol > outputAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, State initialState, alphabet::Symbol initialSymbol, std::set < State > finalStates ) : std::Components < NPDTA, alphabet::Symbol, std::tuple < InputAlphabet, OutputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ), std::move ( outputAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { } NPDTA::NPDTA(State initialState, alphabet::Symbol initialPushdownSymbol) : NPDTA ( std::set < State > { initialState }, std::set < alphabet::Symbol > { }, std::set < alphabet::Symbol > { }, std::set < alphabet::Symbol > { initialPushdownSymbol }, initialState, initialPushdownSymbol, std::set < automaton::State > { }) { diff --git a/alib2data/src/automaton/PDA/NPDTA.h b/alib2data/src/automaton/PDA/NPDTA.h index 224886688f..e1c9bffb87 100644 --- a/alib2data/src/automaton/PDA/NPDTA.h +++ b/alib2data/src/automaton/PDA/NPDTA.h @@ -13,7 +13,7 @@ #include <map> #include <vector> #include <variant> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../common/State.h" #include "../../alphabet/Symbol.h" @@ -32,7 +32,7 @@ class InitialState; /** * Push Down Translation Automaton */ -class NPDTA : public AutomatonBase, public std::Components2 < NPDTA, alphabet::Symbol, std::tuple < InputAlphabet, OutputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { +class NPDTA : public AutomatonBase, public std::Components < NPDTA, alphabet::Symbol, std::tuple < InputAlphabet, OutputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: std::map < std::tuple < State, std::variant < string::Epsilon, alphabet::Symbol >, std::vector < alphabet::Symbol > >, std::set < std::tuple < State, std::vector < alphabet::Symbol >, std::vector < alphabet::Symbol > > > > transitions; @@ -213,7 +213,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::NPDTA, alphabet::Symbol, automaton::InputAlphabet > { +class ComponentConstraint< automaton::NPDTA, alphabet::Symbol, automaton::InputAlphabet > { public: static bool used ( const automaton::NPDTA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::tuple<automaton::State, std::variant<::string::Epsilon, alphabet::Symbol>, std::vector<alphabet::Symbol> >, std::set<std::tuple<automaton::State, std::vector<alphabet::Symbol>, std::vector<alphabet::Symbol> > > >& transition : automaton.getTransitions()) @@ -232,7 +232,7 @@ public: }; template < > -class ComponentConstraint2< automaton::NPDTA, alphabet::Symbol, automaton::OutputAlphabet > { +class ComponentConstraint< automaton::NPDTA, alphabet::Symbol, automaton::OutputAlphabet > { public: static bool used ( const automaton::NPDTA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::tuple<automaton::State, std::variant<::string::Epsilon, alphabet::Symbol>, std::vector<alphabet::Symbol> >, std::set<std::tuple<automaton::State, std::vector<alphabet::Symbol>, std::vector<alphabet::Symbol> > > >& transition : automaton.getTransitions()) @@ -252,7 +252,7 @@ public: }; template < > -class ComponentConstraint2< automaton::NPDTA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { +class ComponentConstraint< automaton::NPDTA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { public: static bool used ( const automaton::NPDTA & automaton, const alphabet::Symbol & symbol ) { if(automaton.getInitialSymbol() == symbol) @@ -280,7 +280,7 @@ public: }; template < > -class ElementConstraint2< automaton::NPDTA, alphabet::Symbol, automaton::InitialSymbol > { +class ElementConstraint< automaton::NPDTA, alphabet::Symbol, automaton::InitialSymbol > { public: static bool available ( const automaton::NPDTA & automaton, const alphabet::Symbol & symbol ) { return automaton.accessComponent < automaton::PushdownStoreAlphabet > ( ).get ( ).count ( symbol ); @@ -291,7 +291,7 @@ public: }; template < > -class ComponentConstraint2< automaton::NPDTA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::NPDTA, automaton::State, automaton::States > { public: static bool used ( const automaton::NPDTA & automaton, const automaton::State & state ) { if ( automaton.getInitialState ( ) == state ) @@ -321,7 +321,7 @@ public: }; template < > -class ComponentConstraint2< automaton::NPDTA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::NPDTA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::NPDTA &, const automaton::State & ) { return false; @@ -336,7 +336,7 @@ public: }; template < > -class ElementConstraint2< automaton::NPDTA, automaton::State, automaton::InitialState > { +class ElementConstraint< automaton::NPDTA, automaton::State, automaton::InitialState > { public: static bool available ( const automaton::NPDTA & automaton, const automaton::State & state ) { return automaton.accessComponent < automaton::States > ( ).get ( ).count ( state ); diff --git a/alib2data/src/automaton/PDA/RealTimeHeightDeterministicDPDA.cpp b/alib2data/src/automaton/PDA/RealTimeHeightDeterministicDPDA.cpp index ca6199f3d7..e14c008aaa 100644 --- a/alib2data/src/automaton/PDA/RealTimeHeightDeterministicDPDA.cpp +++ b/alib2data/src/automaton/PDA/RealTimeHeightDeterministicDPDA.cpp @@ -19,7 +19,7 @@ namespace automaton { -RealTimeHeightDeterministicDPDA::RealTimeHeightDeterministicDPDA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, State initialState, alphabet::Symbol bottomOfTheStackSymbol, std::set < State > finalStates ) : std::Components2 < RealTimeHeightDeterministicDPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( bottomOfTheStackSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { +RealTimeHeightDeterministicDPDA::RealTimeHeightDeterministicDPDA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, State initialState, alphabet::Symbol bottomOfTheStackSymbol, std::set < State > finalStates ) : std::Components < RealTimeHeightDeterministicDPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( bottomOfTheStackSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { } RealTimeHeightDeterministicDPDA::RealTimeHeightDeterministicDPDA(State initialState, alphabet::Symbol bottomOfTheStackSymbol) : RealTimeHeightDeterministicDPDA ( std::set < State > { initialState }, std::set < alphabet::Symbol > { }, std::set < alphabet::Symbol > { bottomOfTheStackSymbol }, initialState, bottomOfTheStackSymbol, std::set < automaton::State > { }) { diff --git a/alib2data/src/automaton/PDA/RealTimeHeightDeterministicDPDA.h b/alib2data/src/automaton/PDA/RealTimeHeightDeterministicDPDA.h index 99ea87d1fa..c5d59a8765 100644 --- a/alib2data/src/automaton/PDA/RealTimeHeightDeterministicDPDA.h +++ b/alib2data/src/automaton/PDA/RealTimeHeightDeterministicDPDA.h @@ -12,7 +12,7 @@ #include <map> #include <vector> #include <variant> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../common/State.h" #include "../../alphabet/Symbol.h" @@ -31,7 +31,7 @@ class InitialState; * Represents Finite Automaton. * Can store nondeterministic finite automaton without epsilon transitions. */ -class RealTimeHeightDeterministicDPDA : public AutomatonBase, public std::Components2 < RealTimeHeightDeterministicDPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { +class RealTimeHeightDeterministicDPDA : public AutomatonBase, public std::Components < RealTimeHeightDeterministicDPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: std::map < std::pair < State, std::variant < string::Epsilon, alphabet::Symbol > >, std::pair < State, alphabet::Symbol > > callTransitions; std::map < std::tuple < State, std::variant < string::Epsilon, alphabet::Symbol >, alphabet::Symbol >, State > returnTransitions; @@ -229,7 +229,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::RealTimeHeightDeterministicDPDA, alphabet::Symbol, automaton::InputAlphabet > { +class ComponentConstraint< automaton::RealTimeHeightDeterministicDPDA, alphabet::Symbol, automaton::InputAlphabet > { public: static bool used ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::pair<automaton::State, std::variant<::string::Epsilon, alphabet::Symbol>>, std::pair<automaton::State, alphabet::Symbol> >& callTransition : automaton.getCallTransitions()) @@ -256,7 +256,7 @@ public: }; template < > -class ComponentConstraint2< automaton::RealTimeHeightDeterministicDPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { +class ComponentConstraint< automaton::RealTimeHeightDeterministicDPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { public: static bool used ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::pair<automaton::State, std::variant<::string::Epsilon, alphabet::Symbol>>, std::pair<automaton::State, alphabet::Symbol> >& callTransition : automaton.getCallTransitions()) @@ -282,7 +282,7 @@ public: }; template < > -class ElementConstraint2< automaton::RealTimeHeightDeterministicDPDA, alphabet::Symbol, automaton::BottomOfTheStackSymbol > { +class ElementConstraint< automaton::RealTimeHeightDeterministicDPDA, alphabet::Symbol, automaton::BottomOfTheStackSymbol > { public: static bool available ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const alphabet::Symbol & symbol ) { return automaton.accessComponent < automaton::PushdownStoreAlphabet > ( ).get ( ).count ( symbol ); @@ -293,7 +293,7 @@ public: }; template < > -class ComponentConstraint2< automaton::RealTimeHeightDeterministicDPDA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::RealTimeHeightDeterministicDPDA, automaton::State, automaton::States > { public: static bool used ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const automaton::State & state ) { if ( automaton.getInitialState ( ) == state ) @@ -326,7 +326,7 @@ public: }; template < > -class ComponentConstraint2< automaton::RealTimeHeightDeterministicDPDA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::RealTimeHeightDeterministicDPDA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::RealTimeHeightDeterministicDPDA &, const automaton::State & ) { return false; @@ -341,7 +341,7 @@ public: }; template < > -class ElementConstraint2< automaton::RealTimeHeightDeterministicDPDA, automaton::State, automaton::InitialState > { +class ElementConstraint< automaton::RealTimeHeightDeterministicDPDA, automaton::State, automaton::InitialState > { public: static bool available ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const automaton::State & state ) { return automaton.accessComponent < automaton::States > ( ).get ( ).count ( state ); diff --git a/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.cpp b/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.cpp index 7ee296ef4a..3b946f4f09 100644 --- a/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.cpp +++ b/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.cpp @@ -19,7 +19,7 @@ namespace automaton { -RealTimeHeightDeterministicNPDA::RealTimeHeightDeterministicNPDA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, std::set < State > initialStates, alphabet::Symbol bottomOfTheStackSymbol, std::set < State > finalStates ) : std::Components2 < RealTimeHeightDeterministicNPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, automaton::State, std::tuple < States, InitialStates, FinalStates >, std::tuple < > > ( std::make_tuple ( std::move ( inputAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( bottomOfTheStackSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( initialStates ), std::move ( finalStates ) ), std::tuple < > { } ) { +RealTimeHeightDeterministicNPDA::RealTimeHeightDeterministicNPDA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, std::set < State > initialStates, alphabet::Symbol bottomOfTheStackSymbol, std::set < State > finalStates ) : std::Components < RealTimeHeightDeterministicNPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, automaton::State, std::tuple < States, InitialStates, FinalStates >, std::tuple < > > ( std::make_tuple ( std::move ( inputAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( bottomOfTheStackSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( initialStates ), std::move ( finalStates ) ), std::tuple < > { } ) { } RealTimeHeightDeterministicNPDA::RealTimeHeightDeterministicNPDA(alphabet::Symbol bottomOfTheStackSymbol) : RealTimeHeightDeterministicNPDA ( std::set < State > { }, std::set < alphabet::Symbol > { }, std::set < alphabet::Symbol > { bottomOfTheStackSymbol }, std::set < State > {}, bottomOfTheStackSymbol, std::set < automaton::State > { }) { diff --git a/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.h b/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.h index 7944ab776d..e42f3e7a0b 100644 --- a/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.h +++ b/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.h @@ -12,7 +12,7 @@ #include <map> #include <vector> #include <variant> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../common/State.h" #include "../../alphabet/Symbol.h" @@ -31,7 +31,7 @@ class InitialStates; * Represents Finite Automaton. * Can store nondeterministic finite automaton without epsilon transitions. */ -class RealTimeHeightDeterministicNPDA : public AutomatonBase, public std::Components2 < RealTimeHeightDeterministicNPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, automaton::State, std::tuple < States, InitialStates, FinalStates >, std::tuple < > > { +class RealTimeHeightDeterministicNPDA : public AutomatonBase, public std::Components < RealTimeHeightDeterministicNPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, automaton::State, std::tuple < States, InitialStates, FinalStates >, std::tuple < > > { protected: std::map < std::pair < State, std::variant < string::Epsilon, alphabet::Symbol > >, std::set < std::pair < State, alphabet::Symbol > > > callTransitions; std::map < std::tuple < State, std::variant < string::Epsilon, alphabet::Symbol >, alphabet::Symbol >, std::set < State > > returnTransitions; @@ -237,7 +237,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::RealTimeHeightDeterministicNPDA, alphabet::Symbol, automaton::InputAlphabet > { +class ComponentConstraint< automaton::RealTimeHeightDeterministicNPDA, alphabet::Symbol, automaton::InputAlphabet > { public: static bool used ( const automaton::RealTimeHeightDeterministicNPDA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::pair<automaton::State, std::variant<::string::Epsilon, alphabet::Symbol>>, std::set<std::pair<automaton::State, alphabet::Symbol> > >& callTransition : automaton.getCallTransitions()) @@ -264,7 +264,7 @@ public: }; template < > -class ComponentConstraint2< automaton::RealTimeHeightDeterministicNPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { +class ComponentConstraint< automaton::RealTimeHeightDeterministicNPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { public: static bool used ( const automaton::RealTimeHeightDeterministicNPDA & automaton, const alphabet::Symbol & symbol ) { if(automaton.getBottomOfTheStackSymbol() == symbol) @@ -291,7 +291,7 @@ public: }; template < > -class ElementConstraint2< automaton::RealTimeHeightDeterministicNPDA, alphabet::Symbol, automaton::BottomOfTheStackSymbol > { +class ElementConstraint< automaton::RealTimeHeightDeterministicNPDA, alphabet::Symbol, automaton::BottomOfTheStackSymbol > { public: static bool available ( const automaton::RealTimeHeightDeterministicNPDA & automaton, const alphabet::Symbol & symbol ) { return automaton.accessComponent < automaton::PushdownStoreAlphabet > ( ).get ( ).count ( symbol ); @@ -302,7 +302,7 @@ public: }; template < > -class ComponentConstraint2< automaton::RealTimeHeightDeterministicNPDA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::RealTimeHeightDeterministicNPDA, automaton::State, automaton::States > { public: static bool used ( const automaton::RealTimeHeightDeterministicNPDA & automaton, const automaton::State & state ) { if ( automaton.getInitialStates ( ).count ( state ) ) @@ -350,7 +350,7 @@ public: }; template < > -class ComponentConstraint2< automaton::RealTimeHeightDeterministicNPDA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::RealTimeHeightDeterministicNPDA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::RealTimeHeightDeterministicNPDA &, const automaton::State & ) { return false; @@ -365,7 +365,7 @@ public: }; template < > -class ComponentConstraint2< automaton::RealTimeHeightDeterministicNPDA, automaton::State, automaton::InitialStates > { +class ComponentConstraint< automaton::RealTimeHeightDeterministicNPDA, automaton::State, automaton::InitialStates > { public: static bool used ( const automaton::RealTimeHeightDeterministicNPDA &, const automaton::State & ) { return false; diff --git a/alib2data/src/automaton/PDA/SinglePopDPDA.cpp b/alib2data/src/automaton/PDA/SinglePopDPDA.cpp index 72a521238d..1890b5dd84 100644 --- a/alib2data/src/automaton/PDA/SinglePopDPDA.cpp +++ b/alib2data/src/automaton/PDA/SinglePopDPDA.cpp @@ -19,7 +19,7 @@ namespace automaton { -SinglePopDPDA::SinglePopDPDA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, State initialState, alphabet::Symbol initialSymbol, std::set < State > finalStates ) : std::Components2 < SinglePopDPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { +SinglePopDPDA::SinglePopDPDA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, State initialState, alphabet::Symbol initialSymbol, std::set < State > finalStates ) : std::Components < SinglePopDPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { } SinglePopDPDA::SinglePopDPDA(State initialState, alphabet::Symbol initialPushdownSymbol) : SinglePopDPDA ( std::set < State > { initialState }, std::set < alphabet::Symbol > { }, std::set < alphabet::Symbol > { initialPushdownSymbol }, initialState, initialPushdownSymbol, std::set < automaton::State > { }) { diff --git a/alib2data/src/automaton/PDA/SinglePopDPDA.h b/alib2data/src/automaton/PDA/SinglePopDPDA.h index 5f696fc48a..01309eaf50 100644 --- a/alib2data/src/automaton/PDA/SinglePopDPDA.h +++ b/alib2data/src/automaton/PDA/SinglePopDPDA.h @@ -13,7 +13,7 @@ #include <map> #include <vector> #include <variant> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../common/State.h" #include "../../alphabet/Symbol.h" @@ -35,7 +35,7 @@ class InitialState; * if $\delta (q, a, r) \neq \emptyset$, $\delta (q, a, s) \neq \emptyset$ then $r \neq s$. * if $\delta(q, a, r) \neq \emptyset$, $\delta (q, \varepsilon, s) \neq \emptyset$, then $r \neq s$. */ -class SinglePopDPDA : public AutomatonBase, public std::Components2 < SinglePopDPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { +class SinglePopDPDA : public AutomatonBase, public std::Components < SinglePopDPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: std::map < std::tuple < State, std::variant < string::Epsilon, alphabet::Symbol >, alphabet::Symbol >, std::pair < State, std::vector < alphabet::Symbol > > > transitions; @@ -193,7 +193,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::SinglePopDPDA, alphabet::Symbol, automaton::InputAlphabet > { +class ComponentConstraint< automaton::SinglePopDPDA, alphabet::Symbol, automaton::InputAlphabet > { public: static bool used ( const automaton::SinglePopDPDA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::tuple<automaton::State, std::variant<::string::Epsilon, alphabet::Symbol>, alphabet::Symbol>, std::pair<automaton::State, std::vector<alphabet::Symbol> > >& transition : automaton.getTransitions()) @@ -212,7 +212,7 @@ public: }; template < > -class ComponentConstraint2< automaton::SinglePopDPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { +class ComponentConstraint< automaton::SinglePopDPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { public: static bool used ( const automaton::SinglePopDPDA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::tuple<automaton::State, std::variant<::string::Epsilon, alphabet::Symbol>, alphabet::Symbol>, std::pair<automaton::State, std::vector<alphabet::Symbol> > >& transition : automaton.getTransitions()) @@ -234,7 +234,7 @@ public: }; template < > -class ElementConstraint2< automaton::SinglePopDPDA, alphabet::Symbol, automaton::InitialSymbol > { +class ElementConstraint< automaton::SinglePopDPDA, alphabet::Symbol, automaton::InitialSymbol > { public: static bool available ( const automaton::SinglePopDPDA & automaton, const alphabet::Symbol & symbol ) { return automaton.accessComponent < automaton::PushdownStoreAlphabet > ( ).get ( ).count ( symbol ); @@ -245,7 +245,7 @@ public: }; template < > -class ComponentConstraint2< automaton::SinglePopDPDA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::SinglePopDPDA, automaton::State, automaton::States > { public: static bool used ( const automaton::SinglePopDPDA & automaton, const automaton::State & state ) { if ( automaton.getInitialState ( ) == state ) @@ -270,7 +270,7 @@ public: }; template < > -class ComponentConstraint2< automaton::SinglePopDPDA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::SinglePopDPDA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::SinglePopDPDA &, const automaton::State & ) { return false; @@ -285,7 +285,7 @@ public: }; template < > -class ElementConstraint2< automaton::SinglePopDPDA, automaton::State, automaton::InitialState > { +class ElementConstraint< automaton::SinglePopDPDA, automaton::State, automaton::InitialState > { public: static bool available ( const automaton::SinglePopDPDA & automaton, const automaton::State & state ) { return automaton.accessComponent < automaton::States > ( ).get ( ).count ( state ); diff --git a/alib2data/src/automaton/PDA/SinglePopNPDA.cpp b/alib2data/src/automaton/PDA/SinglePopNPDA.cpp index f2d609bd5a..171b9f7aec 100644 --- a/alib2data/src/automaton/PDA/SinglePopNPDA.cpp +++ b/alib2data/src/automaton/PDA/SinglePopNPDA.cpp @@ -18,7 +18,7 @@ namespace automaton { -SinglePopNPDA::SinglePopNPDA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, State initialState, alphabet::Symbol initialSymbol, std::set < State > finalStates ) : std::Components2 < SinglePopNPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { +SinglePopNPDA::SinglePopNPDA ( std::set < State > states, std::set < alphabet::Symbol > inputAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, State initialState, alphabet::Symbol initialSymbol, std::set < State > finalStates ) : std::Components < SinglePopNPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( inputAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { } SinglePopNPDA::SinglePopNPDA(State initialState, alphabet::Symbol initialPushdownSymbol) : SinglePopNPDA ( std::set < State > { initialState }, std::set < alphabet::Symbol > { }, std::set < alphabet::Symbol > { initialPushdownSymbol }, initialState, initialPushdownSymbol, std::set < automaton::State > { }) { diff --git a/alib2data/src/automaton/PDA/SinglePopNPDA.h b/alib2data/src/automaton/PDA/SinglePopNPDA.h index ae4d2d1b33..c716c22d74 100644 --- a/alib2data/src/automaton/PDA/SinglePopNPDA.h +++ b/alib2data/src/automaton/PDA/SinglePopNPDA.h @@ -13,7 +13,7 @@ #include <map> #include <vector> #include <variant> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../common/State.h" #include "../../alphabet/Symbol.h" @@ -31,7 +31,7 @@ class InitialState; /** * Push Down Automaton */ -class SinglePopNPDA : public AutomatonBase, public std::Components2 < SinglePopNPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { +class SinglePopNPDA : public AutomatonBase, public std::Components < SinglePopNPDA, alphabet::Symbol, std::tuple < InputAlphabet, PushdownStoreAlphabet >, std::tuple < InitialSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: std::map < std::tuple < State, std::variant < string::Epsilon, alphabet::Symbol >, alphabet::Symbol >, std::set < std::pair < State, std::vector < alphabet::Symbol > > > > transitions; @@ -189,7 +189,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::SinglePopNPDA, alphabet::Symbol, automaton::InputAlphabet > { +class ComponentConstraint< automaton::SinglePopNPDA, alphabet::Symbol, automaton::InputAlphabet > { public: static bool used ( const automaton::SinglePopNPDA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::tuple<automaton::State, std::variant<::string::Epsilon, alphabet::Symbol>, alphabet::Symbol>, std::set<std::pair<automaton::State, std::vector<alphabet::Symbol> > > >& transition : automaton.getTransitions()) @@ -208,7 +208,7 @@ public: }; template < > -class ComponentConstraint2< automaton::SinglePopNPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { +class ComponentConstraint< automaton::SinglePopNPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { public: static bool used ( const automaton::SinglePopNPDA & automaton, const alphabet::Symbol & symbol ) { if(automaton.getInitialSymbol() == symbol) @@ -235,7 +235,7 @@ public: }; template < > -class ElementConstraint2< automaton::SinglePopNPDA, alphabet::Symbol, automaton::InitialSymbol > { +class ElementConstraint< automaton::SinglePopNPDA, alphabet::Symbol, automaton::InitialSymbol > { public: static bool available ( const automaton::SinglePopNPDA & automaton, const alphabet::Symbol & symbol ) { return automaton.accessComponent < automaton::PushdownStoreAlphabet > ( ).get ( ).count ( symbol ); @@ -246,7 +246,7 @@ public: }; template < > -class ComponentConstraint2< automaton::SinglePopNPDA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::SinglePopNPDA, automaton::State, automaton::States > { public: static bool used ( const automaton::SinglePopNPDA & automaton, const automaton::State & state ) { if ( automaton.getInitialState ( ) == state ) @@ -276,7 +276,7 @@ public: }; template < > -class ComponentConstraint2< automaton::SinglePopNPDA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::SinglePopNPDA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::SinglePopNPDA &, const automaton::State & ) { return false; @@ -291,7 +291,7 @@ public: }; template < > -class ElementConstraint2< automaton::SinglePopNPDA, automaton::State, automaton::InitialState > { +class ElementConstraint< automaton::SinglePopNPDA, automaton::State, automaton::InitialState > { public: static bool available ( const automaton::SinglePopNPDA & automaton, const automaton::State & state ) { return automaton.accessComponent < automaton::States > ( ).get ( ).count ( state ); diff --git a/alib2data/src/automaton/PDA/VisiblyPushdownDPDA.cpp b/alib2data/src/automaton/PDA/VisiblyPushdownDPDA.cpp index 62bcfbabfe..b94fb28776 100644 --- a/alib2data/src/automaton/PDA/VisiblyPushdownDPDA.cpp +++ b/alib2data/src/automaton/PDA/VisiblyPushdownDPDA.cpp @@ -18,7 +18,7 @@ namespace automaton { -VisiblyPushdownDPDA::VisiblyPushdownDPDA ( std::set < State > states, std::set < alphabet::Symbol > callAlphabet, std::set < alphabet::Symbol > returnAlphabet, std::set < alphabet::Symbol > localAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, State initialState, alphabet::Symbol bottomOfTheStackSymbol, std::set < State > finalStates ) : std::Components2 < VisiblyPushdownDPDA, alphabet::Symbol, std::tuple < CallAlphabet, ReturnAlphabet, LocalAlphabet, PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( callAlphabet ), std::move ( returnAlphabet ), std::move ( localAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( bottomOfTheStackSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { +VisiblyPushdownDPDA::VisiblyPushdownDPDA ( std::set < State > states, std::set < alphabet::Symbol > callAlphabet, std::set < alphabet::Symbol > returnAlphabet, std::set < alphabet::Symbol > localAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, State initialState, alphabet::Symbol bottomOfTheStackSymbol, std::set < State > finalStates ) : std::Components < VisiblyPushdownDPDA, alphabet::Symbol, std::tuple < CallAlphabet, ReturnAlphabet, LocalAlphabet, PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( callAlphabet ), std::move ( returnAlphabet ), std::move ( localAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( bottomOfTheStackSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { } VisiblyPushdownDPDA::VisiblyPushdownDPDA(State initialState, alphabet::Symbol bottomOfTheStackSymbol) : VisiblyPushdownDPDA ( std::set < State > { initialState }, std::set < alphabet::Symbol > { }, std::set < alphabet::Symbol > { }, std::set < alphabet::Symbol > { }, std::set < alphabet::Symbol > { bottomOfTheStackSymbol }, initialState, bottomOfTheStackSymbol, std::set < automaton::State > { }) { diff --git a/alib2data/src/automaton/PDA/VisiblyPushdownDPDA.h b/alib2data/src/automaton/PDA/VisiblyPushdownDPDA.h index 69a4403138..3c0a49772c 100644 --- a/alib2data/src/automaton/PDA/VisiblyPushdownDPDA.h +++ b/alib2data/src/automaton/PDA/VisiblyPushdownDPDA.h @@ -11,7 +11,7 @@ #include "../AutomatonException.h" #include <map> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../common/State.h" #include "../../alphabet/Symbol.h" @@ -31,7 +31,7 @@ class InitialState; * Represents Finite Automaton. * Can store nondeterministic finite automaton without epsilon transitions. */ -class VisiblyPushdownDPDA : public AutomatonBase, public std::Components2 < VisiblyPushdownDPDA, alphabet::Symbol, std::tuple < CallAlphabet, ReturnAlphabet, LocalAlphabet, PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { +class VisiblyPushdownDPDA : public AutomatonBase, public std::Components < VisiblyPushdownDPDA, alphabet::Symbol, std::tuple < CallAlphabet, ReturnAlphabet, LocalAlphabet, PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: std::map < std::pair < State, alphabet::Symbol >, std::pair < State, alphabet::Symbol > > callTransitions; std::map < std::tuple < State, alphabet::Symbol, alphabet::Symbol >, State > returnTransitions; @@ -261,7 +261,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::VisiblyPushdownDPDA, alphabet::Symbol, automaton::CallAlphabet > { +class ComponentConstraint< automaton::VisiblyPushdownDPDA, alphabet::Symbol, automaton::CallAlphabet > { public: static bool used ( const automaton::VisiblyPushdownDPDA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::pair<automaton::State, alphabet::Symbol>, std::pair<automaton::State, alphabet::Symbol> >& callTransition : automaton.getCallTransitions()) @@ -284,7 +284,7 @@ public: }; template < > -class ComponentConstraint2< automaton::VisiblyPushdownDPDA, alphabet::Symbol, automaton::ReturnAlphabet > { +class ComponentConstraint< automaton::VisiblyPushdownDPDA, alphabet::Symbol, automaton::ReturnAlphabet > { public: static bool used ( const automaton::VisiblyPushdownDPDA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::tuple<automaton::State, alphabet::Symbol, alphabet::Symbol>, automaton::State>& returnTransition : automaton.getReturnTransitions()) @@ -307,7 +307,7 @@ public: }; template < > -class ComponentConstraint2< automaton::VisiblyPushdownDPDA, alphabet::Symbol, automaton::LocalAlphabet > { +class ComponentConstraint< automaton::VisiblyPushdownDPDA, alphabet::Symbol, automaton::LocalAlphabet > { public: static bool used ( const automaton::VisiblyPushdownDPDA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::pair<automaton::State, alphabet::Symbol>, automaton::State>& localTransition : automaton.getLocalTransitions()) @@ -330,7 +330,7 @@ public: }; template < > -class ComponentConstraint2< automaton::VisiblyPushdownDPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { +class ComponentConstraint< automaton::VisiblyPushdownDPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { public: static bool used ( const automaton::VisiblyPushdownDPDA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::pair<automaton::State, alphabet::Symbol>, std::pair<automaton::State, alphabet::Symbol> >& callTransition : automaton.getCallTransitions()) @@ -356,7 +356,7 @@ public: }; template < > -class ElementConstraint2< automaton::VisiblyPushdownDPDA, alphabet::Symbol, automaton::BottomOfTheStackSymbol > { +class ElementConstraint< automaton::VisiblyPushdownDPDA, alphabet::Symbol, automaton::BottomOfTheStackSymbol > { public: static bool available ( const automaton::VisiblyPushdownDPDA & automaton, const alphabet::Symbol & symbol ) { return automaton.accessComponent < automaton::PushdownStoreAlphabet > ( ).get ( ).count ( symbol ); @@ -367,7 +367,7 @@ public: }; template < > -class ComponentConstraint2< automaton::VisiblyPushdownDPDA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::VisiblyPushdownDPDA, automaton::State, automaton::States > { public: static bool used ( const automaton::VisiblyPushdownDPDA & automaton, const automaton::State & state ) { if ( automaton.getInitialState ( ) == state ) @@ -400,7 +400,7 @@ public: }; template < > -class ComponentConstraint2< automaton::VisiblyPushdownDPDA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::VisiblyPushdownDPDA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::VisiblyPushdownDPDA &, const automaton::State & ) { return false; @@ -415,7 +415,7 @@ public: }; template < > -class ElementConstraint2< automaton::VisiblyPushdownDPDA, automaton::State, automaton::InitialState > { +class ElementConstraint< automaton::VisiblyPushdownDPDA, automaton::State, automaton::InitialState > { public: static bool available ( const automaton::VisiblyPushdownDPDA & automaton, const automaton::State & state ) { return automaton.accessComponent < automaton::States > ( ).get ( ).count ( state ); diff --git a/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.cpp b/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.cpp index 8eaed1f632..c37d2c7a50 100644 --- a/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.cpp +++ b/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.cpp @@ -18,7 +18,7 @@ namespace automaton { -VisiblyPushdownNPDA::VisiblyPushdownNPDA ( std::set < State > states, std::set < alphabet::Symbol > callAlphabet, std::set < alphabet::Symbol > returnAlphabet, std::set < alphabet::Symbol > localAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, std::set < State > initialStates, alphabet::Symbol bottomOfTheStackSymbol, std::set < State > finalStates ) : std::Components2 < VisiblyPushdownNPDA, alphabet::Symbol, std::tuple < CallAlphabet, ReturnAlphabet, LocalAlphabet, PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, automaton::State, std::tuple < States, InitialStates, FinalStates >, std::tuple < > > ( std::make_tuple ( std::move ( callAlphabet ), std::move ( returnAlphabet ), std::move ( localAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( bottomOfTheStackSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( initialStates ), std::move ( finalStates ) ), std::tuple < > ( ) ) { +VisiblyPushdownNPDA::VisiblyPushdownNPDA ( std::set < State > states, std::set < alphabet::Symbol > callAlphabet, std::set < alphabet::Symbol > returnAlphabet, std::set < alphabet::Symbol > localAlphabet, std::set < alphabet::Symbol > pushdownStoreAlphabet, std::set < State > initialStates, alphabet::Symbol bottomOfTheStackSymbol, std::set < State > finalStates ) : std::Components < VisiblyPushdownNPDA, alphabet::Symbol, std::tuple < CallAlphabet, ReturnAlphabet, LocalAlphabet, PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, automaton::State, std::tuple < States, InitialStates, FinalStates >, std::tuple < > > ( std::make_tuple ( std::move ( callAlphabet ), std::move ( returnAlphabet ), std::move ( localAlphabet ), std::move ( pushdownStoreAlphabet ) ), std::make_tuple ( std::move ( bottomOfTheStackSymbol ) ), std::make_tuple ( std::move ( states ), std::move ( initialStates ), std::move ( finalStates ) ), std::tuple < > ( ) ) { } VisiblyPushdownNPDA::VisiblyPushdownNPDA(alphabet::Symbol bottomOfTheStackSymbol) : VisiblyPushdownNPDA ( std::set < State > { }, std::set < alphabet::Symbol > { }, std::set < alphabet::Symbol > { }, std::set < alphabet::Symbol > { }, std::set < alphabet::Symbol > { bottomOfTheStackSymbol }, std::set < State > { }, bottomOfTheStackSymbol, std::set < automaton::State > { }) { diff --git a/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.h b/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.h index 85e4a77122..52a78371f4 100644 --- a/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.h +++ b/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.h @@ -11,7 +11,7 @@ #include "../AutomatonException.h" #include <map> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../common/State.h" #include "../../alphabet/Symbol.h" @@ -31,7 +31,7 @@ class InitialStates; * Represents Finite Automaton. * Can store nondeterministic finite automaton without epsilon transitions. */ -class VisiblyPushdownNPDA : public AutomatonBase, public std::Components2 < VisiblyPushdownNPDA, alphabet::Symbol, std::tuple < CallAlphabet, ReturnAlphabet, LocalAlphabet, PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, automaton::State, std::tuple < States, InitialStates, FinalStates >, std::tuple < > > { +class VisiblyPushdownNPDA : public AutomatonBase, public std::Components < VisiblyPushdownNPDA, alphabet::Symbol, std::tuple < CallAlphabet, ReturnAlphabet, LocalAlphabet, PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, automaton::State, std::tuple < States, InitialStates, FinalStates >, std::tuple < > > { protected: std::map < std::pair < State, alphabet::Symbol >, std::set < std::pair < State, alphabet::Symbol > > > callTransitions; std::map < std::tuple < State, alphabet::Symbol, alphabet::Symbol >, std::set < State > > returnTransitions; @@ -269,7 +269,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::VisiblyPushdownNPDA, alphabet::Symbol, automaton::CallAlphabet > { +class ComponentConstraint< automaton::VisiblyPushdownNPDA, alphabet::Symbol, automaton::CallAlphabet > { public: static bool used ( const automaton::VisiblyPushdownNPDA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::pair<automaton::State, alphabet::Symbol>, std::set < std::pair<automaton::State, alphabet::Symbol> > >& callTransition : automaton.getCallTransitions()) @@ -292,7 +292,7 @@ public: }; template < > -class ComponentConstraint2< automaton::VisiblyPushdownNPDA, alphabet::Symbol, automaton::ReturnAlphabet > { +class ComponentConstraint< automaton::VisiblyPushdownNPDA, alphabet::Symbol, automaton::ReturnAlphabet > { public: static bool used ( const automaton::VisiblyPushdownNPDA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::tuple<automaton::State, alphabet::Symbol, alphabet::Symbol>, std::set < automaton::State> >& returnTransition : automaton.getReturnTransitions()) @@ -315,7 +315,7 @@ public: }; template < > -class ComponentConstraint2< automaton::VisiblyPushdownNPDA, alphabet::Symbol, automaton::LocalAlphabet > { +class ComponentConstraint< automaton::VisiblyPushdownNPDA, alphabet::Symbol, automaton::LocalAlphabet > { public: static bool used ( const automaton::VisiblyPushdownNPDA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::pair<automaton::State, alphabet::Symbol>, std::set < automaton::State >>& localTransition : automaton.getLocalTransitions()) @@ -338,7 +338,7 @@ public: }; template < > -class ComponentConstraint2< automaton::VisiblyPushdownNPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { +class ComponentConstraint< automaton::VisiblyPushdownNPDA, alphabet::Symbol, automaton::PushdownStoreAlphabet > { public: static bool used ( const automaton::VisiblyPushdownNPDA & automaton, const alphabet::Symbol & symbol ) { for (const std::pair<const std::pair<automaton::State, alphabet::Symbol>, std::set<std::pair<automaton::State, alphabet::Symbol> > >& callTransition : automaton.getCallTransitions()) @@ -365,7 +365,7 @@ public: }; template < > -class ElementConstraint2< automaton::VisiblyPushdownNPDA, alphabet::Symbol, automaton::BottomOfTheStackSymbol > { +class ElementConstraint< automaton::VisiblyPushdownNPDA, alphabet::Symbol, automaton::BottomOfTheStackSymbol > { public: static bool available ( const automaton::VisiblyPushdownNPDA & automaton, const alphabet::Symbol & symbol ) { return automaton.accessComponent < automaton::PushdownStoreAlphabet > ( ).get ( ).count ( symbol ); @@ -376,7 +376,7 @@ public: }; template < > -class ComponentConstraint2< automaton::VisiblyPushdownNPDA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::VisiblyPushdownNPDA, automaton::State, automaton::States > { public: static bool used ( const automaton::VisiblyPushdownNPDA & automaton, const automaton::State & state ) { if ( automaton.getInitialStates ( ).count ( state ) ) @@ -424,7 +424,7 @@ public: }; template < > -class ComponentConstraint2< automaton::VisiblyPushdownNPDA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::VisiblyPushdownNPDA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::VisiblyPushdownNPDA &, const automaton::State & ) { return false; @@ -439,7 +439,7 @@ public: }; template < > -class ComponentConstraint2< automaton::VisiblyPushdownNPDA, automaton::State, automaton::InitialStates > { +class ComponentConstraint< automaton::VisiblyPushdownNPDA, automaton::State, automaton::InitialStates > { public: static bool used ( const automaton::VisiblyPushdownNPDA &, const automaton::State & ) { return false; diff --git a/alib2data/src/automaton/TA/DFTA.cpp b/alib2data/src/automaton/TA/DFTA.cpp index f5d166e84e..97e7398963 100644 --- a/alib2data/src/automaton/TA/DFTA.cpp +++ b/alib2data/src/automaton/TA/DFTA.cpp @@ -18,7 +18,7 @@ namespace automaton { -DFTA::DFTA ( std::set < State > states, std::set < alphabet::RankedSymbol > inputAlphabet, std::set < State > finalStates ) : std::Components2 < DFTA, alphabet::RankedSymbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < > > ( std::make_tuple ( std::move ( inputAlphabet ) ), std::tuple < > ( ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::tuple < > ( ) ) { +DFTA::DFTA ( std::set < State > states, std::set < alphabet::RankedSymbol > inputAlphabet, std::set < State > finalStates ) : std::Components < DFTA, alphabet::RankedSymbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < > > ( std::make_tuple ( std::move ( inputAlphabet ) ), std::tuple < > ( ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::tuple < > ( ) ) { } DFTA::DFTA() : DFTA ( std::set < State > { }, std::set < alphabet::RankedSymbol > { }, std::set < State > { } ) { diff --git a/alib2data/src/automaton/TA/DFTA.h b/alib2data/src/automaton/TA/DFTA.h index 73b8c1c02b..fd4b16d52f 100644 --- a/alib2data/src/automaton/TA/DFTA.h +++ b/alib2data/src/automaton/TA/DFTA.h @@ -11,7 +11,7 @@ #include "../AutomatonException.h" #include <map> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../common/State.h" #include "../../alphabet/RankedSymbol.h" @@ -26,7 +26,7 @@ class FinalStates; * Represents Finite Tree Automaton. * Can store nondeterministic finite automaton without epsilon transitions. */ -class DFTA : public AutomatonBase, public std::Components2 < DFTA, alphabet::RankedSymbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < > > { +class DFTA : public AutomatonBase, public std::Components < DFTA, alphabet::RankedSymbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < > > { std::map < std::pair < alphabet::RankedSymbol, std::vector < State > >, State > transitions; public: @@ -143,7 +143,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::DFTA, alphabet::RankedSymbol, automaton::InputAlphabet > { +class ComponentConstraint< automaton::DFTA, alphabet::RankedSymbol, automaton::InputAlphabet > { public: static bool used ( const automaton::DFTA & automaton, const alphabet::RankedSymbol & symbol ) { for (const std::pair<const std::pair<alphabet::RankedSymbol, std::vector<automaton::State> >, automaton::State>& t : automaton.getTransitions()) @@ -162,7 +162,7 @@ public: }; template < > -class ComponentConstraint2< automaton::DFTA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::DFTA, automaton::State, automaton::States > { public: static bool used ( const automaton::DFTA & automaton, const automaton::State & state ) { if ( automaton.getFinalStates ( ).count ( state ) ) @@ -184,7 +184,7 @@ public: }; template < > -class ComponentConstraint2< automaton::DFTA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::DFTA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::DFTA &, const automaton::State & ) { return false; diff --git a/alib2data/src/automaton/TA/NFTA.cpp b/alib2data/src/automaton/TA/NFTA.cpp index d5271d46be..514ac1f988 100644 --- a/alib2data/src/automaton/TA/NFTA.cpp +++ b/alib2data/src/automaton/TA/NFTA.cpp @@ -18,7 +18,7 @@ namespace automaton { -NFTA::NFTA ( std::set < State > states, std::set < alphabet::RankedSymbol > inputAlphabet, std::set < State > finalStates ) : std::Components2 < NFTA, alphabet::RankedSymbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < > > ( std::make_tuple ( std::move ( inputAlphabet ) ), std::tuple < > ( ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::tuple < > ( ) ) { +NFTA::NFTA ( std::set < State > states, std::set < alphabet::RankedSymbol > inputAlphabet, std::set < State > finalStates ) : std::Components < NFTA, alphabet::RankedSymbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < > > ( std::make_tuple ( std::move ( inputAlphabet ) ), std::tuple < > ( ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::tuple < > ( ) ) { } NFTA::NFTA() : NFTA ( std::set < State > { }, std::set < alphabet::RankedSymbol > { }, std::set < State > { } ) { diff --git a/alib2data/src/automaton/TA/NFTA.h b/alib2data/src/automaton/TA/NFTA.h index 4ac94c13f0..c432966577 100644 --- a/alib2data/src/automaton/TA/NFTA.h +++ b/alib2data/src/automaton/TA/NFTA.h @@ -11,7 +11,7 @@ #include "../AutomatonException.h" #include <map> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../AutomatonBase.h" #include "../common/State.h" #include "../../alphabet/RankedSymbol.h" @@ -28,7 +28,7 @@ class FinalStates; * Represents Finite Tree Automaton. * Can store nondeterministic finite tree automaton without epsilon transitions. */ -class NFTA : public AutomatonBase, public std::Components2 < NFTA, alphabet::RankedSymbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < > > { +class NFTA : public AutomatonBase, public std::Components < NFTA, alphabet::RankedSymbol, std::tuple < InputAlphabet >, std::tuple < >, automaton::State, std::tuple < States, FinalStates >, std::tuple < > > { std::map < std::pair < alphabet::RankedSymbol, std::vector < State > >, std::set < State > > transitions; public: @@ -155,7 +155,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::NFTA, alphabet::RankedSymbol, automaton::InputAlphabet > { +class ComponentConstraint< automaton::NFTA, alphabet::RankedSymbol, automaton::InputAlphabet > { public: static bool used ( const automaton::NFTA & automaton, const alphabet::RankedSymbol & symbol ) { for (const std::pair<const std::pair<alphabet::RankedSymbol, std::vector<automaton::State> >, std::set<automaton::State>>& t : automaton.getTransitions()) @@ -174,7 +174,7 @@ public: }; template < > -class ComponentConstraint2< automaton::NFTA, automaton::State, automaton::States > { +class ComponentConstraint< automaton::NFTA, automaton::State, automaton::States > { public: static bool used ( const automaton::NFTA & automaton, const automaton::State & state ) { if ( automaton.getFinalStates ( ).count ( state ) ) @@ -196,7 +196,7 @@ public: }; template < > -class ComponentConstraint2< automaton::NFTA, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::NFTA, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::NFTA &, const automaton::State & ) { return false; diff --git a/alib2data/src/automaton/TM/OneTapeDTM.cpp b/alib2data/src/automaton/TM/OneTapeDTM.cpp index 3b4cc1728b..92ca252502 100644 --- a/alib2data/src/automaton/TM/OneTapeDTM.cpp +++ b/alib2data/src/automaton/TM/OneTapeDTM.cpp @@ -17,7 +17,7 @@ namespace automaton { -OneTapeDTM::OneTapeDTM ( std::set < State > states, std::set < alphabet::Symbol > tapeAlphabet, alphabet::Symbol blankSymbol, std::set< alphabet::Symbol > inputAlphabet, State initialState, std::set < State > finalStates ) : std::Components2 < OneTapeDTM, alphabet::Symbol, std::tuple < TapeAlphabet, InputAlphabet >, std::tuple < BlankSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( tapeAlphabet), std::move ( inputAlphabet ) ), std::make_tuple ( blankSymbol ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { +OneTapeDTM::OneTapeDTM ( std::set < State > states, std::set < alphabet::Symbol > tapeAlphabet, alphabet::Symbol blankSymbol, std::set< alphabet::Symbol > inputAlphabet, State initialState, std::set < State > finalStates ) : std::Components < OneTapeDTM, alphabet::Symbol, std::tuple < TapeAlphabet, InputAlphabet >, std::tuple < BlankSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > ( std::make_tuple ( std::move ( tapeAlphabet), std::move ( inputAlphabet ) ), std::make_tuple ( blankSymbol ), std::make_tuple ( std::move ( states ), std::move ( finalStates ) ), std::make_tuple ( std::move ( initialState ) ) ) { } diff --git a/alib2data/src/automaton/TM/OneTapeDTM.h b/alib2data/src/automaton/TM/OneTapeDTM.h index c41aac391d..16ea5660bf 100644 --- a/alib2data/src/automaton/TM/OneTapeDTM.h +++ b/alib2data/src/automaton/TM/OneTapeDTM.h @@ -10,7 +10,7 @@ #include "../AutomatonException.h" #include "../AutomatonBase.h" -#include <core/components2.hpp> +#include <core/components.hpp> #include "../common/State.h" #include "../../alphabet/Symbol.h" #include "../common/Shift.h" @@ -31,7 +31,7 @@ class InitialState; /** * One tape turing machine */ -class OneTapeDTM : public AutomatonBase, public std::Components2 < OneTapeDTM, alphabet::Symbol, std::tuple < TapeAlphabet, InputAlphabet >, std::tuple < BlankSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { +class OneTapeDTM : public AutomatonBase, public std::Components < OneTapeDTM, alphabet::Symbol, std::tuple < TapeAlphabet, InputAlphabet >, std::tuple < BlankSymbol >, automaton::State, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: std::map < std::pair < State, alphabet::Symbol >, std::tuple < State, alphabet::Symbol, Shift > > transitions; @@ -182,7 +182,7 @@ public: namespace std { template < > -class ComponentConstraint2< automaton::OneTapeDTM, alphabet::Symbol, automaton::TapeAlphabet > { +class ComponentConstraint< automaton::OneTapeDTM, alphabet::Symbol, automaton::TapeAlphabet > { public: static bool used ( const automaton::OneTapeDTM & automaton, const alphabet::Symbol & symbol ) { if ( automaton.getBlankSymbol ( ) == symbol ) @@ -208,7 +208,7 @@ public: }; template < > -class ComponentConstraint2< automaton::OneTapeDTM, alphabet::Symbol, automaton::InputAlphabet > { +class ComponentConstraint< automaton::OneTapeDTM, alphabet::Symbol, automaton::InputAlphabet > { public: static bool used ( const automaton::OneTapeDTM &, const alphabet::Symbol & ) { return false; @@ -225,7 +225,7 @@ public: }; template < > -class ElementConstraint2< automaton::OneTapeDTM, alphabet::Symbol, automaton::BlankSymbol > { +class ElementConstraint< automaton::OneTapeDTM, alphabet::Symbol, automaton::BlankSymbol > { public: static bool available ( const automaton::OneTapeDTM & automaton, const alphabet::Symbol & symbol ) { return automaton.accessComponent < automaton::TapeAlphabet > ( ).get ( ).count ( symbol ); @@ -238,7 +238,7 @@ public: }; template < > -class ComponentConstraint2< automaton::OneTapeDTM, automaton::State, automaton::States > { +class ComponentConstraint< automaton::OneTapeDTM, automaton::State, automaton::States > { public: static bool used ( const automaton::OneTapeDTM & automaton, const automaton::State & state ) { if ( automaton.getInitialState ( ) == state ) @@ -263,7 +263,7 @@ public: }; template < > -class ComponentConstraint2< automaton::OneTapeDTM, automaton::State, automaton::FinalStates > { +class ComponentConstraint< automaton::OneTapeDTM, automaton::State, automaton::FinalStates > { public: static bool used ( const automaton::OneTapeDTM &, const automaton::State & ) { return false; @@ -278,7 +278,7 @@ public: }; template < > -class ElementConstraint2< automaton::OneTapeDTM, automaton::State, automaton::InitialState > { +class ElementConstraint< automaton::OneTapeDTM, automaton::State, automaton::InitialState > { public: static bool available ( const automaton::OneTapeDTM & automaton, const automaton::State & state ) { return automaton.accessComponent < automaton::States > ( ).get ( ).count ( state ); diff --git a/alib2data/src/grammar/ContextFree/CFG.cpp b/alib2data/src/grammar/ContextFree/CFG.cpp index 6d3aa43d00..027b90c3ba 100644 --- a/alib2data/src/grammar/ContextFree/CFG.cpp +++ b/alib2data/src/grammar/ContextFree/CFG.cpp @@ -24,7 +24,7 @@ namespace grammar { CFG::CFG ( alphabet::Symbol initialSymbol ) : CFG ( std::set < alphabet::Symbol > { initialSymbol }, std::set < alphabet::Symbol > ( ), initialSymbol ) { } -CFG::CFG ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components2 < CFG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ) { +CFG::CFG ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components < CFG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ) { } CFG::CFG ( const EpsilonFreeCFG & other ) : CFG ( other.getNonterminalAlphabet ( ), other.getTerminalAlphabet ( ), other.getInitialSymbol ( ) ) { diff --git a/alib2data/src/grammar/ContextFree/CFG.h b/alib2data/src/grammar/ContextFree/CFG.h index 4b934db22c..4670e9c93c 100644 --- a/alib2data/src/grammar/ContextFree/CFG.h +++ b/alib2data/src/grammar/ContextFree/CFG.h @@ -13,7 +13,7 @@ #include "EpsilonFreeCFG.h" #include <map> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../../alphabet/Symbol.h" namespace grammar { @@ -25,7 +25,7 @@ class TerminalAlphabet; class NonterminalAlphabet; class InitialSymbol; -class CFG : public GrammarBase, public std::Components2 < CFG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { +class CFG : public GrammarBase, public std::Components < CFG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { std::map < alphabet::Symbol, std::set < std::vector < alphabet::Symbol > > > rules; public: @@ -113,7 +113,7 @@ public: namespace std { template < > -class ComponentConstraint2< grammar::CFG, alphabet::Symbol, grammar::TerminalAlphabet > { +class ComponentConstraint< grammar::CFG, alphabet::Symbol, grammar::TerminalAlphabet > { public: static bool used ( const grammar::CFG & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const alphabet::Symbol, std::set < std::vector < alphabet::Symbol > > > & rule : grammar.getRules ( ) ) @@ -135,7 +135,7 @@ public: }; template < > -class ComponentConstraint2< grammar::CFG, alphabet::Symbol, grammar::NonterminalAlphabet > { +class ComponentConstraint< grammar::CFG, alphabet::Symbol, grammar::NonterminalAlphabet > { public: static bool used ( const grammar::CFG & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const alphabet::Symbol, std::set < std::vector < alphabet::Symbol > > > & rule : grammar.getRules ( ) ) { @@ -165,7 +165,7 @@ public: }; template < > -class ElementConstraint2< grammar::CFG, alphabet::Symbol, grammar::InitialSymbol > { +class ElementConstraint< grammar::CFG, alphabet::Symbol, grammar::InitialSymbol > { public: static bool available ( const grammar::CFG & grammar, const alphabet::Symbol & symbol ) { return grammar.accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/grammar/ContextFree/CNF.cpp b/alib2data/src/grammar/ContextFree/CNF.cpp index 94dc9a4adc..8feb583ae0 100644 --- a/alib2data/src/grammar/ContextFree/CNF.cpp +++ b/alib2data/src/grammar/ContextFree/CNF.cpp @@ -23,7 +23,7 @@ namespace grammar { CNF::CNF ( alphabet::Symbol initialSymbol ) : CNF ( std::set < alphabet::Symbol > { initialSymbol }, std::set < alphabet::Symbol > ( ), initialSymbol ) { } -CNF::CNF ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components2 < CNF, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ), generatesEpsilon ( false ) { +CNF::CNF ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components < CNF, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ), generatesEpsilon ( false ) { } GrammarBase * CNF::clone ( ) const { diff --git a/alib2data/src/grammar/ContextFree/CNF.h b/alib2data/src/grammar/ContextFree/CNF.h index b9c20afb8c..d3e6f5ff66 100644 --- a/alib2data/src/grammar/ContextFree/CNF.h +++ b/alib2data/src/grammar/ContextFree/CNF.h @@ -13,7 +13,7 @@ #include <map> #include <vector> #include <variant> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../../alphabet/Symbol.h" namespace grammar { @@ -25,7 +25,7 @@ class TerminalAlphabet; class NonterminalAlphabet; class InitialSymbol; -class CNF : public GrammarBase, public std::Components2 < CNF, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { +class CNF : public GrammarBase, public std::Components < CNF, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { std::map < alphabet::Symbol, std::set < std::variant < alphabet::Symbol, std::pair < alphabet::Symbol, alphabet::Symbol > > > > rules; bool generatesEpsilon; @@ -119,7 +119,7 @@ public: namespace std { template < > -class ComponentConstraint2< grammar::CNF, alphabet::Symbol, grammar::TerminalAlphabet > { +class ComponentConstraint< grammar::CNF, alphabet::Symbol, grammar::TerminalAlphabet > { public: static bool used ( const grammar::CNF & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const alphabet::Symbol, std::set < std::variant < alphabet::Symbol, std::pair < alphabet::Symbol, alphabet::Symbol > > > > & rule : grammar.getRules ( ) ) @@ -141,7 +141,7 @@ public: }; template < > -class ComponentConstraint2< grammar::CNF, alphabet::Symbol, grammar::NonterminalAlphabet > { +class ComponentConstraint< grammar::CNF, alphabet::Symbol, grammar::NonterminalAlphabet > { public: static bool used ( const grammar::CNF & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const alphabet::Symbol, std::set < std::variant < alphabet::Symbol, std::pair < alphabet::Symbol, alphabet::Symbol > > > > & rule : grammar.getRules ( ) ) { @@ -171,7 +171,7 @@ public: }; template < > -class ElementConstraint2< grammar::CNF, alphabet::Symbol, grammar::InitialSymbol > { +class ElementConstraint< grammar::CNF, alphabet::Symbol, grammar::InitialSymbol > { public: static bool available ( const grammar::CNF & grammar, const alphabet::Symbol & symbol ) { return grammar.accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.cpp b/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.cpp index 50d9a7abb7..c88be3ad16 100644 --- a/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.cpp +++ b/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.cpp @@ -23,7 +23,7 @@ namespace grammar { EpsilonFreeCFG::EpsilonFreeCFG ( alphabet::Symbol initialSymbol ) : EpsilonFreeCFG ( std::set < alphabet::Symbol > { initialSymbol }, std::set < alphabet::Symbol > ( ), initialSymbol ) { } -EpsilonFreeCFG::EpsilonFreeCFG ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components2 < EpsilonFreeCFG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ), generatesEpsilon ( false ) { +EpsilonFreeCFG::EpsilonFreeCFG ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components < EpsilonFreeCFG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ), generatesEpsilon ( false ) { } GrammarBase * EpsilonFreeCFG::clone ( ) const { diff --git a/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.h b/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.h index 867a8d1594..cbaa86f695 100644 --- a/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.h +++ b/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.h @@ -12,7 +12,7 @@ #include "../GrammarBase.h" #include <map> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../../alphabet/Symbol.h" namespace grammar { @@ -24,7 +24,7 @@ class TerminalAlphabet; class NonterminalAlphabet; class InitialSymbol; -class EpsilonFreeCFG : public GrammarBase, public std::Components2 < EpsilonFreeCFG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { +class EpsilonFreeCFG : public GrammarBase, public std::Components < EpsilonFreeCFG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { std::map < alphabet::Symbol, std::set < std::vector < alphabet::Symbol > > > rules; bool generatesEpsilon; @@ -114,7 +114,7 @@ public: namespace std { template < > -class ComponentConstraint2< grammar::EpsilonFreeCFG, alphabet::Symbol, grammar::TerminalAlphabet > { +class ComponentConstraint< grammar::EpsilonFreeCFG, alphabet::Symbol, grammar::TerminalAlphabet > { public: static bool used ( const grammar::EpsilonFreeCFG & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const alphabet::Symbol, std::set < std::vector < alphabet::Symbol > > > & rule : grammar.getRules ( ) ) @@ -136,7 +136,7 @@ public: }; template < > -class ComponentConstraint2< grammar::EpsilonFreeCFG, alphabet::Symbol, grammar::NonterminalAlphabet > { +class ComponentConstraint< grammar::EpsilonFreeCFG, alphabet::Symbol, grammar::NonterminalAlphabet > { public: static bool used ( const grammar::EpsilonFreeCFG & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const alphabet::Symbol, std::set < std::vector < alphabet::Symbol > > > & rule : grammar.getRules ( ) ) { @@ -166,7 +166,7 @@ public: }; template < > -class ElementConstraint2< grammar::EpsilonFreeCFG, alphabet::Symbol, grammar::InitialSymbol > { +class ElementConstraint< grammar::EpsilonFreeCFG, alphabet::Symbol, grammar::InitialSymbol > { public: static bool available ( const grammar::EpsilonFreeCFG & grammar, const alphabet::Symbol & symbol ) { return grammar.accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/grammar/ContextFree/GNF.cpp b/alib2data/src/grammar/ContextFree/GNF.cpp index 70cf0ce64e..9303d442bf 100644 --- a/alib2data/src/grammar/ContextFree/GNF.cpp +++ b/alib2data/src/grammar/ContextFree/GNF.cpp @@ -23,7 +23,7 @@ namespace grammar { GNF::GNF ( alphabet::Symbol initialSymbol ) : GNF ( std::set < alphabet::Symbol > { initialSymbol }, std::set < alphabet::Symbol > ( ), initialSymbol ) { } -GNF::GNF ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components2 < GNF, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ), generatesEpsilon ( false ) { +GNF::GNF ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components < GNF, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ), generatesEpsilon ( false ) { } GrammarBase * GNF::clone ( ) const { diff --git a/alib2data/src/grammar/ContextFree/GNF.h b/alib2data/src/grammar/ContextFree/GNF.h index 3e1bce6405..1fe9c5e927 100644 --- a/alib2data/src/grammar/ContextFree/GNF.h +++ b/alib2data/src/grammar/ContextFree/GNF.h @@ -12,7 +12,7 @@ #include "../GrammarBase.h" #include <map> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../../alphabet/Symbol.h" namespace grammar { @@ -24,7 +24,7 @@ class TerminalAlphabet; class NonterminalAlphabet; class InitialSymbol; -class GNF : public GrammarBase, public std::Components2 < GNF, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { +class GNF : public GrammarBase, public std::Components < GNF, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { std::map < alphabet::Symbol, std::set < std::pair < alphabet::Symbol, std::vector < alphabet::Symbol > > > > rules; bool generatesEpsilon; @@ -115,7 +115,7 @@ public: namespace std { template < > -class ComponentConstraint2< grammar::GNF, alphabet::Symbol, grammar::TerminalAlphabet > { +class ComponentConstraint< grammar::GNF, alphabet::Symbol, grammar::TerminalAlphabet > { public: static bool used ( const grammar::GNF & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const alphabet::Symbol, std::set < std::pair < alphabet::Symbol, std::vector < alphabet::Symbol > > > > & rule : grammar.getRules ( ) ) @@ -137,7 +137,7 @@ public: }; template < > -class ComponentConstraint2< grammar::GNF, alphabet::Symbol, grammar::NonterminalAlphabet > { +class ComponentConstraint< grammar::GNF, alphabet::Symbol, grammar::NonterminalAlphabet > { public: static bool used ( const grammar::GNF & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const alphabet::Symbol, std::set < std::pair < alphabet::Symbol, std::vector < alphabet::Symbol > > > > & rule : grammar.getRules ( ) ) { @@ -166,7 +166,7 @@ public: }; template < > -class ElementConstraint2< grammar::GNF, alphabet::Symbol, grammar::InitialSymbol > { +class ElementConstraint< grammar::GNF, alphabet::Symbol, grammar::InitialSymbol > { public: static bool available ( const grammar::GNF & grammar, const alphabet::Symbol & symbol ) { return grammar.accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/grammar/ContextFree/LG.cpp b/alib2data/src/grammar/ContextFree/LG.cpp index 2a9ca5aa1d..cae483d506 100644 --- a/alib2data/src/grammar/ContextFree/LG.cpp +++ b/alib2data/src/grammar/ContextFree/LG.cpp @@ -23,7 +23,7 @@ namespace grammar { LG::LG ( alphabet::Symbol initialSymbol ) : LG ( std::set < alphabet::Symbol > { initialSymbol }, std::set < alphabet::Symbol > ( ), initialSymbol ) { } -LG::LG ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components2 < LG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ) { +LG::LG ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components < LG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ) { } GrammarBase * LG::clone ( ) const { diff --git a/alib2data/src/grammar/ContextFree/LG.h b/alib2data/src/grammar/ContextFree/LG.h index 81c9d23697..1cdf423590 100644 --- a/alib2data/src/grammar/ContextFree/LG.h +++ b/alib2data/src/grammar/ContextFree/LG.h @@ -14,7 +14,7 @@ #include <tuple> #include <vector> #include <variant> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../../alphabet/Symbol.h" namespace grammar { @@ -26,7 +26,7 @@ class TerminalAlphabet; class NonterminalAlphabet; class InitialSymbol; -class LG : public GrammarBase, public std::Components2 < LG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { +class LG : public GrammarBase, public std::Components < LG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { std::map < alphabet::Symbol, std::set < std::variant < std::vector < alphabet::Symbol >, std::tuple < std::vector < alphabet::Symbol >, alphabet::Symbol, std::vector < alphabet::Symbol > > > > > rules; public: @@ -116,7 +116,7 @@ public: namespace std { template < > -class ComponentConstraint2< grammar::LG, alphabet::Symbol, grammar::TerminalAlphabet > { +class ComponentConstraint< grammar::LG, alphabet::Symbol, grammar::TerminalAlphabet > { public: static bool used ( const grammar::LG & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const alphabet::Symbol, std::set < std::variant < std::vector < alphabet::Symbol >, std::tuple < std::vector < alphabet::Symbol >, alphabet::Symbol, std::vector < alphabet::Symbol > > > > > & rule : grammar.getRules ( ) ) { @@ -156,7 +156,7 @@ public: }; template < > -class ComponentConstraint2< grammar::LG, alphabet::Symbol, grammar::NonterminalAlphabet > { +class ComponentConstraint< grammar::LG, alphabet::Symbol, grammar::NonterminalAlphabet > { public: static bool used ( const grammar::LG & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const alphabet::Symbol, std::set < std::variant < std::vector < alphabet::Symbol >, std::tuple < std::vector < alphabet::Symbol >, alphabet::Symbol, std::vector < alphabet::Symbol > > > > > & rule : grammar.getRules ( ) ) { @@ -190,7 +190,7 @@ public: }; template < > -class ElementConstraint2< grammar::LG, alphabet::Symbol, grammar::InitialSymbol > { +class ElementConstraint< grammar::LG, alphabet::Symbol, grammar::InitialSymbol > { public: static bool available ( const grammar::LG & grammar, const alphabet::Symbol & symbol ) { return grammar.accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/grammar/ContextSensitive/CSG.cpp b/alib2data/src/grammar/ContextSensitive/CSG.cpp index 6850e6633d..8fe4dee715 100644 --- a/alib2data/src/grammar/ContextSensitive/CSG.cpp +++ b/alib2data/src/grammar/ContextSensitive/CSG.cpp @@ -23,7 +23,7 @@ namespace grammar { CSG::CSG ( alphabet::Symbol initialSymbol ) : CSG ( std::set < alphabet::Symbol > { initialSymbol }, std::set < alphabet::Symbol > ( ), initialSymbol ) { } -CSG::CSG ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components2 < CSG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ), generatesEpsilon ( false ) { +CSG::CSG ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components < CSG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ), generatesEpsilon ( false ) { } GrammarBase * CSG::clone ( ) const { diff --git a/alib2data/src/grammar/ContextSensitive/CSG.h b/alib2data/src/grammar/ContextSensitive/CSG.h index 2d99fd2b29..b96a6d063c 100644 --- a/alib2data/src/grammar/ContextSensitive/CSG.h +++ b/alib2data/src/grammar/ContextSensitive/CSG.h @@ -12,7 +12,7 @@ #include "../GrammarBase.h" #include <map> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../../alphabet/Symbol.h" namespace grammar { @@ -24,7 +24,7 @@ class TerminalAlphabet; class NonterminalAlphabet; class InitialSymbol; -class CSG : public GrammarBase, public std::Components2 < CSG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { +class CSG : public GrammarBase, public std::Components < CSG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { std::map < std::tuple < std::vector < alphabet::Symbol >, alphabet::Symbol, std::vector < alphabet::Symbol > >, std::set < std::vector < alphabet::Symbol > > > rules; bool generatesEpsilon; @@ -108,7 +108,7 @@ public: namespace std { template < > -class ComponentConstraint2< grammar::CSG, alphabet::Symbol, grammar::TerminalAlphabet > { +class ComponentConstraint< grammar::CSG, alphabet::Symbol, grammar::TerminalAlphabet > { public: static bool used ( const grammar::CSG & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const std::tuple < std::vector < alphabet::Symbol >, alphabet::Symbol, std::vector < alphabet::Symbol > >, std::set < std::vector < alphabet::Symbol > > > & rule : grammar.getRules ( ) ) { @@ -140,7 +140,7 @@ public: }; template < > -class ComponentConstraint2< grammar::CSG, alphabet::Symbol, grammar::NonterminalAlphabet > { +class ComponentConstraint< grammar::CSG, alphabet::Symbol, grammar::NonterminalAlphabet > { public: static bool used ( const grammar::CSG & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const std::tuple < std::vector < alphabet::Symbol >, alphabet::Symbol, std::vector < alphabet::Symbol > >, std::set < std::vector < alphabet::Symbol > > > & rule : grammar.getRules ( ) ) { @@ -178,7 +178,7 @@ public: }; template < > -class ElementConstraint2< grammar::CSG, alphabet::Symbol, grammar::InitialSymbol > { +class ElementConstraint< grammar::CSG, alphabet::Symbol, grammar::InitialSymbol > { public: static bool available ( const grammar::CSG & grammar, const alphabet::Symbol & symbol ) { return grammar.accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.cpp b/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.cpp index 657814efeb..46454841f5 100644 --- a/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.cpp +++ b/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.cpp @@ -23,7 +23,7 @@ namespace grammar { NonContractingGrammar::NonContractingGrammar ( alphabet::Symbol initialSymbol ) : NonContractingGrammar ( std::set < alphabet::Symbol > { initialSymbol }, std::set < alphabet::Symbol > ( ), initialSymbol ) { } -NonContractingGrammar::NonContractingGrammar ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components2 < NonContractingGrammar, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ), generatesEpsilon ( false ) { +NonContractingGrammar::NonContractingGrammar ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components < NonContractingGrammar, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ), generatesEpsilon ( false ) { } GrammarBase * NonContractingGrammar::clone ( ) const { diff --git a/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.h b/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.h index b7ad2dcab3..193bcb9a76 100644 --- a/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.h +++ b/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.h @@ -12,7 +12,7 @@ #include "../GrammarBase.h" #include <map> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../../alphabet/Symbol.h" namespace grammar { @@ -24,7 +24,7 @@ class TerminalAlphabet; class NonterminalAlphabet; class InitialSymbol; -class NonContractingGrammar : public GrammarBase, public std::Components2 < NonContractingGrammar, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { +class NonContractingGrammar : public GrammarBase, public std::Components < NonContractingGrammar, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { std::map < std::vector < alphabet::Symbol >, std::set < std::vector < alphabet::Symbol > > > rules; bool generatesEpsilon; @@ -108,7 +108,7 @@ public: namespace std { template < > -class ComponentConstraint2< grammar::NonContractingGrammar, alphabet::Symbol, grammar::TerminalAlphabet > { +class ComponentConstraint< grammar::NonContractingGrammar, alphabet::Symbol, grammar::TerminalAlphabet > { public: static bool used ( const grammar::NonContractingGrammar & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const std::vector < alphabet::Symbol >, std::set < std::vector < alphabet::Symbol > > > & rule : grammar.getRules ( ) ) { @@ -135,7 +135,7 @@ public: }; template < > -class ComponentConstraint2< grammar::NonContractingGrammar, alphabet::Symbol, grammar::NonterminalAlphabet > { +class ComponentConstraint< grammar::NonContractingGrammar, alphabet::Symbol, grammar::NonterminalAlphabet > { public: static bool used ( const grammar::NonContractingGrammar & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const std::vector < alphabet::Symbol >, std::set < std::vector < alphabet::Symbol > > > & rule : grammar.getRules ( ) ) { @@ -165,7 +165,7 @@ public: }; template < > -class ElementConstraint2< grammar::NonContractingGrammar, alphabet::Symbol, grammar::InitialSymbol > { +class ElementConstraint< grammar::NonContractingGrammar, alphabet::Symbol, grammar::InitialSymbol > { public: static bool available ( const grammar::NonContractingGrammar & grammar, const alphabet::Symbol & symbol ) { return grammar.accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/grammar/Regular/LeftLG.cpp b/alib2data/src/grammar/Regular/LeftLG.cpp index 0df14e1823..5ba2f4a030 100644 --- a/alib2data/src/grammar/Regular/LeftLG.cpp +++ b/alib2data/src/grammar/Regular/LeftLG.cpp @@ -23,7 +23,7 @@ namespace grammar { LeftLG::LeftLG ( alphabet::Symbol initialSymbol ) : LeftLG ( std::set < alphabet::Symbol > { initialSymbol }, std::set < alphabet::Symbol > ( ), initialSymbol ) { } -LeftLG::LeftLG ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components2 < LeftLG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ) { +LeftLG::LeftLG ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components < LeftLG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ) { } GrammarBase * LeftLG::clone ( ) const { diff --git a/alib2data/src/grammar/Regular/LeftLG.h b/alib2data/src/grammar/Regular/LeftLG.h index 381194ed8e..b28863cd3a 100644 --- a/alib2data/src/grammar/Regular/LeftLG.h +++ b/alib2data/src/grammar/Regular/LeftLG.h @@ -13,7 +13,7 @@ #include <map> #include <vector> #include <variant> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../../alphabet/Symbol.h" namespace grammar { @@ -25,7 +25,7 @@ class TerminalAlphabet; class NonterminalAlphabet; class InitialSymbol; -class LeftLG : public GrammarBase, public std::Components2 < LeftLG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { +class LeftLG : public GrammarBase, public std::Components < LeftLG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { std::map < alphabet::Symbol, std::set < std::variant < std::vector < alphabet::Symbol >, std::pair < alphabet::Symbol, std::vector < alphabet::Symbol > > > > > rules; public: @@ -115,7 +115,7 @@ public: namespace std { template < > -class ComponentConstraint2< grammar::LeftLG, alphabet::Symbol, grammar::TerminalAlphabet > { +class ComponentConstraint< grammar::LeftLG, alphabet::Symbol, grammar::TerminalAlphabet > { public: static bool used ( const grammar::LeftLG & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const alphabet::Symbol, std::set < std::variant < std::vector < alphabet::Symbol >, std::pair < alphabet::Symbol, std::vector < alphabet::Symbol > > > > > & rule : grammar.getRules ( ) ) { @@ -148,7 +148,7 @@ public: }; template < > -class ComponentConstraint2< grammar::LeftLG, alphabet::Symbol, grammar::NonterminalAlphabet > { +class ComponentConstraint< grammar::LeftLG, alphabet::Symbol, grammar::NonterminalAlphabet > { public: static bool used ( const grammar::LeftLG & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const alphabet::Symbol, std::set < std::variant < std::vector < alphabet::Symbol >, std::pair < alphabet::Symbol, std::vector < alphabet::Symbol > > > > > & rule : grammar.getRules ( ) ) { @@ -182,7 +182,7 @@ public: }; template < > -class ElementConstraint2< grammar::LeftLG, alphabet::Symbol, grammar::InitialSymbol > { +class ElementConstraint< grammar::LeftLG, alphabet::Symbol, grammar::InitialSymbol > { public: static bool available ( const grammar::LeftLG & grammar, const alphabet::Symbol & symbol ) { return grammar.accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/grammar/Regular/LeftRG.cpp b/alib2data/src/grammar/Regular/LeftRG.cpp index d375774e96..c40b025c11 100644 --- a/alib2data/src/grammar/Regular/LeftRG.cpp +++ b/alib2data/src/grammar/Regular/LeftRG.cpp @@ -23,7 +23,7 @@ namespace grammar { LeftRG::LeftRG ( alphabet::Symbol initialSymbol ) : LeftRG ( std::set < alphabet::Symbol > { initialSymbol }, std::set < alphabet::Symbol > ( ), initialSymbol ) { } -LeftRG::LeftRG ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components2 < LeftRG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ), generatesEpsilon ( false ) { +LeftRG::LeftRG ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components < LeftRG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ), generatesEpsilon ( false ) { } GrammarBase * LeftRG::clone ( ) const { diff --git a/alib2data/src/grammar/Regular/LeftRG.h b/alib2data/src/grammar/Regular/LeftRG.h index 95f77b0466..8dd093249f 100644 --- a/alib2data/src/grammar/Regular/LeftRG.h +++ b/alib2data/src/grammar/Regular/LeftRG.h @@ -13,7 +13,7 @@ #include <map> #include <vector> #include <variant> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../../alphabet/Symbol.h" namespace grammar { @@ -34,7 +34,7 @@ class TerminalAlphabet; class NonterminalAlphabet; class InitialSymbol; -class LeftRG : public GrammarBase, public std::Components2 < LeftRG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { +class LeftRG : public GrammarBase, public std::Components < LeftRG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { /** * Transition function as mapping from nonterminal symbol on the left hand side to set of either terminal symbols or doublets of terminal symbol and nonterminal symbol */ @@ -193,7 +193,7 @@ public: namespace std { template < > -class ComponentConstraint2< grammar::LeftRG, alphabet::Symbol, grammar::TerminalAlphabet > { +class ComponentConstraint< grammar::LeftRG, alphabet::Symbol, grammar::TerminalAlphabet > { public: static bool used ( const grammar::LeftRG & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const alphabet::Symbol, std::set < std::variant < alphabet::Symbol, std::pair < alphabet::Symbol, alphabet::Symbol > > > > & rule : grammar.getRules ( ) ) @@ -215,7 +215,7 @@ public: }; template < > -class ComponentConstraint2< grammar::LeftRG, alphabet::Symbol, grammar::NonterminalAlphabet > { +class ComponentConstraint< grammar::LeftRG, alphabet::Symbol, grammar::NonterminalAlphabet > { public: static bool used ( const grammar::LeftRG & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const alphabet::Symbol, std::set < std::variant < alphabet::Symbol, std::pair < alphabet::Symbol, alphabet::Symbol > > > > & rule : grammar.getRules ( ) ) { @@ -245,7 +245,7 @@ public: }; template < > -class ElementConstraint2< grammar::LeftRG, alphabet::Symbol, grammar::InitialSymbol > { +class ElementConstraint< grammar::LeftRG, alphabet::Symbol, grammar::InitialSymbol > { public: static bool available ( const grammar::LeftRG & grammar, const alphabet::Symbol & symbol ) { return grammar.accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/grammar/Regular/RightLG.cpp b/alib2data/src/grammar/Regular/RightLG.cpp index 4ea483bcad..6feeae791a 100644 --- a/alib2data/src/grammar/Regular/RightLG.cpp +++ b/alib2data/src/grammar/Regular/RightLG.cpp @@ -23,7 +23,7 @@ namespace grammar { RightLG::RightLG ( alphabet::Symbol initialSymbol ) : RightLG ( std::set < alphabet::Symbol > { initialSymbol }, std::set < alphabet::Symbol > ( ), initialSymbol ) { } -RightLG::RightLG ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components2 < RightLG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ) { +RightLG::RightLG ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components < RightLG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ) { } GrammarBase * RightLG::clone ( ) const { diff --git a/alib2data/src/grammar/Regular/RightLG.h b/alib2data/src/grammar/Regular/RightLG.h index 506ef62762..6378cc9205 100644 --- a/alib2data/src/grammar/Regular/RightLG.h +++ b/alib2data/src/grammar/Regular/RightLG.h @@ -13,7 +13,7 @@ #include <map> #include <vector> #include <variant> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../../alphabet/Symbol.h" namespace grammar { @@ -25,7 +25,7 @@ class TerminalAlphabet; class NonterminalAlphabet; class InitialSymbol; -class RightLG : public GrammarBase, public std::Components2 < RightLG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { +class RightLG : public GrammarBase, public std::Components < RightLG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { std::map < alphabet::Symbol, std::set < std::variant < std::vector < alphabet::Symbol >, std::pair < std::vector < alphabet::Symbol >, alphabet::Symbol > > > > rules; public: @@ -115,7 +115,7 @@ public: namespace std { template < > -class ComponentConstraint2< grammar::RightLG, alphabet::Symbol, grammar::TerminalAlphabet > { +class ComponentConstraint< grammar::RightLG, alphabet::Symbol, grammar::TerminalAlphabet > { public: static bool used ( const grammar::RightLG & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const alphabet::Symbol, std::set < std::variant < std::vector < alphabet::Symbol >, std::pair < std::vector < alphabet::Symbol >, alphabet::Symbol > > > > & rule : grammar.getRules ( ) ) { @@ -148,7 +148,7 @@ public: }; template < > -class ComponentConstraint2< grammar::RightLG, alphabet::Symbol, grammar::NonterminalAlphabet > { +class ComponentConstraint< grammar::RightLG, alphabet::Symbol, grammar::NonterminalAlphabet > { public: static bool used ( const grammar::RightLG & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const alphabet::Symbol, std::set < std::variant < std::vector < alphabet::Symbol >, std::pair < std::vector < alphabet::Symbol >, alphabet::Symbol > > > > & rule : grammar.getRules ( ) ) { @@ -182,7 +182,7 @@ public: }; template < > -class ElementConstraint2< grammar::RightLG, alphabet::Symbol, grammar::InitialSymbol > { +class ElementConstraint< grammar::RightLG, alphabet::Symbol, grammar::InitialSymbol > { public: static bool available ( const grammar::RightLG & grammar, const alphabet::Symbol & symbol ) { return grammar.accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/grammar/Regular/RightRG.cpp b/alib2data/src/grammar/Regular/RightRG.cpp index 74aae42385..e7bfcce486 100644 --- a/alib2data/src/grammar/Regular/RightRG.cpp +++ b/alib2data/src/grammar/Regular/RightRG.cpp @@ -23,7 +23,7 @@ namespace grammar { RightRG::RightRG ( alphabet::Symbol initialSymbol ) : RightRG ( std::set < alphabet::Symbol > { initialSymbol }, std::set < alphabet::Symbol > ( ), initialSymbol ) { } -RightRG::RightRG ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components2 < RightRG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ), generatesEpsilon ( false ) { +RightRG::RightRG ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components < RightRG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ), generatesEpsilon ( false ) { } GrammarBase * RightRG::clone ( ) const { diff --git a/alib2data/src/grammar/Regular/RightRG.h b/alib2data/src/grammar/Regular/RightRG.h index 2b1d3fd0d6..91266d568b 100644 --- a/alib2data/src/grammar/Regular/RightRG.h +++ b/alib2data/src/grammar/Regular/RightRG.h @@ -13,7 +13,7 @@ #include <map> #include <vector> #include <variant> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../../alphabet/Symbol.h" namespace grammar { @@ -35,7 +35,7 @@ class TerminalAlphabet; class NonterminalAlphabet; class InitialSymbol; -class RightRG : public GrammarBase, public std::Components2 < RightRG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { +class RightRG : public GrammarBase, public std::Components < RightRG, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { /** * Transition function as mapping from nonterminal symbol on the left hand side to set of either terminal symbols or doublets of terminal symbol and nonterminal symbol */ @@ -136,7 +136,7 @@ public: namespace std { template < > -class ComponentConstraint2< grammar::RightRG, alphabet::Symbol, grammar::TerminalAlphabet > { +class ComponentConstraint< grammar::RightRG, alphabet::Symbol, grammar::TerminalAlphabet > { public: static bool used ( const grammar::RightRG & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const alphabet::Symbol, std::set < std::variant < alphabet::Symbol, std::pair < alphabet::Symbol, alphabet::Symbol > > > > & rule : grammar.getRules ( ) ) @@ -158,7 +158,7 @@ public: }; template < > -class ComponentConstraint2< grammar::RightRG, alphabet::Symbol, grammar::NonterminalAlphabet > { +class ComponentConstraint< grammar::RightRG, alphabet::Symbol, grammar::NonterminalAlphabet > { public: static bool used ( const grammar::RightRG & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const alphabet::Symbol, std::set < std::variant < alphabet::Symbol, std::pair < alphabet::Symbol, alphabet::Symbol > > > > & rule : grammar.getRules ( ) ) { @@ -188,7 +188,7 @@ public: }; template < > -class ElementConstraint2< grammar::RightRG, alphabet::Symbol, grammar::InitialSymbol > { +class ElementConstraint< grammar::RightRG, alphabet::Symbol, grammar::InitialSymbol > { public: static bool available ( const grammar::RightRG & grammar, const alphabet::Symbol & symbol ) { return grammar.accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.cpp b/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.cpp index 2c4894380e..6a7ca1e3e9 100644 --- a/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.cpp +++ b/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.cpp @@ -23,7 +23,7 @@ namespace grammar { ContextPreservingUnrestrictedGrammar::ContextPreservingUnrestrictedGrammar ( alphabet::Symbol initialSymbol ) : ContextPreservingUnrestrictedGrammar ( std::set < alphabet::Symbol > { initialSymbol }, std::set < alphabet::Symbol > ( ), initialSymbol ) { } -ContextPreservingUnrestrictedGrammar::ContextPreservingUnrestrictedGrammar ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components2 < ContextPreservingUnrestrictedGrammar, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ) { +ContextPreservingUnrestrictedGrammar::ContextPreservingUnrestrictedGrammar ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components < ContextPreservingUnrestrictedGrammar, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ) { } GrammarBase * ContextPreservingUnrestrictedGrammar::clone ( ) const { diff --git a/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.h b/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.h index 16fe602376..f9b8972129 100644 --- a/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.h +++ b/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.h @@ -12,7 +12,7 @@ #include "../GrammarBase.h" #include <map> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../../alphabet/Symbol.h" namespace grammar { @@ -24,7 +24,7 @@ class TerminalAlphabet; class NonterminalAlphabet; class InitialSymbol; -class ContextPreservingUnrestrictedGrammar : public GrammarBase, public std::Components2 < ContextPreservingUnrestrictedGrammar, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { +class ContextPreservingUnrestrictedGrammar : public GrammarBase, public std::Components < ContextPreservingUnrestrictedGrammar, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { std::map < std::tuple < std::vector < alphabet::Symbol >, alphabet::Symbol, std::vector < alphabet::Symbol > >, std::set < std::vector < alphabet::Symbol > > > rules; public: @@ -104,7 +104,7 @@ public: namespace std { template < > -class ComponentConstraint2< grammar::ContextPreservingUnrestrictedGrammar, alphabet::Symbol, grammar::TerminalAlphabet > { +class ComponentConstraint< grammar::ContextPreservingUnrestrictedGrammar, alphabet::Symbol, grammar::TerminalAlphabet > { public: static bool used ( const grammar::ContextPreservingUnrestrictedGrammar & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const std::tuple < std::vector < alphabet::Symbol >, alphabet::Symbol, std::vector < alphabet::Symbol > >, std::set < std::vector < alphabet::Symbol > > > & rule : grammar.getRules ( ) ) { @@ -136,7 +136,7 @@ public: }; template < > -class ComponentConstraint2< grammar::ContextPreservingUnrestrictedGrammar, alphabet::Symbol, grammar::NonterminalAlphabet > { +class ComponentConstraint< grammar::ContextPreservingUnrestrictedGrammar, alphabet::Symbol, grammar::NonterminalAlphabet > { public: static bool used ( const grammar::ContextPreservingUnrestrictedGrammar & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const std::tuple < std::vector < alphabet::Symbol >, alphabet::Symbol, std::vector < alphabet::Symbol > >, std::set < std::vector < alphabet::Symbol > > > & rule : grammar.getRules ( ) ) { @@ -174,7 +174,7 @@ public: }; template < > -class ElementConstraint2< grammar::ContextPreservingUnrestrictedGrammar, alphabet::Symbol, grammar::InitialSymbol > { +class ElementConstraint< grammar::ContextPreservingUnrestrictedGrammar, alphabet::Symbol, grammar::InitialSymbol > { public: static bool available ( const grammar::ContextPreservingUnrestrictedGrammar & grammar, const alphabet::Symbol & symbol ) { return grammar.accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.cpp b/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.cpp index 33257a25ff..9679cfcee1 100644 --- a/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.cpp +++ b/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.cpp @@ -23,7 +23,7 @@ namespace grammar { UnrestrictedGrammar::UnrestrictedGrammar ( alphabet::Symbol initialSymbol ) : UnrestrictedGrammar ( std::set < alphabet::Symbol > { initialSymbol }, std::set < alphabet::Symbol > ( ), initialSymbol ) { } -UnrestrictedGrammar::UnrestrictedGrammar ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components2 < UnrestrictedGrammar, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ) { +UnrestrictedGrammar::UnrestrictedGrammar ( std::set < alphabet::Symbol > nonterminalAlphabet, std::set < alphabet::Symbol > terminalAlphabet, alphabet::Symbol initialSymbol ) : std::Components < UnrestrictedGrammar, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > ( std::make_tuple ( std::move ( terminalAlphabet ), std::move ( nonterminalAlphabet ) ), std::make_tuple ( std::move ( initialSymbol ) ) ) { } GrammarBase * UnrestrictedGrammar::clone ( ) const { diff --git a/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.h b/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.h index 2ae172e00e..e42fd147d3 100644 --- a/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.h +++ b/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.h @@ -12,7 +12,7 @@ #include "../GrammarBase.h" #include <map> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../../alphabet/Symbol.h" namespace grammar { @@ -24,7 +24,7 @@ class TerminalAlphabet; class NonterminalAlphabet; class InitialSymbol; -class UnrestrictedGrammar : public GrammarBase, public std::Components2 < UnrestrictedGrammar, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { +class UnrestrictedGrammar : public GrammarBase, public std::Components < UnrestrictedGrammar, alphabet::Symbol, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { std::map < std::vector < alphabet::Symbol >, std::set < std::vector < alphabet::Symbol > > > rules; public: @@ -104,7 +104,7 @@ public: namespace std { template < > -class ComponentConstraint2< grammar::UnrestrictedGrammar, alphabet::Symbol, grammar::TerminalAlphabet > { +class ComponentConstraint< grammar::UnrestrictedGrammar, alphabet::Symbol, grammar::TerminalAlphabet > { public: static bool used ( const grammar::UnrestrictedGrammar & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const std::vector < alphabet::Symbol >, std::set < std::vector < alphabet::Symbol > > > & rule : grammar.getRules ( ) ) { @@ -131,7 +131,7 @@ public: }; template < > -class ComponentConstraint2< grammar::UnrestrictedGrammar, alphabet::Symbol, grammar::NonterminalAlphabet > { +class ComponentConstraint< grammar::UnrestrictedGrammar, alphabet::Symbol, grammar::NonterminalAlphabet > { public: static bool used ( const grammar::UnrestrictedGrammar & grammar, const alphabet::Symbol & symbol ) { for ( const std::pair < const std::vector < alphabet::Symbol >, std::set < std::vector < alphabet::Symbol > > > & rule : grammar.getRules ( ) ) { @@ -161,7 +161,7 @@ public: }; template < > -class ElementConstraint2< grammar::UnrestrictedGrammar, alphabet::Symbol, grammar::InitialSymbol > { +class ElementConstraint< grammar::UnrestrictedGrammar, alphabet::Symbol, grammar::InitialSymbol > { public: static bool available ( const grammar::UnrestrictedGrammar & grammar, const alphabet::Symbol & symbol ) { return grammar.accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/indexes/suffixTrie/SuffixTrieFinalMark.cpp b/alib2data/src/indexes/suffixTrie/SuffixTrieFinalMark.cpp index 1bed73e922..1253d4181e 100644 --- a/alib2data/src/indexes/suffixTrie/SuffixTrieFinalMark.cpp +++ b/alib2data/src/indexes/suffixTrie/SuffixTrieFinalMark.cpp @@ -24,23 +24,23 @@ namespace indexes { SuffixTrieFinalMark::SuffixTrieFinalMark ( std::set < alphabet::Symbol > alphabet ) : SuffixTrieFinalMark ( std::move ( alphabet ), SuffixTrieNodeFinalMark ( { }, true ) ) { } -SuffixTrieFinalMark::SuffixTrieFinalMark ( std::set < alphabet::Symbol > alphabet, SuffixTrieNodeFinalMark tree ) : std::Components2 < SuffixTrieFinalMark, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ), tree ( NULL ) { +SuffixTrieFinalMark::SuffixTrieFinalMark ( std::set < alphabet::Symbol > alphabet, SuffixTrieNodeFinalMark tree ) : std::Components < SuffixTrieFinalMark, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ), tree ( NULL ) { setTree ( std::move ( tree ) ); } SuffixTrieFinalMark::SuffixTrieFinalMark ( SuffixTrieNodeFinalMark tree ) : SuffixTrieFinalMark ( tree.computeMinimalAlphabet ( ), tree ) { } -SuffixTrieFinalMark::SuffixTrieFinalMark ( const SuffixTrieTerminatingSymbol & other ) : std::Components2 < SuffixTrieFinalMark, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( other.getAlphabet ( ) ), std::tuple < > ( ) ), tree ( NULL ) { +SuffixTrieFinalMark::SuffixTrieFinalMark ( const SuffixTrieTerminatingSymbol & other ) : std::Components < SuffixTrieFinalMark, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( other.getAlphabet ( ) ), std::tuple < > ( ) ), tree ( NULL ) { this->accessComponent < GeneralAlphabet > ( ).remove ( other.accessElement < TerminatingSymbol > ( ).get ( ) ); setTree ( SuffixTrieNodeFinalMark ( other.getRoot ( ), other.accessElement < TerminatingSymbol > ( ).get ( ) ) ); } -SuffixTrieFinalMark::SuffixTrieFinalMark ( const SuffixTrieFinalMark & other ) : std::Components2 < SuffixTrieFinalMark, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( other.getAlphabet ( ) ), std::tuple < > ( ) ), tree ( other.tree->clone ( ) ) { +SuffixTrieFinalMark::SuffixTrieFinalMark ( const SuffixTrieFinalMark & other ) : std::Components < SuffixTrieFinalMark, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( other.getAlphabet ( ) ), std::tuple < > ( ) ), tree ( other.tree->clone ( ) ) { this->tree->attachTree ( this ); } -SuffixTrieFinalMark::SuffixTrieFinalMark ( SuffixTrieFinalMark && other ) noexcept : std::Components2 < SuffixTrieFinalMark, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( other.accessComponent < GeneralAlphabet > ( ).get ( ) ) ), std::tuple < > ( ) ), tree ( other.tree ) { +SuffixTrieFinalMark::SuffixTrieFinalMark ( SuffixTrieFinalMark && other ) noexcept : std::Components < SuffixTrieFinalMark, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( other.accessComponent < GeneralAlphabet > ( ).get ( ) ) ), std::tuple < > ( ) ), tree ( other.tree ) { this->tree->attachTree ( this ); other.tree = NULL; } diff --git a/alib2data/src/indexes/suffixTrie/SuffixTrieFinalMark.h b/alib2data/src/indexes/suffixTrie/SuffixTrieFinalMark.h index 0d6740120b..b36af5d782 100644 --- a/alib2data/src/indexes/suffixTrie/SuffixTrieFinalMark.h +++ b/alib2data/src/indexes/suffixTrie/SuffixTrieFinalMark.h @@ -12,7 +12,7 @@ #include <list> #include <string> #include <set> -#include <core/components2.hpp> +#include <core/components.hpp> #include "SuffixTrieNodeFinalMark.h" #include <object/ObjectBase.h> @@ -25,7 +25,7 @@ class GeneralAlphabet; * Represents regular expression parsed from the XML. Regular expression is stored * as a tree of RegExpElement. */ -class SuffixTrieFinalMark : public alib::ObjectBase, public std::Components2 < SuffixTrieFinalMark, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > { +class SuffixTrieFinalMark : public alib::ObjectBase, public std::Components < SuffixTrieFinalMark, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > { protected: SuffixTrieNodeFinalMark * tree; @@ -117,7 +117,7 @@ public: namespace std { template < > -class ComponentConstraint2< indexes::SuffixTrieFinalMark, alphabet::Symbol, indexes::GeneralAlphabet > { +class ComponentConstraint< indexes::SuffixTrieFinalMark, alphabet::Symbol, indexes::GeneralAlphabet > { public: static bool used ( const indexes::SuffixTrieFinalMark & index, const alphabet::Symbol & symbol ) { return index.getRoot ( ).testSymbol ( symbol ); diff --git a/alib2data/src/indexes/suffixTrie/SuffixTrieTerminatingSymbol.cpp b/alib2data/src/indexes/suffixTrie/SuffixTrieTerminatingSymbol.cpp index 224f858ac1..79f305d011 100644 --- a/alib2data/src/indexes/suffixTrie/SuffixTrieTerminatingSymbol.cpp +++ b/alib2data/src/indexes/suffixTrie/SuffixTrieTerminatingSymbol.cpp @@ -23,18 +23,18 @@ namespace indexes { SuffixTrieTerminatingSymbol::SuffixTrieTerminatingSymbol ( std::set < alphabet::Symbol > alphabet, alphabet::Symbol terminatingSymbol ) : SuffixTrieTerminatingSymbol ( std::move ( alphabet ), std::move ( terminatingSymbol ), SuffixTrieNodeTerminatingSymbol ( { } ) ) { } -SuffixTrieTerminatingSymbol::SuffixTrieTerminatingSymbol ( std::set < alphabet::Symbol > alphabet, alphabet::Symbol terminatingSymbol, SuffixTrieNodeTerminatingSymbol tree ) : std::Components2 < SuffixTrieTerminatingSymbol, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < TerminatingSymbol > > ( std::make_tuple ( std::move ( alphabet ) ), std::make_tuple ( std::move ( terminatingSymbol ) ) ), tree ( NULL ) { +SuffixTrieTerminatingSymbol::SuffixTrieTerminatingSymbol ( std::set < alphabet::Symbol > alphabet, alphabet::Symbol terminatingSymbol, SuffixTrieNodeTerminatingSymbol tree ) : std::Components < SuffixTrieTerminatingSymbol, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < TerminatingSymbol > > ( std::make_tuple ( std::move ( alphabet ) ), std::make_tuple ( std::move ( terminatingSymbol ) ) ), tree ( NULL ) { setTree ( std::move ( tree ) ); } SuffixTrieTerminatingSymbol::SuffixTrieTerminatingSymbol ( alphabet::Symbol terminatingSymbol, SuffixTrieNodeTerminatingSymbol tree ) : SuffixTrieTerminatingSymbol ( tree.computeMinimalAlphabet ( ) + std::set < alphabet::Symbol > { terminatingSymbol }, terminatingSymbol, tree ) { } -SuffixTrieTerminatingSymbol::SuffixTrieTerminatingSymbol ( const SuffixTrieTerminatingSymbol & other ) : std::Components2 < SuffixTrieTerminatingSymbol, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < TerminatingSymbol > > ( std::make_tuple ( other.getAlphabet ( ) ), std::make_tuple ( other.getTerminatingSymbol ( ) ) ), tree ( other.tree->clone ( ) ) { +SuffixTrieTerminatingSymbol::SuffixTrieTerminatingSymbol ( const SuffixTrieTerminatingSymbol & other ) : std::Components < SuffixTrieTerminatingSymbol, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < TerminatingSymbol > > ( std::make_tuple ( other.getAlphabet ( ) ), std::make_tuple ( other.getTerminatingSymbol ( ) ) ), tree ( other.tree->clone ( ) ) { this->tree->attachTree ( this ); } -SuffixTrieTerminatingSymbol::SuffixTrieTerminatingSymbol ( SuffixTrieTerminatingSymbol && other ) noexcept : std::Components2 < SuffixTrieTerminatingSymbol, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < TerminatingSymbol > > ( std::make_tuple ( std::move ( other.accessComponent < GeneralAlphabet > ( ).get ( ) ) ), std::make_tuple ( std::move ( other.accessElement < TerminatingSymbol > ( ).get ( ) ) ) ), tree ( other.tree ) { +SuffixTrieTerminatingSymbol::SuffixTrieTerminatingSymbol ( SuffixTrieTerminatingSymbol && other ) noexcept : std::Components < SuffixTrieTerminatingSymbol, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < TerminatingSymbol > > ( std::make_tuple ( std::move ( other.accessComponent < GeneralAlphabet > ( ).get ( ) ) ), std::make_tuple ( std::move ( other.accessElement < TerminatingSymbol > ( ).get ( ) ) ) ), tree ( other.tree ) { this->tree->attachTree ( this ); other.tree = NULL; } diff --git a/alib2data/src/indexes/suffixTrie/SuffixTrieTerminatingSymbol.h b/alib2data/src/indexes/suffixTrie/SuffixTrieTerminatingSymbol.h index b3113b70a4..80973e7880 100644 --- a/alib2data/src/indexes/suffixTrie/SuffixTrieTerminatingSymbol.h +++ b/alib2data/src/indexes/suffixTrie/SuffixTrieTerminatingSymbol.h @@ -12,7 +12,7 @@ #include <list> #include <string> #include <set> -#include <core/components2.hpp> +#include <core/components.hpp> #include "SuffixTrieNodeTerminatingSymbol.h" #include <object/ObjectBase.h> @@ -25,7 +25,7 @@ class TerminatingSymbol; * Represents regular expression parsed from the XML. Regular expression is stored * as a tree of RegExpElement. */ -class SuffixTrieTerminatingSymbol : public alib::ObjectBase, public std::Components2 < SuffixTrieTerminatingSymbol, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < TerminatingSymbol > > { +class SuffixTrieTerminatingSymbol : public alib::ObjectBase, public std::Components < SuffixTrieTerminatingSymbol, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < TerminatingSymbol > > { protected: SuffixTrieNodeTerminatingSymbol * tree; @@ -113,7 +113,7 @@ public: namespace std { template < > -class ComponentConstraint2< indexes::SuffixTrieTerminatingSymbol, alphabet::Symbol, indexes::GeneralAlphabet > { +class ComponentConstraint< indexes::SuffixTrieTerminatingSymbol, alphabet::Symbol, indexes::GeneralAlphabet > { public: static bool used ( const indexes::SuffixTrieTerminatingSymbol & index, const alphabet::Symbol & symbol ) { return index.getTerminatingSymbol ( ) == symbol || index.getRoot ( ).testSymbol ( symbol ); @@ -128,7 +128,7 @@ public: }; template < > -class ElementConstraint2< indexes::SuffixTrieTerminatingSymbol, alphabet::Symbol, indexes::TerminatingSymbol > { +class ElementConstraint< indexes::SuffixTrieTerminatingSymbol, alphabet::Symbol, indexes::TerminatingSymbol > { public: static bool available ( const indexes::SuffixTrieTerminatingSymbol & index, const alphabet::Symbol & symbol ) { return index.getAlphabet ( ).count ( symbol ); diff --git a/alib2data/src/regexp/formal/FormalRegExp.cpp b/alib2data/src/regexp/formal/FormalRegExp.cpp index 812d5a592f..07cd85e215 100644 --- a/alib2data/src/regexp/formal/FormalRegExp.cpp +++ b/alib2data/src/regexp/formal/FormalRegExp.cpp @@ -25,7 +25,7 @@ namespace regexp { -FormalRegExp::FormalRegExp ( std::set < alphabet::Symbol > alphabet, FormalRegExpElement && regExp ) : std::Components2 < FormalRegExp, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ), regExp ( NULL ) { +FormalRegExp::FormalRegExp ( std::set < alphabet::Symbol > alphabet, FormalRegExpElement && regExp ) : std::Components < FormalRegExp, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ), regExp ( NULL ) { setRegExp ( std::move ( regExp ) ); } diff --git a/alib2data/src/regexp/formal/FormalRegExp.h b/alib2data/src/regexp/formal/FormalRegExp.h index 038dc6db5f..3d67488551 100644 --- a/alib2data/src/regexp/formal/FormalRegExp.h +++ b/alib2data/src/regexp/formal/FormalRegExp.h @@ -10,7 +10,7 @@ #include <string> #include <set> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../RegExpBase.h" #include "FormalRegExpElement.h" @@ -25,7 +25,7 @@ class GeneralAlphabet; * Represents regular expression parsed from the XML. Regular expression is stored * as a tree of RegExpElement. */ -class FormalRegExp : public RegExpBase, public std::Components2 < FormalRegExp, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > { +class FormalRegExp : public RegExpBase, public std::Components < FormalRegExp, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > { protected: std::smart_ptr < FormalRegExpElement > regExp; @@ -102,7 +102,7 @@ public: namespace std { template < > -class ComponentConstraint2< regexp::FormalRegExp, alphabet::Symbol, regexp::GeneralAlphabet > { +class ComponentConstraint< regexp::FormalRegExp, alphabet::Symbol, regexp::GeneralAlphabet > { public: static bool used ( const regexp::FormalRegExp & regexp, const alphabet::Symbol & symbol ) { return regexp.getRegExp ( ).testSymbol ( symbol ); diff --git a/alib2data/src/regexp/unbounded/UnboundedRegExp.cpp b/alib2data/src/regexp/unbounded/UnboundedRegExp.cpp index f8053212a0..9e5fb8c196 100644 --- a/alib2data/src/regexp/unbounded/UnboundedRegExp.cpp +++ b/alib2data/src/regexp/unbounded/UnboundedRegExp.cpp @@ -25,7 +25,7 @@ namespace regexp { -UnboundedRegExp::UnboundedRegExp ( std::set < alphabet::Symbol > alphabet, UnboundedRegExpElement && regExp ) : std::Components2 < UnboundedRegExp, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ), regExp ( NULL ) { +UnboundedRegExp::UnboundedRegExp ( std::set < alphabet::Symbol > alphabet, UnboundedRegExpElement && regExp ) : std::Components < UnboundedRegExp, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ), regExp ( NULL ) { setRegExp ( std::move ( regExp ) ); } diff --git a/alib2data/src/regexp/unbounded/UnboundedRegExp.h b/alib2data/src/regexp/unbounded/UnboundedRegExp.h index a8fd792931..ec015f73e4 100644 --- a/alib2data/src/regexp/unbounded/UnboundedRegExp.h +++ b/alib2data/src/regexp/unbounded/UnboundedRegExp.h @@ -10,7 +10,7 @@ #include <string> #include <set> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../RegExpBase.h" #include "UnboundedRegExpElement.h" @@ -25,7 +25,7 @@ class GeneralAlphabet; * Represents regular expression parsed from the XML. Regular expression is stored * as a tree of RegExpElement. */ -class UnboundedRegExp : public RegExpBase, public std::Components2 < UnboundedRegExp, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > { +class UnboundedRegExp : public RegExpBase, public std::Components < UnboundedRegExp, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > { protected: std::smart_ptr < UnboundedRegExpElement > regExp; @@ -102,7 +102,7 @@ public: namespace std { template < > -class ComponentConstraint2< regexp::UnboundedRegExp, alphabet::Symbol, regexp::GeneralAlphabet > { +class ComponentConstraint< regexp::UnboundedRegExp, alphabet::Symbol, regexp::GeneralAlphabet > { public: static bool used ( const regexp::UnboundedRegExp & regexp, const alphabet::Symbol & symbol ) { return regexp.getRegExp ( ).testSymbol ( symbol ); diff --git a/alib2data/src/rte/formal/FormalRTE.cpp b/alib2data/src/rte/formal/FormalRTE.cpp index 15a944696a..75e8fd7b58 100644 --- a/alib2data/src/rte/formal/FormalRTE.cpp +++ b/alib2data/src/rte/formal/FormalRTE.cpp @@ -18,7 +18,7 @@ namespace rte { -FormalRTE::FormalRTE ( std::set < alphabet::RankedSymbol > alphabetF, std::set < alphabet::RankedSymbol > alphabetK, FormalRTEElement && rte ) : std::Components2 < FormalRTE, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, ConstantAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabetF ), std::move ( alphabetK ) ), std::tuple < > ( ) ), rte ( NULL ) { +FormalRTE::FormalRTE ( std::set < alphabet::RankedSymbol > alphabetF, std::set < alphabet::RankedSymbol > alphabetK, FormalRTEElement && rte ) : std::Components < FormalRTE, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, ConstantAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabetF ), std::move ( alphabetK ) ), std::tuple < > ( ) ), rte ( NULL ) { setRTE ( std::move ( rte ) ); } @@ -50,11 +50,11 @@ FormalRTE::FormalRTE ( const FormalRTEElement & rte ) : FormalRTE ( rte.computeM FormalRTE::FormalRTE ( FormalRTEElement && rte ) : FormalRTE ( rte.computeMinimalAlphabets ( ), rte ) { } -FormalRTE::FormalRTE ( const FormalRTE & other ) : std::Components2 < FormalRTE, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, ConstantAlphabet >, std::tuple < > > ( std::make_tuple ( other.getAlphabet ( ), other.getConstantAlphabet ( ) ), std::tuple < > ( ) ), rte ( other.rte ) { +FormalRTE::FormalRTE ( const FormalRTE & other ) : std::Components < FormalRTE, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, ConstantAlphabet >, std::tuple < > > ( std::make_tuple ( other.getAlphabet ( ), other.getConstantAlphabet ( ) ), std::tuple < > ( ) ), rte ( other.rte ) { this->rte->attachRTE ( this ); } -FormalRTE::FormalRTE ( FormalRTE && other ) noexcept : std::Components2 < FormalRTE, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, ConstantAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( other.accessComponent < GeneralAlphabet > ( ).get ( ) ), std::move ( other.accessComponent < ConstantAlphabet > ( ).get ( ) ) ), std::tuple < > ( ) ), rte ( std::move ( other.rte ) ) { +FormalRTE::FormalRTE ( FormalRTE && other ) noexcept : std::Components < FormalRTE, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, ConstantAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( other.accessComponent < GeneralAlphabet > ( ).get ( ) ), std::move ( other.accessComponent < ConstantAlphabet > ( ).get ( ) ) ), std::tuple < > ( ) ), rte ( std::move ( other.rte ) ) { this->rte->attachRTE ( this ); } diff --git a/alib2data/src/rte/formal/FormalRTE.h b/alib2data/src/rte/formal/FormalRTE.h index a2fbdeeb26..a66482ef98 100644 --- a/alib2data/src/rte/formal/FormalRTE.h +++ b/alib2data/src/rte/formal/FormalRTE.h @@ -6,7 +6,7 @@ #include <exception/CommonException.h> #include "FormalRTEElement.h" #include "../RTEBase.h" -#include <core/components2.hpp> +#include <core/components.hpp> namespace rte { @@ -20,7 +20,7 @@ class ConstantAlphabet; * Represents regular tree expression parsed from the XML. Regular tree expression is stored * as a tree of RTEElement elements. */ -class FormalRTE : public RTEBase, public std::Components2 < FormalRTE, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, ConstantAlphabet >, std::tuple < > > { +class FormalRTE : public RTEBase, public std::Components < FormalRTE, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, ConstantAlphabet >, std::tuple < > > { protected: std::smart_ptr < FormalRTEElement > rte; @@ -150,7 +150,7 @@ public: namespace std { template < > -class ComponentConstraint2< rte::FormalRTE, alphabet::RankedSymbol, rte::GeneralAlphabet > { +class ComponentConstraint< rte::FormalRTE, alphabet::RankedSymbol, rte::GeneralAlphabet > { public: static bool used ( const rte::FormalRTE & rte, const alphabet::RankedSymbol & symbol ) { return rte.getRTE ( ).testSymbol ( symbol ); @@ -167,7 +167,7 @@ public: }; template < > -class ComponentConstraint2< rte::FormalRTE, alphabet::RankedSymbol, rte::ConstantAlphabet > { +class ComponentConstraint< rte::FormalRTE, alphabet::RankedSymbol, rte::ConstantAlphabet > { public: static bool used ( const rte::FormalRTE & rte, const alphabet::RankedSymbol & symbol ) { return rte.getRTE ( ).testSymbol ( symbol ); diff --git a/alib2data/src/string/CyclicString.cpp b/alib2data/src/string/CyclicString.cpp index 447759ae47..12b248dd73 100644 --- a/alib2data/src/string/CyclicString.cpp +++ b/alib2data/src/string/CyclicString.cpp @@ -23,7 +23,7 @@ namespace string { -CyclicString::CyclicString(std::set<alphabet::Symbol> alphabet, std::vector<alphabet::Symbol> data) : std::Components2 < CyclicString, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ) { +CyclicString::CyclicString(std::set<alphabet::Symbol> alphabet, std::vector<alphabet::Symbol> data) : std::Components < CyclicString, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ) { setContent(std::move(data)); } diff --git a/alib2data/src/string/CyclicString.h b/alib2data/src/string/CyclicString.h index 907e97ca8c..caa139bec5 100644 --- a/alib2data/src/string/CyclicString.h +++ b/alib2data/src/string/CyclicString.h @@ -13,7 +13,7 @@ #include <vector> #include "../alphabet/Symbol.h" -#include <core/components2.hpp> +#include <core/components.hpp> namespace string { @@ -24,7 +24,7 @@ class GeneralAlphabet; * Represents regular expression parsed from the XML. Regular expression is stored * as a tree of CyclicStringElement. */ -class CyclicString : public StringBase, public std::Components2 < CyclicString, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > { +class CyclicString : public StringBase, public std::Components < CyclicString, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > { std::vector < alphabet::Symbol > m_Data; public: @@ -86,7 +86,7 @@ public: namespace std { template < > -class ComponentConstraint2< ::string::CyclicString, alphabet::Symbol, ::string::GeneralAlphabet > { +class ComponentConstraint< ::string::CyclicString, alphabet::Symbol, ::string::GeneralAlphabet > { public: static bool used ( const ::string::CyclicString & string, const alphabet::Symbol & symbol ) { const std::vector<alphabet::Symbol>& content = string.getContent ( ); diff --git a/alib2data/src/string/Epsilon.cpp b/alib2data/src/string/Epsilon.cpp index c7022f7fa7..826b925788 100644 --- a/alib2data/src/string/Epsilon.cpp +++ b/alib2data/src/string/Epsilon.cpp @@ -16,7 +16,7 @@ namespace string { -Epsilon::Epsilon(std::set<alphabet::Symbol> alphabet) : std::Components2 < Epsilon, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ) { +Epsilon::Epsilon(std::set<alphabet::Symbol> alphabet) : std::Components < Epsilon, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ) { } Epsilon::Epsilon() : Epsilon ( std::set< alphabet::Symbol > ( ) ) { diff --git a/alib2data/src/string/Epsilon.h b/alib2data/src/string/Epsilon.h index ede29924e8..91568e8c9c 100644 --- a/alib2data/src/string/Epsilon.h +++ b/alib2data/src/string/Epsilon.h @@ -13,7 +13,7 @@ #include <vector> #include "../alphabet/Symbol.h" -#include <core/components2.hpp> +#include <core/components.hpp> namespace string { @@ -23,7 +23,7 @@ class GeneralAlphabet; * Represents epsilon. Regular expression is stored * as a tree of EpsilonElement. */ -class Epsilon : public StringBase, public std::Components2 < Epsilon, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > { +class Epsilon : public StringBase, public std::Components < Epsilon, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > { public: Epsilon ( ); @@ -82,7 +82,7 @@ public: namespace std { template < > -class ComponentConstraint2< ::string::Epsilon, alphabet::Symbol, ::string::GeneralAlphabet > { +class ComponentConstraint< ::string::Epsilon, alphabet::Symbol, ::string::GeneralAlphabet > { public: static bool used ( const ::string::Epsilon &, const alphabet::Symbol & ) { return false; diff --git a/alib2data/src/string/LinearString.cpp b/alib2data/src/string/LinearString.cpp index 3f87b65df4..2c346d5ca7 100644 --- a/alib2data/src/string/LinearString.cpp +++ b/alib2data/src/string/LinearString.cpp @@ -31,7 +31,7 @@ namespace string { -LinearString::LinearString(std::set<alphabet::Symbol> alphabet, std::vector<alphabet::Symbol> data) : std::Components2 < LinearString, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ) { +LinearString::LinearString(std::set<alphabet::Symbol> alphabet, std::vector<alphabet::Symbol> data) : std::Components < LinearString, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ) { setContent(std::move(data)); } diff --git a/alib2data/src/string/LinearString.h b/alib2data/src/string/LinearString.h index f38569014f..0e8e438ffc 100644 --- a/alib2data/src/string/LinearString.h +++ b/alib2data/src/string/LinearString.h @@ -13,7 +13,7 @@ #include <vector> #include "../alphabet/Symbol.h" -#include <core/components2.hpp> +#include <core/components.hpp> namespace tree { @@ -36,7 +36,7 @@ class GeneralAlphabet; * Represents regular expression parsed from the XML. Regular expression is stored * as a tree of LinearStringElement. */ -class LinearString : public StringBase, public std::Components2 < LinearString, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > { +class LinearString : public StringBase, public std::Components < LinearString, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > { std::vector < alphabet::Symbol > m_Data; public: @@ -110,7 +110,7 @@ public: namespace std { template < > -class ComponentConstraint2< ::string::LinearString, alphabet::Symbol, ::string::GeneralAlphabet > { +class ComponentConstraint< ::string::LinearString, alphabet::Symbol, ::string::GeneralAlphabet > { public: static bool used ( const ::string::LinearString & string, const alphabet::Symbol & symbol ) { const std::vector<alphabet::Symbol>& content = string.getContent ( ); diff --git a/alib2data/src/string/LinearStringTerminatingSymbol.cpp b/alib2data/src/string/LinearStringTerminatingSymbol.cpp index 598b75188a..e98617df93 100644 --- a/alib2data/src/string/LinearStringTerminatingSymbol.cpp +++ b/alib2data/src/string/LinearStringTerminatingSymbol.cpp @@ -22,7 +22,7 @@ namespace string { -LinearStringTerminatingSymbol::LinearStringTerminatingSymbol ( std::set < alphabet::Symbol > alphabet, alphabet::Symbol terminatingSymbol, std::vector < alphabet::Symbol > data ) : std::Components2 < LinearStringTerminatingSymbol, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < TerminatingSymbol > > ( std::make_tuple ( std::move ( alphabet ) ), std::make_tuple ( std::move ( terminatingSymbol ) ) ) { +LinearStringTerminatingSymbol::LinearStringTerminatingSymbol ( std::set < alphabet::Symbol > alphabet, alphabet::Symbol terminatingSymbol, std::vector < alphabet::Symbol > data ) : std::Components < LinearStringTerminatingSymbol, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < TerminatingSymbol > > ( std::make_tuple ( std::move ( alphabet ) ), std::make_tuple ( std::move ( terminatingSymbol ) ) ) { setContent ( std::move ( data ) ); } diff --git a/alib2data/src/string/LinearStringTerminatingSymbol.h b/alib2data/src/string/LinearStringTerminatingSymbol.h index e2f9ef56ba..99376d97d2 100644 --- a/alib2data/src/string/LinearStringTerminatingSymbol.h +++ b/alib2data/src/string/LinearStringTerminatingSymbol.h @@ -14,7 +14,7 @@ #include <vector> #include "../alphabet/Symbol.h" -#include <core/components2.hpp> +#include <core/components.hpp> namespace string { @@ -26,7 +26,7 @@ class TerminatingSymbol; * Represents regular expression parsed from the XML. Regular expression is stored * as a tree of LinearStringElement. */ -class LinearStringTerminatingSymbol : public StringBase, public std::Components2 < LinearStringTerminatingSymbol, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < TerminatingSymbol > > { +class LinearStringTerminatingSymbol : public StringBase, public std::Components < LinearStringTerminatingSymbol, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < TerminatingSymbol > > { std::vector < alphabet::Symbol > m_Data; public: @@ -95,7 +95,7 @@ public: namespace std { template < > -class ComponentConstraint2< ::string::LinearStringTerminatingSymbol, alphabet::Symbol, ::string::GeneralAlphabet > { +class ComponentConstraint< ::string::LinearStringTerminatingSymbol, alphabet::Symbol, ::string::GeneralAlphabet > { public: static bool used ( const ::string::LinearStringTerminatingSymbol & string, const alphabet::Symbol & symbol ) { const std::vector<alphabet::Symbol>& content = string.getContent ( ); @@ -111,7 +111,7 @@ public: }; template < > -class ElementConstraint2< ::string::LinearStringTerminatingSymbol, alphabet::Symbol, ::string::TerminatingSymbol > { +class ElementConstraint< ::string::LinearStringTerminatingSymbol, alphabet::Symbol, ::string::TerminatingSymbol > { public: static bool available ( const ::string::LinearStringTerminatingSymbol & string, const alphabet::Symbol & symbol ) { return string.getAlphabet ( ).count ( symbol ); diff --git a/alib2data/src/tree/ranked/PrefixRankedBarNonlinearPattern.cpp b/alib2data/src/tree/ranked/PrefixRankedBarNonlinearPattern.cpp index 768b55e8be..532b1fee05 100644 --- a/alib2data/src/tree/ranked/PrefixRankedBarNonlinearPattern.cpp +++ b/alib2data/src/tree/ranked/PrefixRankedBarNonlinearPattern.cpp @@ -33,7 +33,7 @@ namespace tree { -PrefixRankedBarNonlinearPattern::PrefixRankedBarNonlinearPattern ( std::set < alphabet::RankedSymbol > bars, alphabet::RankedSymbol variablesBar, alphabet::RankedSymbol subtreeWildcard, std::set < alphabet::RankedSymbol > nonlinearVariables, std::set < alphabet::RankedSymbol > alphabet, std::vector < alphabet::RankedSymbol > data ) : std::Components2 < PrefixRankedBarNonlinearPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, NonlinearAlphabet, BarSymbols >, std::tuple < SubtreeWildcard, VariablesBarSymbol > > ( std::make_tuple ( std::move ( alphabet ), std::move ( nonlinearVariables ), std::move ( bars ) ), std::make_tuple ( std::move ( subtreeWildcard ), std::move ( variablesBar ) ) ) { +PrefixRankedBarNonlinearPattern::PrefixRankedBarNonlinearPattern ( std::set < alphabet::RankedSymbol > bars, alphabet::RankedSymbol variablesBar, alphabet::RankedSymbol subtreeWildcard, std::set < alphabet::RankedSymbol > nonlinearVariables, std::set < alphabet::RankedSymbol > alphabet, std::vector < alphabet::RankedSymbol > data ) : std::Components < PrefixRankedBarNonlinearPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, NonlinearAlphabet, BarSymbols >, std::tuple < SubtreeWildcard, VariablesBarSymbol > > ( std::make_tuple ( std::move ( alphabet ), std::move ( nonlinearVariables ), std::move ( bars ) ), std::make_tuple ( std::move ( subtreeWildcard ), std::move ( variablesBar ) ) ) { setContent ( std::move ( data ) ); } diff --git a/alib2data/src/tree/ranked/PrefixRankedBarNonlinearPattern.h b/alib2data/src/tree/ranked/PrefixRankedBarNonlinearPattern.h index 1f450ea0e1..38ee0a4ae8 100644 --- a/alib2data/src/tree/ranked/PrefixRankedBarNonlinearPattern.h +++ b/alib2data/src/tree/ranked/PrefixRankedBarNonlinearPattern.h @@ -10,7 +10,7 @@ #include <set> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../TreeException.h" #include "../../alphabet/RankedSymbol.h" @@ -34,7 +34,7 @@ class NonlinearAlphabet; * Represents regular expression parsed from the XML. Regular expression is stored * as a tree of LinearStringElement. */ -class PrefixRankedBarNonlinearPattern : public RankedTreeBase, public std::Components2 < PrefixRankedBarNonlinearPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, NonlinearAlphabet, BarSymbols >, std::tuple < SubtreeWildcard, VariablesBarSymbol > > { +class PrefixRankedBarNonlinearPattern : public RankedTreeBase, public std::Components < PrefixRankedBarNonlinearPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, NonlinearAlphabet, BarSymbols >, std::tuple < SubtreeWildcard, VariablesBarSymbol > > { std::vector < alphabet::RankedSymbol > m_Data; static void toPrefixRankedBar ( const RankedNode & node, const alphabet::RankedSymbol & subtreeWildcard, const std::set < alphabet::RankedSymbol > & nonlinearVariables, const alphabet::Symbol & barBase, const alphabet::RankedSymbol & variablesBar, std::vector < alphabet::RankedSymbol > & linearNotation ); @@ -122,7 +122,7 @@ public: namespace std { template < > -class ComponentConstraint2< tree::PrefixRankedBarNonlinearPattern, alphabet::RankedSymbol, tree::GeneralAlphabet > { +class ComponentConstraint< tree::PrefixRankedBarNonlinearPattern, alphabet::RankedSymbol, tree::GeneralAlphabet > { public: static bool used ( const tree::PrefixRankedBarNonlinearPattern & pattern, const alphabet::RankedSymbol & symbol ) { const std::vector < alphabet::RankedSymbol > & content = pattern.getContent ( ); @@ -139,7 +139,7 @@ public: }; template < > -class ComponentConstraint2< tree::PrefixRankedBarNonlinearPattern, alphabet::RankedSymbol, tree::BarSymbols > { +class ComponentConstraint< tree::PrefixRankedBarNonlinearPattern, alphabet::RankedSymbol, tree::BarSymbols > { public: static bool used ( const tree::PrefixRankedBarNonlinearPattern & pattern, const alphabet::RankedSymbol & symbol ) { const std::vector < alphabet::RankedSymbol > & content = pattern.getContent ( ); @@ -156,7 +156,7 @@ public: }; template < > -class ComponentConstraint2< tree::PrefixRankedBarNonlinearPattern, alphabet::RankedSymbol, tree::NonlinearAlphabet > { +class ComponentConstraint< tree::PrefixRankedBarNonlinearPattern, alphabet::RankedSymbol, tree::NonlinearAlphabet > { public: static bool used ( const tree::PrefixRankedBarNonlinearPattern &, const alphabet::RankedSymbol & ) { return false; @@ -176,7 +176,7 @@ public: }; template < > -class ElementConstraint2< tree::PrefixRankedBarNonlinearPattern, alphabet::RankedSymbol, tree::SubtreeWildcard > { +class ElementConstraint< tree::PrefixRankedBarNonlinearPattern, alphabet::RankedSymbol, tree::SubtreeWildcard > { public: static bool available ( const tree::PrefixRankedBarNonlinearPattern & pattern, const alphabet::RankedSymbol & symbol ) { return pattern.accessComponent < tree::GeneralAlphabet > ( ).get ( ).count ( symbol ); @@ -192,7 +192,7 @@ public: }; template < > -class ElementConstraint2< tree::PrefixRankedBarNonlinearPattern, alphabet::RankedSymbol, tree::VariablesBarSymbol > { +class ElementConstraint< tree::PrefixRankedBarNonlinearPattern, alphabet::RankedSymbol, tree::VariablesBarSymbol > { public: static bool available ( const tree::PrefixRankedBarNonlinearPattern & pattern, const alphabet::RankedSymbol & symbol ) { return pattern.accessComponent < tree::BarSymbols > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/tree/ranked/PrefixRankedBarPattern.cpp b/alib2data/src/tree/ranked/PrefixRankedBarPattern.cpp index 4e889a3fc9..2612cc6db7 100644 --- a/alib2data/src/tree/ranked/PrefixRankedBarPattern.cpp +++ b/alib2data/src/tree/ranked/PrefixRankedBarPattern.cpp @@ -30,7 +30,7 @@ namespace tree { -PrefixRankedBarPattern::PrefixRankedBarPattern ( std::set < alphabet::RankedSymbol > bars, alphabet::RankedSymbol variablesBar, alphabet::RankedSymbol subtreeWildcard, std::set < alphabet::RankedSymbol > alphabet, std::vector < alphabet::RankedSymbol > data ) : std::Components2 < PrefixRankedBarPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, BarSymbols >, std::tuple < SubtreeWildcard, VariablesBarSymbol > > ( std::make_tuple ( std::move ( alphabet ), std::move ( bars ) ), std::make_tuple ( std::move ( subtreeWildcard ), std::move ( variablesBar ) ) ) { +PrefixRankedBarPattern::PrefixRankedBarPattern ( std::set < alphabet::RankedSymbol > bars, alphabet::RankedSymbol variablesBar, alphabet::RankedSymbol subtreeWildcard, std::set < alphabet::RankedSymbol > alphabet, std::vector < alphabet::RankedSymbol > data ) : std::Components < PrefixRankedBarPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, BarSymbols >, std::tuple < SubtreeWildcard, VariablesBarSymbol > > ( std::make_tuple ( std::move ( alphabet ), std::move ( bars ) ), std::make_tuple ( std::move ( subtreeWildcard ), std::move ( variablesBar ) ) ) { setContent ( std::move ( data ) ); } diff --git a/alib2data/src/tree/ranked/PrefixRankedBarPattern.h b/alib2data/src/tree/ranked/PrefixRankedBarPattern.h index c716d8efa3..227dccd27c 100644 --- a/alib2data/src/tree/ranked/PrefixRankedBarPattern.h +++ b/alib2data/src/tree/ranked/PrefixRankedBarPattern.h @@ -10,7 +10,7 @@ #include <set> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../TreeException.h" #include "../../alphabet/RankedSymbol.h" @@ -30,7 +30,7 @@ class VariablesBarSymbol; * Represents regular expression parsed from the XML. Regular expression is stored * as a tree of LinearStringElement. */ -class PrefixRankedBarPattern : public RankedTreeBase, public std::Components2 < PrefixRankedBarPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, BarSymbols >, std::tuple < SubtreeWildcard, VariablesBarSymbol > > { +class PrefixRankedBarPattern : public RankedTreeBase, public std::Components < PrefixRankedBarPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, BarSymbols >, std::tuple < SubtreeWildcard, VariablesBarSymbol > > { std::vector < alphabet::RankedSymbol > m_Data; static void toPrefixRankedBar ( const RankedNode & node, const alphabet::RankedSymbol & subtreeWildcard, const alphabet::Symbol & barBase, const alphabet::RankedSymbol & variablesBar, std::vector < alphabet::RankedSymbol > & linearNotation ); @@ -108,7 +108,7 @@ public: namespace std { template < > -class ComponentConstraint2< tree::PrefixRankedBarPattern, alphabet::RankedSymbol, tree::GeneralAlphabet > { +class ComponentConstraint< tree::PrefixRankedBarPattern, alphabet::RankedSymbol, tree::GeneralAlphabet > { public: static bool used ( const tree::PrefixRankedBarPattern & pattern, const alphabet::RankedSymbol & symbol ) { const std::vector < alphabet::RankedSymbol > & content = pattern.getContent ( ); @@ -125,7 +125,7 @@ public: }; template < > -class ComponentConstraint2< tree::PrefixRankedBarPattern, alphabet::RankedSymbol, tree::BarSymbols > { +class ComponentConstraint< tree::PrefixRankedBarPattern, alphabet::RankedSymbol, tree::BarSymbols > { public: static bool used ( const tree::PrefixRankedBarPattern & pattern, const alphabet::RankedSymbol & symbol ) { const std::vector < alphabet::RankedSymbol > & content = pattern.getContent ( ); @@ -142,7 +142,7 @@ public: }; template < > -class ElementConstraint2< tree::PrefixRankedBarPattern, alphabet::RankedSymbol, tree::SubtreeWildcard > { +class ElementConstraint< tree::PrefixRankedBarPattern, alphabet::RankedSymbol, tree::SubtreeWildcard > { public: static bool available ( const tree::PrefixRankedBarPattern & pattern, const alphabet::RankedSymbol & symbol ) { return pattern.accessComponent < tree::GeneralAlphabet > ( ).get ( ).count ( symbol ); @@ -155,7 +155,7 @@ public: }; template < > -class ElementConstraint2< tree::PrefixRankedBarPattern, alphabet::RankedSymbol, tree::VariablesBarSymbol > { +class ElementConstraint< tree::PrefixRankedBarPattern, alphabet::RankedSymbol, tree::VariablesBarSymbol > { public: static bool available ( const tree::PrefixRankedBarPattern & pattern, const alphabet::RankedSymbol & symbol ) { return pattern.accessComponent < tree::BarSymbols > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/tree/ranked/PrefixRankedBarTree.cpp b/alib2data/src/tree/ranked/PrefixRankedBarTree.cpp index 21e311ee85..951f5689dd 100644 --- a/alib2data/src/tree/ranked/PrefixRankedBarTree.cpp +++ b/alib2data/src/tree/ranked/PrefixRankedBarTree.cpp @@ -27,7 +27,7 @@ namespace tree { -PrefixRankedBarTree::PrefixRankedBarTree ( std::set < alphabet::RankedSymbol > bars, std::set < alphabet::RankedSymbol > alphabet, std::vector < alphabet::RankedSymbol > data ) : std::Components2 < PrefixRankedBarTree, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, BarSymbols >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ), std::move ( bars ) ), std::tuple < > ( ) ) { +PrefixRankedBarTree::PrefixRankedBarTree ( std::set < alphabet::RankedSymbol > bars, std::set < alphabet::RankedSymbol > alphabet, std::vector < alphabet::RankedSymbol > data ) : std::Components < PrefixRankedBarTree, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, BarSymbols >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ), std::move ( bars ) ), std::tuple < > ( ) ) { setContent ( std::move ( data ) ); } diff --git a/alib2data/src/tree/ranked/PrefixRankedBarTree.h b/alib2data/src/tree/ranked/PrefixRankedBarTree.h index e51e867b68..a204602cb4 100644 --- a/alib2data/src/tree/ranked/PrefixRankedBarTree.h +++ b/alib2data/src/tree/ranked/PrefixRankedBarTree.h @@ -10,7 +10,7 @@ #include <set> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../TreeException.h" #include "../../alphabet/RankedSymbol.h" @@ -27,7 +27,7 @@ class BarSymbols; * Represents regular expression parsed from the XML. Regular expression is stored * as a tree of LinearStringElement. */ -class PrefixRankedBarTree : public RankedTreeBase, public std::Components2 < PrefixRankedBarTree, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, BarSymbols >, std::tuple < > > { +class PrefixRankedBarTree : public RankedTreeBase, public std::Components < PrefixRankedBarTree, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, BarSymbols >, std::tuple < > > { std::vector < alphabet::RankedSymbol > m_Data; static void toPrefixRankedBar ( const RankedNode & node, const alphabet::Symbol & barBase, std::vector < alphabet::RankedSymbol > & linearNotation ); @@ -96,7 +96,7 @@ public: namespace std { template < > -class ComponentConstraint2< tree::PrefixRankedBarTree, alphabet::RankedSymbol, tree::GeneralAlphabet > { +class ComponentConstraint< tree::PrefixRankedBarTree, alphabet::RankedSymbol, tree::GeneralAlphabet > { public: static bool used ( const tree::PrefixRankedBarTree & tree, const alphabet::RankedSymbol & symbol ) { const std::vector < alphabet::RankedSymbol > & content = tree.getContent ( ); @@ -113,7 +113,7 @@ public: }; template < > -class ComponentConstraint2< tree::PrefixRankedBarTree, alphabet::RankedSymbol, tree::BarSymbols > { +class ComponentConstraint< tree::PrefixRankedBarTree, alphabet::RankedSymbol, tree::BarSymbols > { public: static bool used ( const tree::PrefixRankedBarTree & tree, const alphabet::RankedSymbol & symbol ) { const std::vector < alphabet::RankedSymbol > & content = tree.getContent ( ); diff --git a/alib2data/src/tree/ranked/PrefixRankedNonlinearPattern.cpp b/alib2data/src/tree/ranked/PrefixRankedNonlinearPattern.cpp index a3eda5ef29..c1478cd47d 100644 --- a/alib2data/src/tree/ranked/PrefixRankedNonlinearPattern.cpp +++ b/alib2data/src/tree/ranked/PrefixRankedNonlinearPattern.cpp @@ -30,7 +30,7 @@ namespace tree { -PrefixRankedNonlinearPattern::PrefixRankedNonlinearPattern ( alphabet::RankedSymbol subtreeWildcard, std::set < alphabet::RankedSymbol > nonlinearVariables, std::set < alphabet::RankedSymbol > alphabet, std::vector < alphabet::RankedSymbol > data ) : std::Components2 < PrefixRankedNonlinearPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( alphabet ), std::move ( nonlinearVariables ) ), std::make_tuple ( subtreeWildcard ) ) { +PrefixRankedNonlinearPattern::PrefixRankedNonlinearPattern ( alphabet::RankedSymbol subtreeWildcard, std::set < alphabet::RankedSymbol > nonlinearVariables, std::set < alphabet::RankedSymbol > alphabet, std::vector < alphabet::RankedSymbol > data ) : std::Components < PrefixRankedNonlinearPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( alphabet ), std::move ( nonlinearVariables ) ), std::make_tuple ( subtreeWildcard ) ) { setContent ( std::move ( data ) ); } diff --git a/alib2data/src/tree/ranked/PrefixRankedNonlinearPattern.h b/alib2data/src/tree/ranked/PrefixRankedNonlinearPattern.h index 915e334c73..68572e7240 100644 --- a/alib2data/src/tree/ranked/PrefixRankedNonlinearPattern.h +++ b/alib2data/src/tree/ranked/PrefixRankedNonlinearPattern.h @@ -10,7 +10,7 @@ #include <set> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../TreeException.h" #include "../../alphabet/RankedSymbol.h" @@ -33,7 +33,7 @@ class NonlinearAlphabet; * Represents regular expression parsed from the XML. Regular expression is stored * as a tree of LinearStringElement. */ -class PrefixRankedNonlinearPattern : public RankedTreeBase, public std::Components2 < PrefixRankedNonlinearPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > { +class PrefixRankedNonlinearPattern : public RankedTreeBase, public std::Components < PrefixRankedNonlinearPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > { std::vector < alphabet::RankedSymbol > m_Data; static std::vector < alphabet::RankedSymbol > toPrefixRanked ( const RankedNode & node, const alphabet::RankedSymbol & subtreeWildcard, const std::set < alphabet::RankedSymbol > & nonlinearVariables ); @@ -110,7 +110,7 @@ public: namespace std { template < > -class ComponentConstraint2< tree::PrefixRankedNonlinearPattern, alphabet::RankedSymbol, tree::GeneralAlphabet > { +class ComponentConstraint< tree::PrefixRankedNonlinearPattern, alphabet::RankedSymbol, tree::GeneralAlphabet > { public: static bool used ( const tree::PrefixRankedNonlinearPattern & pattern, const alphabet::RankedSymbol & symbol ) { const std::vector < alphabet::RankedSymbol > & content = pattern.getContent ( ); @@ -127,7 +127,7 @@ public: }; template < > -class ComponentConstraint2< tree::PrefixRankedNonlinearPattern, alphabet::RankedSymbol, tree::NonlinearAlphabet > { +class ComponentConstraint< tree::PrefixRankedNonlinearPattern, alphabet::RankedSymbol, tree::NonlinearAlphabet > { public: static bool used ( const tree::PrefixRankedNonlinearPattern &, const alphabet::RankedSymbol & ) { return false; @@ -147,7 +147,7 @@ public: }; template < > -class ElementConstraint2< tree::PrefixRankedNonlinearPattern, alphabet::RankedSymbol, tree::SubtreeWildcard > { +class ElementConstraint< tree::PrefixRankedNonlinearPattern, alphabet::RankedSymbol, tree::SubtreeWildcard > { public: static bool available ( const tree::PrefixRankedNonlinearPattern & pattern, const alphabet::RankedSymbol & symbol ) { return pattern.accessComponent < tree::GeneralAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/tree/ranked/PrefixRankedPattern.cpp b/alib2data/src/tree/ranked/PrefixRankedPattern.cpp index c5efa441ae..043de48677 100644 --- a/alib2data/src/tree/ranked/PrefixRankedPattern.cpp +++ b/alib2data/src/tree/ranked/PrefixRankedPattern.cpp @@ -27,7 +27,7 @@ namespace tree { -PrefixRankedPattern::PrefixRankedPattern ( alphabet::RankedSymbol subtreeWildcard, std::set < alphabet::RankedSymbol > alphabet, std::vector < alphabet::RankedSymbol > data ) : std::Components2 < PrefixRankedPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( alphabet ) ), std::make_tuple ( subtreeWildcard ) ) { +PrefixRankedPattern::PrefixRankedPattern ( alphabet::RankedSymbol subtreeWildcard, std::set < alphabet::RankedSymbol > alphabet, std::vector < alphabet::RankedSymbol > data ) : std::Components < PrefixRankedPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( alphabet ) ), std::make_tuple ( subtreeWildcard ) ) { setContent ( std::move ( data ) ); } diff --git a/alib2data/src/tree/ranked/PrefixRankedPattern.h b/alib2data/src/tree/ranked/PrefixRankedPattern.h index 873c625f14..00260f4a59 100644 --- a/alib2data/src/tree/ranked/PrefixRankedPattern.h +++ b/alib2data/src/tree/ranked/PrefixRankedPattern.h @@ -10,7 +10,7 @@ #include <set> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../TreeException.h" #include "../../alphabet/RankedSymbol.h" @@ -28,7 +28,7 @@ class SubtreeWildcard; * Represents regular expression parsed from the XML. Regular expression is stored * as a tree of LinearStringElement. */ -class PrefixRankedPattern : public RankedTreeBase, public std::Components2 < PrefixRankedPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > { +class PrefixRankedPattern : public RankedTreeBase, public std::Components < PrefixRankedPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > { std::vector < alphabet::RankedSymbol > m_Data; static std::vector < alphabet::RankedSymbol > toPrefixRanked ( const RankedNode & node, const alphabet::RankedSymbol & subtreeWildcard ); @@ -97,7 +97,7 @@ public: namespace std { template < > -class ComponentConstraint2< tree::PrefixRankedPattern, alphabet::RankedSymbol, tree::GeneralAlphabet > { +class ComponentConstraint< tree::PrefixRankedPattern, alphabet::RankedSymbol, tree::GeneralAlphabet > { public: static bool used ( const tree::PrefixRankedPattern & pattern, const alphabet::RankedSymbol & symbol ) { const std::vector < alphabet::RankedSymbol > & content = pattern.getContent ( ); @@ -114,7 +114,7 @@ public: }; template < > -class ElementConstraint2< tree::PrefixRankedPattern, alphabet::RankedSymbol, tree::SubtreeWildcard > { +class ElementConstraint< tree::PrefixRankedPattern, alphabet::RankedSymbol, tree::SubtreeWildcard > { public: static bool available ( const tree::PrefixRankedPattern & pattern, const alphabet::RankedSymbol & symbol ) { return pattern.accessComponent < tree::GeneralAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/tree/ranked/PrefixRankedTree.cpp b/alib2data/src/tree/ranked/PrefixRankedTree.cpp index 5a4f270abc..0867389e31 100644 --- a/alib2data/src/tree/ranked/PrefixRankedTree.cpp +++ b/alib2data/src/tree/ranked/PrefixRankedTree.cpp @@ -24,7 +24,7 @@ namespace tree { -PrefixRankedTree::PrefixRankedTree ( std::set < alphabet::RankedSymbol > alphabet, std::vector < alphabet::RankedSymbol > data ) : std::Components2 < PrefixRankedTree, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ) { +PrefixRankedTree::PrefixRankedTree ( std::set < alphabet::RankedSymbol > alphabet, std::vector < alphabet::RankedSymbol > data ) : std::Components < PrefixRankedTree, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ) { setContent ( std::move ( data ) ); } diff --git a/alib2data/src/tree/ranked/PrefixRankedTree.h b/alib2data/src/tree/ranked/PrefixRankedTree.h index 2d7ffec159..f90779d08d 100644 --- a/alib2data/src/tree/ranked/PrefixRankedTree.h +++ b/alib2data/src/tree/ranked/PrefixRankedTree.h @@ -10,7 +10,7 @@ #include <set> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../TreeException.h" #include "../../alphabet/RankedSymbol.h" @@ -26,7 +26,7 @@ class GeneralAlphabet; * Represents regular expression parsed from the XML. Regular expression is stored * as a tree of LinearStringElement. */ -class PrefixRankedTree : public RankedTreeBase, public std::Components2 < PrefixRankedTree, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < > > { +class PrefixRankedTree : public RankedTreeBase, public std::Components < PrefixRankedTree, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < > > { std::vector < alphabet::RankedSymbol > m_Data; static std::vector < alphabet::RankedSymbol > toPrefixRanked ( const RankedNode & node ); @@ -90,7 +90,7 @@ public: namespace std { template < > -class ComponentConstraint2< tree::PrefixRankedTree, alphabet::RankedSymbol, tree::GeneralAlphabet > { +class ComponentConstraint< tree::PrefixRankedTree, alphabet::RankedSymbol, tree::GeneralAlphabet > { public: static bool used ( const tree::PrefixRankedTree & tree, const alphabet::RankedSymbol & symbol ) { const std::vector < alphabet::RankedSymbol > & content = tree.getContent ( ); diff --git a/alib2data/src/tree/ranked/RankedNonlinearPattern.cpp b/alib2data/src/tree/ranked/RankedNonlinearPattern.cpp index 11dd146d2f..3574cd73bc 100644 --- a/alib2data/src/tree/ranked/RankedNonlinearPattern.cpp +++ b/alib2data/src/tree/ranked/RankedNonlinearPattern.cpp @@ -24,7 +24,7 @@ namespace tree { -RankedNonlinearPattern::RankedNonlinearPattern ( alphabet::RankedSymbol subtreeWildcard, std::set < alphabet::RankedSymbol > nonlinearVariables, std::set < alphabet::RankedSymbol > alphabet, RankedNode pattern ) : std::Components2 < RankedNonlinearPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( alphabet ), std::move ( nonlinearVariables ) ), std::make_tuple ( std::move ( subtreeWildcard ) ) ), pattern ( nullptr ) { +RankedNonlinearPattern::RankedNonlinearPattern ( alphabet::RankedSymbol subtreeWildcard, std::set < alphabet::RankedSymbol > nonlinearVariables, std::set < alphabet::RankedSymbol > alphabet, RankedNode pattern ) : std::Components < RankedNonlinearPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( alphabet ), std::move ( nonlinearVariables ) ), std::make_tuple ( std::move ( subtreeWildcard ) ) ), pattern ( nullptr ) { setTree ( std::move ( pattern ) ); } @@ -34,11 +34,11 @@ RankedNonlinearPattern::RankedNonlinearPattern ( alphabet::RankedSymbol subtreeW RankedNonlinearPattern::RankedNonlinearPattern ( alphabet::RankedSymbol subtreeWildcard, RankedNode pattern ) : RankedNonlinearPattern ( subtreeWildcard, std::set < alphabet::RankedSymbol > { }, pattern ) { } -RankedNonlinearPattern::RankedNonlinearPattern ( const RankedNonlinearPattern & other ) : std::Components2 < RankedNonlinearPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( other.getAlphabet ( ), other.getNonlinearVariables ( ) ), std::make_tuple ( other.getSubtreeWildcard ( ) ) ), pattern ( other.pattern ) { +RankedNonlinearPattern::RankedNonlinearPattern ( const RankedNonlinearPattern & other ) : std::Components < RankedNonlinearPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( other.getAlphabet ( ), other.getNonlinearVariables ( ) ), std::make_tuple ( other.getSubtreeWildcard ( ) ) ), pattern ( other.pattern ) { this->pattern->attachAlphabet ( & ( this->getAlphabet() ) ); } -RankedNonlinearPattern::RankedNonlinearPattern ( RankedNonlinearPattern && other ) noexcept : std::Components2 < RankedNonlinearPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( other.accessComponent < GeneralAlphabet > ( ).get ( ) ), std::move ( other.accessComponent < NonlinearAlphabet > ( ).get ( ) ) ), std::make_tuple ( std::move ( other.accessElement < SubtreeWildcard > ( ).get ( ) ) ) ), pattern ( std::move ( other.pattern ) ) { +RankedNonlinearPattern::RankedNonlinearPattern ( RankedNonlinearPattern && other ) noexcept : std::Components < RankedNonlinearPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( other.accessComponent < GeneralAlphabet > ( ).get ( ) ), std::move ( other.accessComponent < NonlinearAlphabet > ( ).get ( ) ) ), std::make_tuple ( std::move ( other.accessElement < SubtreeWildcard > ( ).get ( ) ) ) ), pattern ( std::move ( other.pattern ) ) { this->pattern->attachAlphabet ( & ( this->getAlphabet() ) ); } diff --git a/alib2data/src/tree/ranked/RankedNonlinearPattern.h b/alib2data/src/tree/ranked/RankedNonlinearPattern.h index 25a72b4c9e..ab64357f12 100644 --- a/alib2data/src/tree/ranked/RankedNonlinearPattern.h +++ b/alib2data/src/tree/ranked/RankedNonlinearPattern.h @@ -10,7 +10,7 @@ #include <string> #include <set> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../TreeException.h" #include "RankedNode.h" @@ -28,7 +28,7 @@ class NonlinearAlphabet; * Represents regular expression parsed from the XML. Regular expression is stored * as a pattern of RegExpElement. */ -class RankedNonlinearPattern : public RankedTreeBase, public std::Components2 < RankedNonlinearPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > { +class RankedNonlinearPattern : public RankedTreeBase, public std::Components < RankedNonlinearPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > { std::smart_ptr < RankedNode > pattern; public: @@ -123,7 +123,7 @@ public: namespace std { template < > -class ComponentConstraint2< tree::RankedNonlinearPattern, alphabet::RankedSymbol, tree::GeneralAlphabet > { +class ComponentConstraint< tree::RankedNonlinearPattern, alphabet::RankedSymbol, tree::GeneralAlphabet > { public: static bool used ( const tree::RankedNonlinearPattern & pattern, const alphabet::RankedSymbol & symbol ) { return pattern.getRoot ( ).testSymbol ( symbol ) || pattern.accessElement < tree::SubtreeWildcard > ( ).get ( ) == symbol || pattern.accessComponent < tree::NonlinearAlphabet > ( ).get ( ).count ( symbol ); @@ -138,7 +138,7 @@ public: }; template < > -class ComponentConstraint2< tree::RankedNonlinearPattern, alphabet::RankedSymbol, tree::NonlinearAlphabet > { +class ComponentConstraint< tree::RankedNonlinearPattern, alphabet::RankedSymbol, tree::NonlinearAlphabet > { public: static bool used ( const tree::RankedNonlinearPattern &, const alphabet::RankedSymbol & ) { return false; @@ -158,7 +158,7 @@ public: }; template < > -class ElementConstraint2< tree::RankedNonlinearPattern, alphabet::RankedSymbol, tree::SubtreeWildcard > { +class ElementConstraint< tree::RankedNonlinearPattern, alphabet::RankedSymbol, tree::SubtreeWildcard > { public: static bool available ( const tree::RankedNonlinearPattern & pattern, const alphabet::RankedSymbol & symbol ) { return pattern.accessComponent < tree::GeneralAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/tree/ranked/RankedPattern.cpp b/alib2data/src/tree/ranked/RankedPattern.cpp index 8f7e1f2c5e..56b467abb4 100644 --- a/alib2data/src/tree/ranked/RankedPattern.cpp +++ b/alib2data/src/tree/ranked/RankedPattern.cpp @@ -24,7 +24,7 @@ namespace tree { -RankedPattern::RankedPattern ( alphabet::RankedSymbol subtreeWildcard, std::set < alphabet::RankedSymbol > alphabet, RankedNode pattern ) : std::Components2 < RankedPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( alphabet ) ), std::make_tuple ( std::move ( subtreeWildcard ) ) ), pattern ( nullptr ) { +RankedPattern::RankedPattern ( alphabet::RankedSymbol subtreeWildcard, std::set < alphabet::RankedSymbol > alphabet, RankedNode pattern ) : std::Components < RankedPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( alphabet ) ), std::make_tuple ( std::move ( subtreeWildcard ) ) ), pattern ( nullptr ) { setTree ( std::move ( pattern ) ); } @@ -34,11 +34,11 @@ RankedPattern::RankedPattern ( alphabet::RankedSymbol subtreeWildcard, RankedNod RankedPattern::RankedPattern ( const UnrankedPattern & other ) : RankedPattern ( alphabet::RankedSymbol ( other.getSubtreeWildcard ( ), 0 ), other.getRoot ( ).asRanked ( ) ) { } -RankedPattern::RankedPattern ( const RankedPattern & other ) : std::Components2 < RankedPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( other.getAlphabet ( ) ), std::make_tuple ( other.getSubtreeWildcard ( ) ) ), pattern ( other.pattern ) { +RankedPattern::RankedPattern ( const RankedPattern & other ) : std::Components < RankedPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( other.getAlphabet ( ) ), std::make_tuple ( other.getSubtreeWildcard ( ) ) ), pattern ( other.pattern ) { this->pattern->attachAlphabet ( & ( this->getAlphabet() ) ); } -RankedPattern::RankedPattern ( RankedPattern && other ) noexcept : std::Components2 < RankedPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( other.accessComponent < GeneralAlphabet > ( ).get ( ) ) ), std::make_tuple ( std::move ( other.accessElement < SubtreeWildcard > ( ).get ( ) ) ) ), pattern ( std::move ( other.pattern ) ) { +RankedPattern::RankedPattern ( RankedPattern && other ) noexcept : std::Components < RankedPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( other.accessComponent < GeneralAlphabet > ( ).get ( ) ) ), std::make_tuple ( std::move ( other.accessElement < SubtreeWildcard > ( ).get ( ) ) ) ), pattern ( std::move ( other.pattern ) ) { this->pattern->attachAlphabet ( & ( this->getAlphabet() ) ); } diff --git a/alib2data/src/tree/ranked/RankedPattern.h b/alib2data/src/tree/ranked/RankedPattern.h index d0fa2fedea..f58f459696 100644 --- a/alib2data/src/tree/ranked/RankedPattern.h +++ b/alib2data/src/tree/ranked/RankedPattern.h @@ -10,7 +10,7 @@ #include <string> #include <set> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../TreeException.h" #include "RankedNode.h" @@ -27,7 +27,7 @@ class SubtreeWildcard; * Represents regular expression parsed from the XML. Regular expression is stored * as a pattern of RegExpElement. */ -class RankedPattern : public RankedTreeBase, public std::Components2 < RankedPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > { +class RankedPattern : public RankedTreeBase, public std::Components < RankedPattern, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > { std::smart_ptr < RankedNode > pattern; public: @@ -118,7 +118,7 @@ public: namespace std { template < > -class ComponentConstraint2< tree::RankedPattern, alphabet::RankedSymbol, tree::GeneralAlphabet > { +class ComponentConstraint< tree::RankedPattern, alphabet::RankedSymbol, tree::GeneralAlphabet > { public: static bool used ( const tree::RankedPattern & pattern, const alphabet::RankedSymbol & symbol ) { return pattern.getRoot ( ).testSymbol ( symbol ) || pattern.accessElement < tree::SubtreeWildcard > ( ).get ( ) == symbol; @@ -133,7 +133,7 @@ public: }; template < > -class ElementConstraint2< tree::RankedPattern, alphabet::RankedSymbol, tree::SubtreeWildcard > { +class ElementConstraint< tree::RankedPattern, alphabet::RankedSymbol, tree::SubtreeWildcard > { public: static bool available ( const tree::RankedPattern & pattern, const alphabet::RankedSymbol & symbol ) { return pattern.accessComponent < tree::GeneralAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/tree/ranked/RankedTree.cpp b/alib2data/src/tree/ranked/RankedTree.cpp index 0c42ca5e7d..b1e5c2ee3f 100644 --- a/alib2data/src/tree/ranked/RankedTree.cpp +++ b/alib2data/src/tree/ranked/RankedTree.cpp @@ -24,7 +24,7 @@ namespace tree { -RankedTree::RankedTree ( std::set < alphabet::RankedSymbol > alphabet, RankedNode tree ) : std::Components2 < RankedTree, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ), tree ( nullptr ) { +RankedTree::RankedTree ( std::set < alphabet::RankedSymbol > alphabet, RankedNode tree ) : std::Components < RankedTree, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ), tree ( nullptr ) { setTree ( std::move ( tree ) ); } @@ -34,11 +34,11 @@ RankedTree::RankedTree ( RankedNode tree ) : RankedTree ( tree.computeMinimalAlp RankedTree::RankedTree ( const UnrankedTree & other ) : RankedTree ( other.getRoot ( ).asRanked ( ) ) { } -RankedTree::RankedTree ( const RankedTree & other ) : std::Components2 < RankedTree, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( other.getAlphabet ( ) ), std::tuple < > ( ) ), tree ( other.tree ) { +RankedTree::RankedTree ( const RankedTree & other ) : std::Components < RankedTree, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( other.getAlphabet ( ) ), std::tuple < > ( ) ), tree ( other.tree ) { this->tree->attachAlphabet ( & ( this->getAlphabet ( ) ) ); } -RankedTree::RankedTree ( RankedTree && other ) noexcept : std::Components2 < RankedTree, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( other.accessComponent < GeneralAlphabet > ( ).get ( ) ) ), std::tuple < > ( ) ), tree ( std::move ( other.tree ) ) { +RankedTree::RankedTree ( RankedTree && other ) noexcept : std::Components < RankedTree, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( other.accessComponent < GeneralAlphabet > ( ).get ( ) ) ), std::tuple < > ( ) ), tree ( std::move ( other.tree ) ) { this->tree->attachAlphabet ( & ( this->getAlphabet ( ) ) ); } diff --git a/alib2data/src/tree/ranked/RankedTree.h b/alib2data/src/tree/ranked/RankedTree.h index 5c7eec37d5..1d32503457 100644 --- a/alib2data/src/tree/ranked/RankedTree.h +++ b/alib2data/src/tree/ranked/RankedTree.h @@ -10,7 +10,7 @@ #include <string> #include <set> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../TreeException.h" #include "RankedNode.h" @@ -26,7 +26,7 @@ class GeneralAlphabet; * Represents regular expression parsed from the XML. Regular expression is stored * as a tree of RegExpElement. */ -class RankedTree : public RankedTreeBase, public std::Components2 < RankedTree, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < > > { +class RankedTree : public RankedTreeBase, public std::Components < RankedTree, alphabet::RankedSymbol, std::tuple < GeneralAlphabet >, std::tuple < > > { std::smart_ptr < RankedNode > tree; public: @@ -113,7 +113,7 @@ public: namespace std { template < > -class ComponentConstraint2< tree::RankedTree, alphabet::RankedSymbol, tree::GeneralAlphabet > { +class ComponentConstraint< tree::RankedTree, alphabet::RankedSymbol, tree::GeneralAlphabet > { public: static bool used ( const tree::RankedTree & tree, const alphabet::RankedSymbol & symbol ) { return tree.getRoot ( ).testSymbol ( symbol ); diff --git a/alib2data/src/tree/unranked/PrefixBarTree.cpp b/alib2data/src/tree/unranked/PrefixBarTree.cpp index 20894294ad..c2bc2d8185 100644 --- a/alib2data/src/tree/unranked/PrefixBarTree.cpp +++ b/alib2data/src/tree/unranked/PrefixBarTree.cpp @@ -27,7 +27,7 @@ namespace tree { -PrefixBarTree::PrefixBarTree ( alphabet::Symbol bar, std::set < alphabet::Symbol > alphabet, std::vector < alphabet::Symbol > data ) : std::Components2 < PrefixBarTree, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < BarSymbol > > ( std::make_tuple ( std::move ( alphabet ) ), std::make_tuple ( std::move ( bar ) ) ) { +PrefixBarTree::PrefixBarTree ( alphabet::Symbol bar, std::set < alphabet::Symbol > alphabet, std::vector < alphabet::Symbol > data ) : std::Components < PrefixBarTree, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < BarSymbol > > ( std::make_tuple ( std::move ( alphabet ) ), std::make_tuple ( std::move ( bar ) ) ) { setContent ( std::move ( data ) ); } diff --git a/alib2data/src/tree/unranked/PrefixBarTree.h b/alib2data/src/tree/unranked/PrefixBarTree.h index 2edf0e3f01..c3004494b2 100644 --- a/alib2data/src/tree/unranked/PrefixBarTree.h +++ b/alib2data/src/tree/unranked/PrefixBarTree.h @@ -10,7 +10,7 @@ #include <set> #include <vector> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../../alphabet/Symbol.h" #include "../UnrankedTreeBase.h" @@ -26,7 +26,7 @@ class BarSymbol; * Represents regular expression parsed from the XML. Regular expression is stored * as a tree of LinearStringElement. */ -class PrefixBarTree : public UnrankedTreeBase, public std::Components2 < PrefixBarTree, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < BarSymbol > > { +class PrefixBarTree : public UnrankedTreeBase, public std::Components < PrefixBarTree, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < BarSymbol > > { std::vector < alphabet::Symbol > m_Data; static std::vector < alphabet::Symbol > toPrefixBar ( const UnrankedNode & node, const alphabet::Symbol & bar ); @@ -95,7 +95,7 @@ public: namespace std { template < > -class ComponentConstraint2< tree::PrefixBarTree, alphabet::Symbol, tree::GeneralAlphabet > { +class ComponentConstraint< tree::PrefixBarTree, alphabet::Symbol, tree::GeneralAlphabet > { public: static bool used ( const tree::PrefixBarTree & tree, const alphabet::Symbol & symbol ) { const std::vector < alphabet::Symbol > & content = tree.getContent ( ); @@ -112,7 +112,7 @@ public: }; template < > -class ElementConstraint2< tree::PrefixBarTree, alphabet::Symbol, tree::BarSymbol > { +class ElementConstraint< tree::PrefixBarTree, alphabet::Symbol, tree::BarSymbol > { public: static bool available ( const tree::PrefixBarTree & tree, const alphabet::Symbol & symbol ) { return tree.accessComponent < tree::GeneralAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/tree/unranked/UnrankedNonlinearPattern.cpp b/alib2data/src/tree/unranked/UnrankedNonlinearPattern.cpp index 5afbb8baae..c354c0107f 100644 --- a/alib2data/src/tree/unranked/UnrankedNonlinearPattern.cpp +++ b/alib2data/src/tree/unranked/UnrankedNonlinearPattern.cpp @@ -24,7 +24,7 @@ namespace tree { -UnrankedNonlinearPattern::UnrankedNonlinearPattern ( alphabet::Symbol subtreeWildcard, std::set < alphabet::Symbol > nonlinearVariables, std::set < alphabet::Symbol > alphabet, UnrankedNode pattern ) : std::Components2 < UnrankedNonlinearPattern, alphabet::Symbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( alphabet ), std::move ( nonlinearVariables ) ), std::make_tuple ( std::move ( subtreeWildcard ) ) ), pattern ( nullptr ) { +UnrankedNonlinearPattern::UnrankedNonlinearPattern ( alphabet::Symbol subtreeWildcard, std::set < alphabet::Symbol > nonlinearVariables, std::set < alphabet::Symbol > alphabet, UnrankedNode pattern ) : std::Components < UnrankedNonlinearPattern, alphabet::Symbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( alphabet ), std::move ( nonlinearVariables ) ), std::make_tuple ( std::move ( subtreeWildcard ) ) ), pattern ( nullptr ) { setTree ( std::move ( pattern ) ); } @@ -34,11 +34,11 @@ UnrankedNonlinearPattern::UnrankedNonlinearPattern ( alphabet::Symbol subtreeWil UnrankedNonlinearPattern::UnrankedNonlinearPattern ( alphabet::Symbol subtreeWildcard, UnrankedNode pattern ) : UnrankedNonlinearPattern ( subtreeWildcard, std::set < alphabet::Symbol > { }, pattern ) { } -UnrankedNonlinearPattern::UnrankedNonlinearPattern ( const UnrankedNonlinearPattern & other ) : std::Components2 < UnrankedNonlinearPattern, alphabet::Symbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( other.getAlphabet ( ), other.getNonlinearVariables ( ) ), std::make_tuple ( other.getSubtreeWildcard ( ) ) ), pattern ( other.pattern ) { +UnrankedNonlinearPattern::UnrankedNonlinearPattern ( const UnrankedNonlinearPattern & other ) : std::Components < UnrankedNonlinearPattern, alphabet::Symbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( other.getAlphabet ( ), other.getNonlinearVariables ( ) ), std::make_tuple ( other.getSubtreeWildcard ( ) ) ), pattern ( other.pattern ) { this->pattern->attachAlphabet ( & ( this->getAlphabet ( ) ) ); } -UnrankedNonlinearPattern::UnrankedNonlinearPattern ( UnrankedNonlinearPattern && other ) noexcept : std::Components2 < UnrankedNonlinearPattern, alphabet::Symbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( other.accessComponent < GeneralAlphabet > ( ).get ( ) ), std::move ( other.accessComponent < NonlinearAlphabet > ( ).get ( ) ) ), std::make_tuple ( std::move ( other.accessElement < SubtreeWildcard > ( ).get ( ) ) ) ), pattern ( std::move ( other.pattern ) ) { +UnrankedNonlinearPattern::UnrankedNonlinearPattern ( UnrankedNonlinearPattern && other ) noexcept : std::Components < UnrankedNonlinearPattern, alphabet::Symbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( other.accessComponent < GeneralAlphabet > ( ).get ( ) ), std::move ( other.accessComponent < NonlinearAlphabet > ( ).get ( ) ) ), std::make_tuple ( std::move ( other.accessElement < SubtreeWildcard > ( ).get ( ) ) ) ), pattern ( std::move ( other.pattern ) ) { this->pattern->attachAlphabet ( & ( this->getAlphabet ( ) ) ); } diff --git a/alib2data/src/tree/unranked/UnrankedNonlinearPattern.h b/alib2data/src/tree/unranked/UnrankedNonlinearPattern.h index c4f03749d7..3224ba0f6e 100644 --- a/alib2data/src/tree/unranked/UnrankedNonlinearPattern.h +++ b/alib2data/src/tree/unranked/UnrankedNonlinearPattern.h @@ -10,7 +10,7 @@ #include <string> #include <set> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../TreeException.h" #include "UnrankedNode.h" @@ -28,7 +28,7 @@ class NonlinearAlphabet; * Represents regular expression parsed from the XML. Regular expression is stored * as a pattern of RegExpElement. */ -class UnrankedNonlinearPattern : public UnrankedTreeBase, public std::Components2 < UnrankedNonlinearPattern, alphabet::Symbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > { +class UnrankedNonlinearPattern : public UnrankedTreeBase, public std::Components < UnrankedNonlinearPattern, alphabet::Symbol, std::tuple < GeneralAlphabet, NonlinearAlphabet >, std::tuple < SubtreeWildcard > > { std::smart_ptr < UnrankedNode > pattern; public: @@ -129,7 +129,7 @@ public: namespace std { template < > -class ComponentConstraint2< tree::UnrankedNonlinearPattern, alphabet::Symbol, tree::GeneralAlphabet > { +class ComponentConstraint< tree::UnrankedNonlinearPattern, alphabet::Symbol, tree::GeneralAlphabet > { public: static bool used ( const tree::UnrankedNonlinearPattern & pattern, const alphabet::Symbol & symbol ) { return pattern.getRoot ( ).testSymbol ( symbol ) || pattern.accessElement < tree::SubtreeWildcard > ( ).get ( ) == symbol || pattern.accessComponent < tree::NonlinearAlphabet > ( ).get ( ).count ( symbol ); @@ -144,7 +144,7 @@ public: }; template < > -class ComponentConstraint2< tree::UnrankedNonlinearPattern, alphabet::Symbol, tree::NonlinearAlphabet > { +class ComponentConstraint< tree::UnrankedNonlinearPattern, alphabet::Symbol, tree::NonlinearAlphabet > { public: static bool used ( const tree::UnrankedNonlinearPattern &, const alphabet::Symbol & ) { return false; @@ -161,7 +161,7 @@ public: }; template < > -class ElementConstraint2< tree::UnrankedNonlinearPattern, alphabet::Symbol, tree::SubtreeWildcard > { +class ElementConstraint< tree::UnrankedNonlinearPattern, alphabet::Symbol, tree::SubtreeWildcard > { public: static bool available ( const tree::UnrankedNonlinearPattern & pattern, const alphabet::Symbol & symbol ) { return pattern.accessComponent < tree::GeneralAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/tree/unranked/UnrankedPattern.cpp b/alib2data/src/tree/unranked/UnrankedPattern.cpp index 8e9d2c962f..6ced3384a9 100644 --- a/alib2data/src/tree/unranked/UnrankedPattern.cpp +++ b/alib2data/src/tree/unranked/UnrankedPattern.cpp @@ -25,7 +25,7 @@ namespace tree { -UnrankedPattern::UnrankedPattern ( alphabet::Symbol subtreeWildcard, std::set < alphabet::Symbol > alphabet, UnrankedNode pattern ) : std::Components2 < UnrankedPattern, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( alphabet ) ), std::make_tuple ( std::move ( subtreeWildcard ) ) ), pattern ( nullptr ) { +UnrankedPattern::UnrankedPattern ( alphabet::Symbol subtreeWildcard, std::set < alphabet::Symbol > alphabet, UnrankedNode pattern ) : std::Components < UnrankedPattern, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( alphabet ) ), std::make_tuple ( std::move ( subtreeWildcard ) ) ), pattern ( nullptr ) { setTree ( std::move ( pattern ) ); } @@ -35,11 +35,11 @@ UnrankedPattern::UnrankedPattern ( alphabet::Symbol subtreeWildcard, UnrankedNod UnrankedPattern::UnrankedPattern ( const RankedPattern & other ) : UnrankedPattern ( other.getSubtreeWildcard ( ).getSymbol ( ), TreeAuxiliary::unrankSymbols ( other.getAlphabet ( ) ), other.getRoot ( ).asUnranked ( ) ) { } -UnrankedPattern::UnrankedPattern ( const UnrankedPattern & other ) : std::Components2 < UnrankedPattern, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( other.getAlphabet ( ) ), std::make_tuple ( other.getSubtreeWildcard ( ) ) ), pattern ( other.pattern ) { +UnrankedPattern::UnrankedPattern ( const UnrankedPattern & other ) : std::Components < UnrankedPattern, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( other.getAlphabet ( ) ), std::make_tuple ( other.getSubtreeWildcard ( ) ) ), pattern ( other.pattern ) { this->pattern->attachAlphabet ( & ( this->getAlphabet ( ) ) ); } -UnrankedPattern::UnrankedPattern ( UnrankedPattern && other ) noexcept : std::Components2 < UnrankedPattern, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( other.accessComponent < GeneralAlphabet > ( ).get ( ) ) ), std::make_tuple ( std::move ( other.accessElement < SubtreeWildcard > ( ).get ( ) ) ) ), pattern ( std::move ( other.pattern ) ) { +UnrankedPattern::UnrankedPattern ( UnrankedPattern && other ) noexcept : std::Components < UnrankedPattern, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > ( std::make_tuple ( std::move ( other.accessComponent < GeneralAlphabet > ( ).get ( ) ) ), std::make_tuple ( std::move ( other.accessElement < SubtreeWildcard > ( ).get ( ) ) ) ), pattern ( std::move ( other.pattern ) ) { this->pattern->attachAlphabet ( & ( this->getAlphabet ( ) ) ); } diff --git a/alib2data/src/tree/unranked/UnrankedPattern.h b/alib2data/src/tree/unranked/UnrankedPattern.h index 74e6bd25a1..11f6ce9935 100644 --- a/alib2data/src/tree/unranked/UnrankedPattern.h +++ b/alib2data/src/tree/unranked/UnrankedPattern.h @@ -10,7 +10,7 @@ #include <string> #include <set> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../TreeException.h" #include "UnrankedNode.h" @@ -29,7 +29,7 @@ class SubtreeWildcard; * Represents regular expression parsed from the XML. Regular expression is stored * as a pattern of RegExpElement. */ -class UnrankedPattern : public UnrankedTreeBase, public std::Components2 < UnrankedPattern, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > { +class UnrankedPattern : public UnrankedTreeBase, public std::Components < UnrankedPattern, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < SubtreeWildcard > > { std::smart_ptr < UnrankedNode > pattern; public: @@ -120,7 +120,7 @@ public: namespace std { template < > -class ComponentConstraint2< tree::UnrankedPattern, alphabet::Symbol, tree::GeneralAlphabet > { +class ComponentConstraint< tree::UnrankedPattern, alphabet::Symbol, tree::GeneralAlphabet > { public: static bool used ( const tree::UnrankedPattern & pattern, const alphabet::Symbol & symbol ) { return pattern.getRoot ( ).testSymbol ( symbol ) || pattern.accessElement < tree::SubtreeWildcard > ( ).get ( ) == symbol; @@ -135,7 +135,7 @@ public: }; template < > -class ElementConstraint2< tree::UnrankedPattern, alphabet::Symbol, tree::SubtreeWildcard > { +class ElementConstraint< tree::UnrankedPattern, alphabet::Symbol, tree::SubtreeWildcard > { public: static bool available ( const tree::UnrankedPattern & pattern, const alphabet::Symbol & symbol ) { return pattern.accessComponent < tree::GeneralAlphabet > ( ).get ( ).count ( symbol ); diff --git a/alib2data/src/tree/unranked/UnrankedTree.cpp b/alib2data/src/tree/unranked/UnrankedTree.cpp index 828c9b52cb..c2839a8f3a 100644 --- a/alib2data/src/tree/unranked/UnrankedTree.cpp +++ b/alib2data/src/tree/unranked/UnrankedTree.cpp @@ -25,7 +25,7 @@ namespace tree { -UnrankedTree::UnrankedTree ( std::set < alphabet::Symbol > alphabet, UnrankedNode tree ) : std::Components2 < UnrankedTree, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ), tree ( nullptr ) { +UnrankedTree::UnrankedTree ( std::set < alphabet::Symbol > alphabet, UnrankedNode tree ) : std::Components < UnrankedTree, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ), tree ( nullptr ) { setTree ( std::move ( tree ) ); } @@ -35,11 +35,11 @@ UnrankedTree::UnrankedTree ( UnrankedNode pattern ) : UnrankedTree ( pattern.com UnrankedTree::UnrankedTree ( const RankedTree & other ) : UnrankedTree ( TreeAuxiliary::unrankSymbols ( other.getAlphabet ( ) ), other.getRoot ( ).asUnranked ( ) ) { } -UnrankedTree::UnrankedTree ( const UnrankedTree & other ) : std::Components2 < UnrankedTree, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( other.getAlphabet ( ) ), std::tuple < > ( ) ), tree ( other.tree ) { +UnrankedTree::UnrankedTree ( const UnrankedTree & other ) : std::Components < UnrankedTree, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( other.getAlphabet ( ) ), std::tuple < > ( ) ), tree ( other.tree ) { this->tree->attachAlphabet ( & ( this->getAlphabet ( ) ) ); } -UnrankedTree::UnrankedTree ( UnrankedTree && other ) noexcept : std::Components2 < UnrankedTree, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( other.accessComponent < GeneralAlphabet > ( ).get ( ) ) ), std::tuple < > ( ) ), tree ( std::move ( other.tree ) ) { +UnrankedTree::UnrankedTree ( UnrankedTree && other ) noexcept : std::Components < UnrankedTree, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( other.accessComponent < GeneralAlphabet > ( ).get ( ) ) ), std::tuple < > ( ) ), tree ( std::move ( other.tree ) ) { this->tree->attachAlphabet ( & ( this->getAlphabet ( ) ) ); } diff --git a/alib2data/src/tree/unranked/UnrankedTree.h b/alib2data/src/tree/unranked/UnrankedTree.h index 66529d4d57..49fcbd6366 100644 --- a/alib2data/src/tree/unranked/UnrankedTree.h +++ b/alib2data/src/tree/unranked/UnrankedTree.h @@ -10,7 +10,7 @@ #include <string> #include <set> -#include <core/components2.hpp> +#include <core/components.hpp> #include "../TreeException.h" #include "UnrankedNode.h" @@ -28,7 +28,7 @@ class GeneralAlphabet; * Represents regular expression parsed from the XML. Regular expression is stored * as a tree of RegExpElement. */ -class UnrankedTree : public UnrankedTreeBase, public std::Components2 < UnrankedTree, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > { +class UnrankedTree : public UnrankedTreeBase, public std::Components < UnrankedTree, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > { std::smart_ptr < UnrankedNode > tree; static std::set < alphabet::Symbol > unrankSymbols ( const std::set < alphabet::RankedSymbol > & alphabet ); @@ -117,7 +117,7 @@ public: namespace std { template < > -class ComponentConstraint2< tree::UnrankedTree, alphabet::Symbol, tree::GeneralAlphabet > { +class ComponentConstraint< tree::UnrankedTree, alphabet::Symbol, tree::GeneralAlphabet > { public: static bool used ( const tree::UnrankedTree & tree, const alphabet::Symbol & symbol ) { return tree.getRoot ( ).testSymbol ( symbol ); -- GitLab