mCRL2
|
Read-only balanced binary tree of terms. More...
#include <aterm_balanced_tree.h>
Classes | |
class | iterator |
Public Types | |
typedef Term | value_type |
The type of object, T stored in the term_balanced_tree. | |
typedef Term * | pointer |
Pointer to T. | |
typedef Term & | reference |
Reference to T. | |
typedef const Term | const_reference |
Const reference to T. | |
typedef std::size_t | size_type |
An unsigned integral type. | |
typedef ptrdiff_t | difference_type |
A signed integral type. | |
![]() | |
typedef aterm | value_type |
The type of object, T stored in the term_appl. | |
typedef aterm * | pointer |
Pointer to T. | |
typedef aterm & | reference |
Reference to T. | |
typedef const aterm | const_reference |
Const reference to T. | |
typedef std::size_t | size_type |
An unsigned integral type. | |
typedef ptrdiff_t | difference_type |
A signed integral type. | |
typedef term_appl_iterator< aterm > | iterator |
Iterator used to iterate through an term_appl. | |
typedef term_appl_iterator< aterm > | const_iterator |
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. | |
![]() | |
term_appl () | |
Default constructor. | |
term_appl (const aterm &t) | |
Explicit constructor from an aterm. | |
term_appl (const term_appl &other) noexcept=default | |
This class has user-declared copy constructor so declare default copy and move operators. | |
term_appl (term_appl &&other) noexcept=default | |
term_appl (const function_symbol &sym, ForwardIterator begin, ForwardIterator end) | |
Constructor that provides an aterm_appl based on a function symbol and forward iterator providing the arguments. | |
term_appl (const function_symbol &sym, InputIterator begin, InputIterator end) | |
Constructor that provides an aterm_appl based on a function symbol and an input iterator providing the arguments. | |
term_appl (const function_symbol &sym, InputIterator begin, InputIterator end, TermConverter converter) | |
term_appl (const function_symbol &sym) | |
Constructor. | |
term_appl (const function_symbol &symbol, const Terms &...arguments) | |
Constructor for n-arity function application. | |
term_appl & | operator= (const term_appl &other) noexcept=default |
term_appl & | operator= (term_appl &&other) noexcept=default |
const function_symbol & | function () const |
Returns the function symbol belonging to an aterm_appl. | |
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. | |
![]() | |
aterm () noexcept | |
Default constructor. | |
~aterm () noexcept | |
Standard destructor. | |
aterm (const detail::_aterm *t) noexcept | |
Constructor based on an internal term data structure. This is not for public use. | |
aterm (const aterm &other) noexcept | |
Copy constructor. | |
aterm (aterm &&other) noexcept | |
Move constructor. | |
aterm & | operator= (const aterm &other) noexcept |
Assignment operator. | |
aterm & | assign (const aterm &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 & | unprotected_assign (const aterm &other) noexcept |
Assignment operator, to be used when the busy flags do not need to be set. | |
aterm & | operator= (aterm &&other) noexcept |
Move assignment operator. | |
![]() | |
unprotected_aterm () noexcept | |
Default constuctor. | |
unprotected_aterm (const detail::_aterm *term) noexcept | |
Constructor. | |
bool | type_is_appl () const noexcept |
Dynamic check whether the term is an aterm_appl. | |
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 &t) const |
Comparison operator. | |
bool | operator!= (const unprotected_aterm &t) const |
Inequality operator on two unprotected aterms. | |
bool | operator< (const unprotected_aterm &t) const |
Comparison operator for two unprotected aterms. | |
bool | operator> (const unprotected_aterm &t) const |
Comparison operator for two unprotected aterms. | |
bool | operator<= (const unprotected_aterm &t) const |
Comparison operator for two unprotected aterms. | |
bool | operator>= (const unprotected_aterm &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, term_appl<T>'s and aterm_int. | |
void | swap (unprotected_aterm &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) | |
![]() | |
term_appl (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_appl & | 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, const std::size_t size, Transformer transformer) |
Additional Inherited Members | |
![]() | |
const detail::_aterm * | m_term |
Read-only balanced binary tree of terms.
Definition at line 44 of file aterm_balanced_tree.h.
typedef const Term atermpp::term_balanced_tree< Term >::const_reference |
Const reference to T.
Definition at line 126 of file aterm_balanced_tree.h.
typedef ptrdiff_t atermpp::term_balanced_tree< Term >::difference_type |
A signed integral type.
Definition at line 132 of file aterm_balanced_tree.h.
typedef Term* atermpp::term_balanced_tree< Term >::pointer |
Pointer to T.
Definition at line 120 of file aterm_balanced_tree.h.
typedef Term& atermpp::term_balanced_tree< Term >::reference |
Reference to T.
Definition at line 123 of file aterm_balanced_tree.h.
typedef std::size_t atermpp::term_balanced_tree< Term >::size_type |
An unsigned integral type.
Definition at line 129 of file aterm_balanced_tree.h.
typedef Term atermpp::term_balanced_tree< Term >::value_type |
The type of object, T stored in the term_balanced_tree.
Definition at line 117 of file aterm_balanced_tree.h.
|
inlineexplicitprotected |
Definition at line 110 of file aterm_balanced_tree.h.
|
inline |
Default constructor. Creates an empty tree.
Definition at line 135 of file aterm_balanced_tree.h.
|
defaultnoexcept |
Copy constructor.
|
defaultnoexcept |
Move constructor.
|
inlineexplicit |
Construction from aterm.
Definition at line 152 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 168 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 179 of file aterm_balanced_tree.h.
|
inline |
Returns an iterator pointing to the beginning of the term_balanced_tree.
Definition at line 407 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 219 of file aterm_balanced_tree.h.
|
inline |
Returns true if tree is empty.
Definition at line 275 of file aterm_balanced_tree.h.
|
inlinestaticprotected |
Definition at line 58 of file aterm_balanced_tree.h.
|
inline |
Returns an iterator pointing to the end of the term_balanced_tree.
Definition at line 414 of file aterm_balanced_tree.h.
|
inline |
Returns true iff the tree is a node with a left and right subtree.
Definition at line 282 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 187 of file aterm_balanced_tree.h.
|
inlinestaticprotected |
Definition at line 90 of file aterm_balanced_tree.h.
|
inlinestaticprotected |
Definition at line 61 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 207 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 196 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 261 of file aterm_balanced_tree.h.
|
inlinestaticprotected |
Definition at line 55 of file aterm_balanced_tree.h.
|
inlinestaticprotected |
Definition at line 57 of file aterm_balanced_tree.h.
|
inlinestaticprotected |
Definition at line 56 of file aterm_balanced_tree.h.
|
friend |