mCRL2
Loading...
Searching...
No Matches
atermpp::aterm Class Reference

#include <aterm.h>

Inheritance diagram for atermpp::aterm:
atermpp::aterm_core atermpp::unprotected_aterm_core atermpp::term_list< variable_with_a_rational_factor > atermpp::term_list< variable > atermpp::term_list< action_label > atermpp::term_list< lps::state > atermpp::term_list< match_tree_list > atermpp::term_list< match_tree_list_list > atermpp::term_list< data_expression > atermpp::term_list< assignment > atermpp::aterm_int atermpp::aterm_string atermpp::term_balanced_tree< Term > atermpp::term_list< Term > mcrl2::action_formulas::action_formula mcrl2::data::alias mcrl2::data::assignment_expression mcrl2::data::binder_type mcrl2::data::container_type mcrl2::data::data_equation mcrl2::data::data_expression mcrl2::data::detail::match_tree mcrl2::data::detail::variable_or_number mcrl2::data::detail::variable_with_a_rational_factor mcrl2::data::linear_inequality mcrl2::data::sort_expression mcrl2::data::structured_sort_constructor mcrl2::data::structured_sort_constructor_argument mcrl2::data::untyped_data_parameter mcrl2::lps::multi_action mcrl2::lps::process_initializer mcrl2::lps::stochastic_distribution mcrl2::pbes_system::fixpoint_symbol mcrl2::pbes_system::pbes_expression mcrl2::pbes_system::propositional_variable mcrl2::pres_system::pres_expression mcrl2::process::action_label mcrl2::process::action_name_multiset mcrl2::process::communication_expression mcrl2::process::process_equation mcrl2::process::process_expression mcrl2::process::process_identifier mcrl2::process::rename_expression mcrl2::process::untyped_multi_action mcrl2::regular_formulas::regular_formula mcrl2::state_formulas::state_formula

Public Types

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

 aterm ()
 Default constructor.
 
 aterm (const aterm &other) noexcept=default
 This class has user-declared copy constructor so declare default copy and move operators.
 
atermoperator= (const aterm &other) noexcept=default
 
 aterm (aterm &&other) noexcept=default
 
atermoperator= (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_symbolfunction () 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 atermoperator[] (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_coreoperator= (const aterm_core &other) noexcept
 Assignment operator.
 
aterm_coreassign (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_coreunprotected_assign (const aterm_core &other) noexcept
 Assignment operator, to be used when the busy flags do not need to be set.
 
aterm_coreoperator= (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_symbolfunction () const
 Yields the function symbol in an aterm.
 

Protected Member Functions

 aterm (detail::_term_appl *t)
 Constructor.
 

Additional Inherited Members

- Protected Attributes inherited from atermpp::unprotected_aterm_core
const detail::_atermm_term
 

Detailed Description

Definition at line 27 of file aterm.h.

Member Typedef Documentation

◆ const_iterator

Const iterator used to iterate through an term_appl.

Definition at line 48 of file aterm.h.

◆ difference_type

A signed integral type.

Definition at line 42 of file aterm.h.

◆ iterator

Iterator used to iterate through an term_appl.

Definition at line 45 of file aterm.h.

◆ size_type

using atermpp::aterm::size_type = std::size_t

An unsigned integral type.

Definition at line 39 of file aterm.h.

Constructor & Destructor Documentation

◆ aterm() [1/8]

atermpp::aterm::aterm ( detail::_term_appl t)
inlineexplicitprotected

Constructor.

Parameters
tA pointer internal data structure from which the term is constructed.

This function is explicitly protected such that is not used in common code.

Definition at line 33 of file aterm.h.

◆ aterm() [2/8]

atermpp::aterm::aterm ( )
inline

Default constructor.

Definition at line 51 of file aterm.h.

◆ aterm() [3/8]

atermpp::aterm::aterm ( const aterm other)
defaultnoexcept

This class has user-declared copy constructor so declare default copy and move operators.

◆ aterm() [4/8]

atermpp::aterm::aterm ( aterm &&  other)
defaultnoexcept

◆ aterm() [5/8]

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>)
atermpp::aterm::aterm ( const function_symbol sym,
ForwardIterator  begin,
ForwardIterator  end 
)
inline

Constructor that provides an aterm based on a function symbol and forward iterator providing the arguments.

The iterator range is traversed more than once. If only one traversal is required use term_appl with a TermConverter argument. But this function is substantially less efficient. The length of the iterator range must match the arity of the function symbol.

Parameters
symA function symbol.
beginThe start of a range of elements.
endThe end of a range of elements.

Definition at line 70 of file aterm.h.

◆ aterm() [6/8]

template<class InputIterator >
requires mcrl2::utilities::is_iterator<InputIterator>
atermpp::aterm::aterm ( const function_symbol sym,
InputIterator  begin,
InputIterator  end 
)
inline

Constructor that provides an aterm based on a function symbol and an input iterator providing the arguments.

The given iterator is traversed only once. So it can be used with an input iterator. This means that the TermConverter is applied exactly once to each element. The length of the iterator range must be equal to the arity of the function symbol.

Parameters
symA function symbol.
beginThe start of a range of elements.
endThe end of a range of elements.

Definition at line 86 of file aterm.h.

◆ aterm() [7/8]

template<class InputIterator , class TermConverter >
requires mcrl2::utilities::is_iterator<InputIterator>
atermpp::aterm::aterm ( const function_symbol sym,
InputIterator  begin,
InputIterator  end,
TermConverter  converter 
)
inline

Constructor.

The given iterator is traversed only once. So it can be used with an input iterator. This means that the TermConverter is applied exactly once to each element. The length of the iterator range must be equal to the arity of the function symbol.

Parameters
symA function symbol.
beginThe start of a range of elements.
endThe end of a range of elements.
converterAn class or lambda term containing an operator Term operator()(const Term& t) which is applied to each each element in the iterator range before it becomes an argument of this term.
symA function symbol.

Definition at line 104 of file aterm.h.

◆ aterm() [8/8]

template<typename... Terms>
atermpp::aterm::aterm ( const function_symbol symbol,
const Terms &...  arguments 
)
inline

Constructor for n-arity function application.

Parameters
symbolA function symbol.
argumentsThe arguments of the function application.

Definition at line 120 of file aterm.h.

Member Function Documentation

◆ begin()

const_iterator atermpp::aterm::begin ( ) const
inline

Returns an iterator pointing to the first argument.

Returns
An iterator pointing to the first argument.

Definition at line 139 of file aterm.h.

◆ empty()

bool atermpp::aterm::empty ( ) const
inline

Returns true if the term has no arguments.

Returns
True if this term has no arguments.

Definition at line 135 of file aterm.h.

◆ end()

const_iterator atermpp::aterm::end ( ) const
inline

Returns a const_iterator pointing past the last argument.

Returns
A const_iterator pointing past the last argument.

Definition at line 146 of file aterm.h.

◆ function()

const function_symbol & atermpp::aterm::function ( ) const
inline

Returns the function symbol belonging to an aterm.

Returns
The function symbol of this term.

Definition at line 127 of file aterm.h.

◆ max_size()

constexpr size_type atermpp::aterm::max_size ( ) const
inlineconstexpr

Returns the largest possible number of arguments.

Returns
The largest possible number of arguments.

Definition at line 153 of file aterm.h.

◆ operator=() [1/2]

aterm & atermpp::aterm::operator= ( aterm &&  other)
defaultnoexcept

◆ operator=() [2/2]

aterm & atermpp::aterm::operator= ( const aterm other)
defaultnoexcept

◆ operator[]()

const aterm & atermpp::aterm::operator[] ( const size_type  i) const
inline

Returns the i-th argument.

Parameters
iA positive integer.
Returns
The argument with the given index.

Definition at line 158 of file aterm.h.

◆ size()

size_type atermpp::aterm::size ( ) const
inline

Returns the number of arguments of this term.

Returns
The number of arguments of this term.

Definition at line 131 of file aterm.h.


The documentation for this class was generated from the following file: