|
mCRL2
|
Read-only balanced binary tree of terms. More...
#include <aterm_balanced_tree.h>
Classes | |
| class | iterator |
Public Types | |
| using | value_type = Term |
| The type of object, T stored in the term_balanced_tree. | |
| using | pointer = Term * |
| Pointer to T. | |
| using | reference = Term & |
| Reference to T. | |
| using | const_reference = const Term |
| Const reference to T. | |
| using | size_type = std::size_t |
| An unsigned integral type. | |
| using | difference_type = ptrdiff_t |
| A signed integral type. | |
Public Types inherited from atermpp::aterm | |
| using | size_type = std::size_t |
| An unsigned integral type. | |
| using | difference_type = ptrdiff_t |
| A signed integral type. | |
| using | iterator = term_appl_iterator< aterm > |
| Iterator used to iterate through an term_appl. | |
| using | const_iterator = term_appl_iterator< aterm > |
| Const iterator used to iterate through an term_appl. | |
Public Member Functions | |
| term_balanced_tree () | |
| Default constructor. Creates an empty tree. | |
| term_balanced_tree (const term_balanced_tree &) noexcept=default | |
| Copy constructor. | |
| term_balanced_tree (term_balanced_tree &&) noexcept=default | |
| Move constructor. | |
| term_balanced_tree & | operator= (const term_balanced_tree &) noexcept=default |
| Assignment operator. | |
| term_balanced_tree & | operator= (term_balanced_tree &&) noexcept=default |
| Move assign operator. | |
| term_balanced_tree (const aterm &tree) | |
| Construction from aterm. | |
| template<typename ForwardTraversalIterator > | |
| term_balanced_tree (ForwardTraversalIterator first, const std::size_t size) | |
| Creates an term_balanced_tree with a copy of a range. | |
| template<typename ForwardTraversalIterator , typename Transformer > | |
| term_balanced_tree (ForwardTraversalIterator first, const std::size_t size, Transformer transformer) | |
| Creates an term_balanced_tree with a copy of a range, where a transformer is applied to each term before adding it to the tree.. | |
| const aterm & | left_branch () const |
| Get the left branch of the tree. | |
| const aterm & | right_branch () const |
| Get the left branch of the tree. | |
| const Term & | operator[] (std::size_t position) const |
| Element indexing operator. | |
| const Term & | element_at (std::size_t position, std::size_t size) const |
| Get an element at the indicated position. | |
| size_type | size () const |
| Returns the size of the term_balanced_tree. | |
| bool | empty () const |
| Returns true if tree is empty. | |
| bool | is_node () const |
| Returns true iff the tree is a node with a left and right subtree. | |
| iterator | begin () const |
| Returns an iterator pointing to the beginning of the term_balanced_tree. | |
| iterator | end () const |
| Returns an iterator pointing to the end of the term_balanced_tree. | |
Public Member Functions inherited from atermpp::aterm | |
| aterm () | |
| Default constructor. | |
| aterm (const aterm &other) noexcept=default | |
| This class has user-declared copy constructor so declare default copy and move operators. | |
| aterm & | operator= (const aterm &other) noexcept=default |
| aterm (aterm &&other) noexcept=default | |
| aterm & | operator= (aterm &&other) noexcept=default |
| template<class ForwardIterator > requires (mcrl2::utilities::is_iterator<ForwardIterator>::value && !std::is_same_v<typename ForwardIterator::iterator_category, std::input_iterator_tag> && !std::is_same_v<typename ForwardIterator::iterator_category, std::output_iterator_tag>) | |
| aterm (const function_symbol &sym, ForwardIterator begin, ForwardIterator end) | |
| Constructor that provides an aterm based on a function symbol and forward iterator providing the arguments. | |
| template<class InputIterator > requires mcrl2::utilities::is_iterator<InputIterator> | |
| aterm (const function_symbol &sym, InputIterator begin, InputIterator end) | |
| Constructor that provides an aterm based on a function symbol and an input iterator providing the arguments. | |
| template<class InputIterator , class TermConverter > requires mcrl2::utilities::is_iterator<InputIterator> | |
| aterm (const function_symbol &sym, InputIterator begin, InputIterator end, TermConverter converter) | |
| Constructor. | |
| template<typename... Terms> | |
| aterm (const function_symbol &symbol, const Terms &... arguments) | |
| Constructor for n-arity function application. | |
| const function_symbol & | function () const |
| Returns the function symbol belonging to an aterm. | |
| size_type | size () const |
| Returns the number of arguments of this term. | |
| bool | empty () const |
| Returns true if the term has no arguments. | |
| const_iterator | begin () const |
| Returns an iterator pointing to the first argument. | |
| const_iterator | end () const |
| Returns a const_iterator pointing past the last argument. | |
| constexpr size_type | max_size () const |
| Returns the largest possible number of arguments. | |
| const aterm & | operator[] (const size_type i) const |
| Returns the i-th argument. | |
Public Member Functions inherited from atermpp::aterm_core | |
| aterm_core () noexcept | |
| Default constructor. | |
| ~aterm_core () noexcept | |
| Standard destructor. | |
| aterm_core (const detail::_aterm *t) noexcept | |
| Constructor based on an internal term data structure. This is not for public use. | |
| aterm_core (const aterm_core &other) noexcept | |
| Copy constructor. | |
| aterm_core (aterm_core &&other) noexcept | |
| Move constructor. | |
| aterm_core & | operator= (const aterm_core &other) noexcept |
| Assignment operator. | |
| aterm_core & | assign (const aterm_core &other, detail::thread_aterm_pool &pool) noexcept |
| Assignment operator, to be used if busy and forbidden flags are explicitly available. | |
| template<bool CHECK_BUSY_FLAG = true> | |
| aterm_core & | unprotected_assign (const aterm_core &other) noexcept |
| Assignment operator, to be used when the busy flags do not need to be set. | |
| aterm_core & | operator= (aterm_core &&other) noexcept |
| Move assignment operator. | |
Public Member Functions inherited from atermpp::unprotected_aterm_core | |
| unprotected_aterm_core () noexcept | |
| Default constuctor. | |
| unprotected_aterm_core (const detail::_aterm *term) noexcept | |
| Constructor. | |
| bool | type_is_appl () const noexcept |
| Dynamic check whether the term is an aterm. | |
| bool | type_is_int () const noexcept |
| Dynamic check whether the term is an aterm_int. | |
| bool | type_is_list () const noexcept |
| Dynamic check whether the term is an aterm_list. | |
| bool | operator== (const unprotected_aterm_core &t) const |
| Comparison operator. | |
| std::weak_ordering | operator<=> (const unprotected_aterm_core &t) const |
| Comparison operator for two unprotected aterms. | |
| bool | defined () const |
| Returns true if this term is not equal to the term assigned by the default constructor of aterms, aterm_appls and aterm_int. | |
| void | swap (unprotected_aterm_core &t) noexcept |
| Swaps this term with its argument. | |
| const function_symbol & | function () const |
| Yields the function symbol in an aterm. | |
Protected Member Functions | |
| term_balanced_tree (detail::_term_appl *t) | |
Protected Member Functions inherited from atermpp::aterm | |
| aterm (detail::_term_appl *t) | |
| Constructor. | |
Static Protected Member Functions | |
| static const function_symbol & | tree_empty_function () |
| static const function_symbol & | tree_single_node_function () |
| static const function_symbol & | tree_node_function () |
| static const aterm & | empty_tree () |
| template<typename ForwardTraversalIterator , class Transformer > | |
| static void | make_tree_helper (aterm &result, ForwardTraversalIterator &p, const std::size_t size, Transformer transformer) |
| template<typename ForwardTraversalIterator , class Transformer > | |
| static void | make_tree (aterm &result, ForwardTraversalIterator &p, const std::size_t size, Transformer transformer) |
Friends | |
| template<class Term1 , class ForwardTraversalIterator , class Transformer > | |
| void | make_term_balanced_tree (term_balanced_tree< Term1 > &result, ForwardTraversalIterator p, std::size_t size, Transformer transformer) |
Additional Inherited Members | |
Protected Attributes inherited from atermpp::unprotected_aterm_core | |
| const detail::_aterm * | m_term |
Read-only balanced binary tree of terms.
Definition at line 41 of file aterm_balanced_tree.h.
| using atermpp::term_balanced_tree< Term >::const_reference = const Term |
Const reference to T.
Definition at line 128 of file aterm_balanced_tree.h.
| using atermpp::term_balanced_tree< Term >::difference_type = ptrdiff_t |
A signed integral type.
Definition at line 134 of file aterm_balanced_tree.h.
| using atermpp::term_balanced_tree< Term >::pointer = Term* |
Pointer to T.
Definition at line 122 of file aterm_balanced_tree.h.
| using atermpp::term_balanced_tree< Term >::reference = Term& |
Reference to T.
Definition at line 125 of file aterm_balanced_tree.h.
| using atermpp::term_balanced_tree< Term >::size_type = std::size_t |
An unsigned integral type.
Definition at line 131 of file aterm_balanced_tree.h.
| using atermpp::term_balanced_tree< Term >::value_type = Term |
The type of object, T stored in the term_balanced_tree.
Definition at line 119 of file aterm_balanced_tree.h.
|
inlineexplicitprotected |
Definition at line 112 of file aterm_balanced_tree.h.
|
inline |
Default constructor. Creates an empty tree.
Definition at line 137 of file aterm_balanced_tree.h.
|
defaultnoexcept |
Copy constructor.
|
defaultnoexcept |
Move constructor.
|
inlineexplicit |
Construction from aterm.
Definition at line 154 of file aterm_balanced_tree.h.
|
inline |
Creates an term_balanced_tree with a copy of a range.
| first | The start of a range of elements. |
| size | The size of the range of elements. |
Definition at line 170 of file aterm_balanced_tree.h.
|
inline |
Creates an term_balanced_tree with a copy of a range, where a transformer is applied to each term before adding it to the tree..
| [in] | first | The start of a range of elements. |
| [in] | size | The size of the range of elements. |
| [in] | transformer | A class with an operator() that is applied to each term before adding it to the tree. |
Definition at line 181 of file aterm_balanced_tree.h.
|
inline |
Returns an iterator pointing to the beginning of the term_balanced_tree.
Definition at line 408 of file aterm_balanced_tree.h.
|
inline |
Get an element at the indicated position.
| position | The required position |
| size | The number of elements in the tree. This is required to make the complexity logarithmic. |
By providing the size this operation is logarithmic. If a wrong size is provided the outcome is not determined. See also operator [].
Definition at line 221 of file aterm_balanced_tree.h.
|
inline |
Returns true if tree is empty.
Definition at line 276 of file aterm_balanced_tree.h.
|
inlinestaticprotected |
Definition at line 54 of file aterm_balanced_tree.h.
|
inline |
Returns an iterator pointing to the end of the term_balanced_tree.
Definition at line 415 of file aterm_balanced_tree.h.
|
inline |
Returns true iff the tree is a node with a left and right subtree.
Definition at line 283 of file aterm_balanced_tree.h.
|
inline |
Get the left branch of the tree.
It is assumed that the tree is a node with a left branch.
Definition at line 189 of file aterm_balanced_tree.h.
|
inlinestaticprotected |
Definition at line 92 of file aterm_balanced_tree.h.
|
inlinestaticprotected |
Definition at line 57 of file aterm_balanced_tree.h.
|
defaultnoexcept |
Assignment operator.
|
defaultnoexcept |
Move assign operator.
|
inline |
Element indexing operator.
| position | Index in the tree. |
This operation behaves linearly with respect to container size, because it must calculate the size of the container. The operator element_at behaves logarithmically.
Definition at line 209 of file aterm_balanced_tree.h.
|
inline |
Get the left branch of the tree.
It is assumed that the tree is a node with a left branch.
Definition at line 198 of file aterm_balanced_tree.h.
|
inline |
Returns the size of the term_balanced_tree.
This operator is linear in the size of the balanced tree.
Definition at line 262 of file aterm_balanced_tree.h.
|
inlinestaticprotected |
Definition at line 51 of file aterm_balanced_tree.h.
|
inlinestaticprotected |
Definition at line 53 of file aterm_balanced_tree.h.
|
inlinestaticprotected |
Definition at line 52 of file aterm_balanced_tree.h.
|
friend |