diff --git a/alib2common/src/core/components.hpp b/alib2common/src/core/components.hpp index 89c49c6e094cf4c1e07a8ab5edb6a3c34399b0f4..27376408dc1c2eb113b0d7ae1161996f4683c5ed 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 d26c56187084e8fc6229c37496a5bcee9681f2c2..0000000000000000000000000000000000000000 --- 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 2715cfc7e2ce353c6e9fe477cbbf458e5872277d..a3ee2b581686ccc9af60edbcd0139fbbcbedc791 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 c2eba0547d0d992806c066d1096f910c8298e608..0c041a9eaa79ec28ca6a324158b1136eea5bca21 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 5452ee8403f89b0dfc1ed0087e0e06159ee3fe5d..25af1abaf6af49d657eb39696f30bd1713cbcf7d 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 676c9233e14dba02a15ef2762ce8a3ed2573f36a..16438c6a91d4f70b1000eb8ec2d37e8bee9cea08 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 0660b4680fa16f78317497ed7c0bfc9434bebc39..fbee8070d0bef9d561ae4001c78e993fa0c5bcec 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 99ee59dffe918e070b1bafed1985a851cf3450b5..a294db6d218bc57688e736696181588f9f3917f5 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 2c767668c0029e9da67593b1a954a9a5b42b7e32..8f6bb4e3e4f16b5533e44bf9a2d5c107c90add06 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 81ae24b425552488e6623edfda13aa7537ad4955..eeb7ab28f5218fdefabbe2a4f50cd67aa3b50ca3 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 fbbe3fab974640a1c8acd2fd49792618a607da10..e2480b77a7732d32e760e177fb90a3171682f3b1 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 371bb6cddc7c8272cc1ffdc8dd0a086c946b833c..7874e4e8e012d97eb999de97d58bd3d8d9661d75 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 2cd5835b4289241b0ba9b272a5dc7e6c8ecb764b..6525b93238927af39044d283321c50405cb81d73 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 9c2e9f68e83ec56b6190eeca89f153bd584f876e..a79148e42ad3852eaf2f775b54fe990de0eac807 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 e563d6222ff97bf5ed71e7ae59fb4a4b3e424212..cbfb015638663167b6b6cb85277fa30cd5ca82a9 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 23918f00b93d20ea6e956afca93640542cf6f1e6..2f46a33ec23a813d70e83ea811ca6e9d620c7a9f 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 021bdb0b43f3432ca0ea3b5492d4b457aac7b575..5bbb972e106f6ea43459e5daa8e7161adb5d186e 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 bed763e973ce1b6aeb89c7b21eca8191c7914111..ab6ba18350996037ad7daa326a5a02112055914c 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 2584a7c9ca3ae48a81cc4a03d9cd41f58ff6ccd5..b6d25612e606a21855a6ad4deb6828bb39cbeb58 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 abd4b6f1d01b9b7d01256a794cd3f34d38c1e72c..539ce7a125815253ba2d83b5f018a795c610110b 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 393ebc8e7c5d05bb1c5a097f0958ab421b1a1bca..942690987c6e8b9a3899d94e0768870fe7fd9b7d 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 c847bb3a7210bc564232eb51705ff7e5fa5b176c..1c4b4c93ee93742b8f0c785a25673ce7460d0b8c 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 7f44a8bcdc567974a97895d01743a1000b37a59d..47b8294fdf3e126d2df7db35518746f69f1b49bb 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 852b47a2701267fb17277e21158e68a8909a2a70..51cb90c197c317a211b037c8888103c27126c530 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 224886688f74458cb9139a9fa187f29339423322..e1c9bffb87daec3dde6e6b202153b1e67e32e0e5 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 ca6199f3d7840932c911076feb1be55628b7cd7b..e14c008aaaff53d7438ac5bbf41869ea9bccf940 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 99ea87d1fa415b64b8dd2e9c2a91906bf87c67ca..c5d59a87655b2417b873b8308700f475674e7b3f 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 7ee296ef4a807a9aad445cb1e3d59cd028f30f42..3b946f4f09faf9974ace7f073f610ed73d81f8eb 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 7944ab776d5e4bf03ba2f9ebf2d36e15ab3a6134..e42f3e7a0b0e6d67e706a835609a068ab9147b39 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 72a521238d528c0ce52ed3f0b6020df8e5a393b3..1890b5dd84a2a9084ccc42fce0b6d31d82ef82c5 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 5f696fc48a6cfb1b9639307adea1e82d82f51ad0..01309eaf503b6fe1eaea0a2184e4ae978d9d0c32 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 f2d609bd5af0448bf653d3892ff91288bacef5b7..171b9f7aec12ecde52e3a0af5bcbe4b95020df9b 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 ae4d2d1b33c1e94624ed244310692b999c7be000..c716c22d74e01c8f0594cbb986ce80cec2e5d7aa 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 62bcfbabfee69e833eabaa8e3c45596bac83ef5e..b94fb28776aef1bb46c98ec87c634e5436e2b8ac 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 69a44031381352aa5ba897655e248c651f035e05..3c0a49772c131c891f04f8e23860674129014a8a 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 8eaed1f632c7ffae104be47f56efb41da06e216c..c37d2c7a5000d8e8eedc7c7cee396dd041a32329 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 85e4a77122d7ce1fa6b11bd521442dfa337de3ac..52a78371f4baff25f23a7250f7d51ea0cf9d562d 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 f5d166e84e3ff9297c36a36879c3bf493e8ceff3..97e7398963106a77812ae54402576af2e2cd1266 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 73b8c1c02bf7d8280ff49fe27e4bd4da1b88e44d..fd4b16d52fc25f4d94a5b03ee127eaa0f768be99 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 d5271d46be7b5cbc96fce48340df4a6a371cb38b..514ac1f9884a7d97e89ec8f18d920d75613dc40b 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 4ac94c13f0c4df080054dfda3eff33b54bff497a..c43296657772d402799e05a6260c72c1ced3043c 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 3b4cc1728bdcbbc431c958a930e22ef39023696f..92ca252502345eec372c078d54c65c5bb1707b04 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 c41aac391dc6f8d396d5ca4049d1e598ea3fd8cc..16ea5660bfea30a0f117c9cef49a1c554bf0dc6f 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 6d3aa43d0029a5dfe95bb99c02fdb9b3abab465f..027b90c3ba0bf67882ada29d95d67dc65674f6dd 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 4b934db22c2275fa57a897be5df5d40ef25e4e5c..4670e9c93c2b3eb5d83eda48273c4f803cc6d575 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 94dc9a4adc42a1e235a5393acfce2eba92f37590..8feb583ae0c89c653e231b75a0dd32eed8b0b4cf 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 b9c20afb8cd5d52f1228a210c5665ef1a7be0613..d3e6f5ff663c89e1bf5c81a6d309b18ce1c7bcdd 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 50d9a7abb7c1ccbc6b847a2068999ca6d967eb91..c88be3ad160f2f0918d22dc17d0197cf99504445 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 867a8d15949e43559a8313ff5ae0eaafdbfc19cd..cbaa86f695b58d77027e870225945b219b4c49f6 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 70cf0ce64e3537043a4b23174935cb5ae82751ee..9303d442bf0d8397913462b9f37e72458def8e75 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 3e1bce6405615b80e6f371bdc92a849f976001b1..1fe9c5e927fcfcaca8b8f015b318d64ca08e5b14 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 2a9ca5aa1d70c79d589830416c4b4311137ee523..cae483d506159e015a2b1fa2ea21eff0918d05d3 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 81c9d23697025e58b8cab65c0fc1899471211dd2..1cdf42359059a9c46af900ac5edb970a028acd50 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 6850e6633df83de275d3c81b1edd5c04c711c10a..8fe4dee71594ac1d398c36ba6c88aae368f47629 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 2d99fd2b29075689cf4f890070b897aedbd1b250..b96a6d063c39ed960ad04644252a2d9be558c14f 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 657814efeb35ce71d683af8cc6505934901c816f..46454841f5ee5ac6a46c99482a93af10e4ae2765 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 b7ad2dcab33a52e765e11788281271018701a912..193bcb9a765dd10425b2d6578604e1ef91e60d6c 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 0df14e182324b651f18bf5eb4a5fa9da97a710e1..5ba2f4a03050a3e7289e8edee57e2ad9ff87af43 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 381194ed8ecc1531c1d5ee281d919dd8a6fe8717..b28863cd3ac0221b3697972b8967d3db5e600a1d 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 d375774e96a1599340ca8081516e36f1f5f5eb72..c40b025c115cda51b96b1998a5af9131b59467d4 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 95f77b04669aa7b70bf5bb0790e5573a47e01dd5..8dd093249f2e18ef9ba63be5de3bb62d7a44bc2c 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 4ea483bcad6dd1ea01494eb5cc94a116bfcb49fc..6feeae791a5bb106d86ba9815edb54c3f7258703 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 506ef627620650db2383ae151ea1e971c6d4ca58..6378cc9205044af8dd41f0b9d3c28b3e595c7ace 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 74aae4238551cafc4899552858e37b65959b1692..e7bfcce4867c58c63a3482ed9ecc423c36dc9de8 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 2b1d3fd0d60953d59214a2f86be73aa4e2f9073d..91266d568b9ca74e460b700855b87d9f26527088 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 2c4894380e164f59b590b7a601278f55e3661af0..6a7ca1e3e9b818d8c2796e2e062142090e814d13 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 16fe60237655d2fcbf89f7caac9549481d62b93b..f9b89721298dde977552142a4485f81e6cb6dedd 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 33257a25ff5e78b7f5c71d37bd5d77dfd5117e8e..9679cfcee1b6b711e77d4863d61aedfdc65516ef 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 2ae172e00ec254d9ebf2a0caf191eb7116742abf..e42fd147d3abadb2911a0df98d0d8a46ba6ceae4 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 1bed73e9224f28606b7016776a3f64acf0882488..1253d4181e62b27cb40b8d873756e0664c7c5ed0 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 0d6740120b982bddd7e0749d5057ddeda1dcc197..b36af5d782c52d1527ecc792b57226c2777f8fc7 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 224f858ac122e66527bcad1ee31f2cb237993f40..79f305d0119221d29cef39864b98edb87afc5026 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 b3113b70a4ddc79f1b28e708a712ec6ecd991c9c..80973e788036c8803e4c98ec6545412c335fc36a 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 812d5a592f5f9d6543526647f6c07f69908c93b9..07cd85e215a21235834b71f33ae9493b12cb297a 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 038dc6db5fffa281621f88b3be2952a8cf29e3d4..3d67488551d9c970cf0ed85c4b6e8137aff68b46 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 f8053212a03fb8b923a3717aa87a334ebb80ae95..9e5fb8c19614cc8e6d91699d4ae71c6140a74e41 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 a8fd79293115dd8feb8499da989acb71ae15deca..ec015f73e4a4b4f0acff91f9bc5715ffbab8f9e2 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 15a944696ad0dececa28050386ac28c656811dea..75e8fd7b58a6202840d081ec3cf34ef2d895da04 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 a2fbdeeb2613b8e3a699cf79c3b002993a4cd45f..a66482ef98fd243618514311787c3f842b8002b6 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 447759ae47069366790aeeba1809e58925a9b5a7..12b248dd734d612882acd858836ef5f7218fb0f7 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 907e97ca8c98a607140b5800c0a23d0de7ee91e4..caa139bec5a07d62dac686e27cece12fa8d265ee 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 c7022f7fa7ef21830a23a4ea6bde992034b35406..826b925788eba86d0b170f49bea45b62522791c2 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 ede29924e84d0efe3a9bf2fbb839bf1a349d9814..91568e8c9ca1fa1a56b66aa20ac7b52633aa6811 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 3f87b65df46b356da9a9e4e820f783a5c415b935..2c346d5ca7054653e50661b69ff5961ac58fb255 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 f38569014f1cd9b6636dd42368d978a6fc38a2a8..0e8e438ffcf973abaed44f22baad747186655a69 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 598b75188aaee9bb3830d8f9c4414b5ed2c5abe8..e98617df938176b7d91dee39f1dad942d95b48fd 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 e2f9ef56bae5ecd6f65944cb0db2453fb8134e7e..99376d97d25684c12aa66a872363c4feaa76957e 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 768b55e8be947dcfa3021269c8d0926f4cab9f2b..532b1fee0576d09b294531a70637e5bb7f9fd127 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 1f450ea0e1ee402fa89de84974d4bd2972f15fde..38ee0a4ae80b29b8ac28d5a7e597060dc375a376 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 4e889a3fc9476046b13d18966a1d35b51e300371..2612cc6db7f5719a42ddcbb08abf5cbc70c1143f 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 c716d8efa3327763cb8857773d53d250000fb9a4..227dccd27cf6e130f13944c924a9aa3ce6e8169f 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 21e311ee85f18504cb6c227cb9ced207eb859858..951f5689dd5b6bba56fb793b8e9da600f851984a 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 e51e867b68279cee28b536e9ee6426c90d84f282..a204602cb42f3ba86c33d3d7ad21dfb29c39915b 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 a3eda5ef29d8065f9b2dcc132d433fa384e977d9..c1478cd47d4939d3ee8fd643ff54265c7f48f208 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 915e334c73b2c691c6395ddf8bc4843261ee4682..68572e7240cd7a1cc38ac9f12cabc9c08598232b 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 c5efa441ae4ebb1577bd926e4f38bca61ffc3cbb..043de48677aec2347cc9d307175595856eb38ec4 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 873c625f14b31178d0ca3b7a0e8957837d8f31d2..00260f4a59ce025a6221542facff28074c9e407c 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 5a4f270abc86700a01d73ca0d5489306d681b914..0867389e31daa94b6743d4cef92e15a43929f715 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 2d7ffec159272a5e9d646b92abf66c78ca994b1a..f90779d08d680fcbd2f92ad0e7535f9331e33b63 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 11dd146d2f964aa812380491637bec009f7d4ccf..3574cd73bc0fed9e38224af0e4489b2e4e668327 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 25a72b4c9e722800afcef51de1ea48805de2ce5e..ab64357f12dffdb5cb6cf199bed7c17289fa78f9 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 8f7e1f2c5e7f0ebcd49702323655f947eafafb79..56b467abb4a9a24bd5aeccaa17991912691c8537 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 d0fa2fedea4bf37506dd27bdde319dedccab7485..f58f4596968ff0bd0f6f32f61fa596d6eabefde1 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 0c42ca5e7d5fe4a447fdb4a429effe95dd0cefab..b1e5c2ee3feb68969b3cde2698dc1fa9280e8a74 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 5c7eec37d5409e9d08c6fe98d01cc43e2b5a6e91..1d32503457635f5e6f822f04b328aee7ddce216a 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 20894294ada4519c26d2702ad09644ecae201394..c2bc2d8185d68df4b34b446eb98cad2aab168098 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 2edf0e3f014a4d3baf5d346e9ed065e47bb2d5a5..c3004494b2a58455b6afcfd90eddfa8d2e531448 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 5afbb8baaea56c755124b6bc18693156860b9dd8..c354c0107fbedc2d26df5c172a3bcbb7bfb02c52 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 c4f03749d7f8da0c71fa81bbc630064f31a1ca89..3224ba0f6ef53e5f798205342a00c158d929bde8 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 8e9d2c962f7fc4a5ef636e7075835000eb9ea7e0..6ced3384a92dd46b30c5ee6db766cbea12ac890d 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 74e6bd25a1b7a1c978c22c367e088867931f7815..11f6ce9935f3e9a1b5890c96349a672344689dd9 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 828c9b52cb32a3da9a00ae4dd35ac7663d3d7c6e..c2839a8f3aea00804c2960284bbd118d09cedb61 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 66529d4d5761ad50eba2f0662ec656d74474e454..49fcbd6366553fbc10ef1ab2bb3ae2e6b141cea6 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 );