mCRL2
Loading...
Searching...
No Matches
mcrl2::data::application Class Reference

An application of a data expression to a number of arguments. More...

#include <application.h>

Inheritance diagram for mcrl2::data::application:
mcrl2::data::data_expression atermpp::aterm atermpp::aterm_core atermpp::unprotected_aterm_core

Public Types

using const_iterator = atermpp::term_appl_iterator< data_expression >
 An iterator to traverse the arguments of an application.
 
- 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

 application ()
 Default constructor.
 
template<typename... Terms>
requires (std::conjunction_v<std::is_convertible<Terms, data_expression>...>)
 application (const data_expression &head, const data_expression &arg1, const Terms &... other_arguments)
 Constructor.
 
 application (const atermpp::aterm &term)
 Constructor.
 
template<typename Container >
requires (std::ranges::forward_range<Container> && std::is_convertible_v<std::ranges::range_value_t<Container>, data_expression>)
 application (const data_expression &head, const Container &arguments)
 Constructor.
 
template<typename FwdIter >
requires (!std::is_base_of_v<data_expression, FwdIter>)
 application (const data_expression &head, FwdIter first, FwdIter last)
 Constructor.
 
template<typename FwdIter >
requires (!std::is_base_of_v<data_expression, FwdIter>)
 application (const std::size_t arity, const data_expression &head, FwdIter first, FwdIter last)
 Constructor.
 
template<typename FwdIter , class ArgumentConverter >
requires (!std::is_base_of_v<data_expression, FwdIter> && !std::is_base_of_v<data_expression, ArgumentConverter>)
 application (const data_expression &head, FwdIter first, FwdIter last, ArgumentConverter convert_arguments, const bool skip_first_argument=false)
 Constructor.
 
template<typename FwdIter , class ArgumentConverter >
requires (!std::is_base_of_v<data_expression, FwdIter> && !std::is_base_of_v<data_expression, ArgumentConverter> && std::is_same_v<std::invoke_result_t<ArgumentConverter, data_expression&, typename FwdIter::value_type>, void>)
 application (const data_expression &head, FwdIter first, FwdIter last, ArgumentConverter convert_arguments, const bool skip_first_argument=false)
 Constructor.
 
 application (const application &) noexcept=default
 Move semantics.
 
 application (application &&) noexcept=default
 
applicationoperator= (const application &) noexcept=default
 
applicationoperator= (application &&) noexcept=default
 
const data_expressionhead () const
 Get the function at the head of this expression.
 
const data_expressionoperator[] (std::size_t index) const
 Get the i-th argument of this expression.
 
const_iterator begin () const
 Returns an iterator pointing to the first argument of the application.
 
const_iterator end () const
 Returns an iterator pointing past the last argument of the application.
 
std::size_t size () const
 
- Public Member Functions inherited from mcrl2::data::data_expression
 data_expression ()
 \brief Default constructor X3.
 
 data_expression (const atermpp::aterm &term)
 
 data_expression (const data_expression &) noexcept=default
 Move semantics.
 
 data_expression (data_expression &&) noexcept=default
 
data_expressionoperator= (const data_expression &) noexcept=default
 
data_expressionoperator= (data_expression &&) noexcept=default
 
bool is_default_data_expression () const
 A function to efficiently determine whether a data expression is made by the default constructor.
 
application operator() (const data_expression &e) const
 Apply a data expression to a data expression.
 
application operator() (const data_expression &e1, const data_expression &e2) const
 Apply a data expression to two data expressions.
 
application operator() (const data_expression &e1, const data_expression &e2, const data_expression &e3) const
 Apply a data expression to three data expressions.
 
application operator() (const data_expression &e1, const data_expression &e2, const data_expression &e3, const data_expression &e4) const
 Apply a data expression to four data expressions.
 
application operator() (const data_expression &e1, const data_expression &e2, const data_expression &e3, const data_expression &e4, const data_expression &e5) const
 Apply a data expression to five data expressions.
 
application operator() (const data_expression &e1, const data_expression &e2, const data_expression &e3, const data_expression &e4, const data_expression &e5, const data_expression &e6) const
 Apply a data expression to six data expressions.
 
sort_expression sort () const
 Returns the sort of the data expression.
 
- 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.
 
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.
 

Private Types

using iterator = data_expression::iterator
 

Additional Inherited Members

- Protected Member Functions inherited from atermpp::aterm
 aterm (detail::_term_appl *t)
 Constructor.
 
- Protected Attributes inherited from atermpp::unprotected_aterm_core
const detail::_atermm_term
 

Detailed Description

An application of a data expression to a number of arguments.

Definition at line 336 of file application.h.

Member Typedef Documentation

◆ const_iterator

An iterator to traverse the arguments of an application.

There is a subtle difference with the arguments of an iterator on the arguments of an aterm from which an application is derived. As an application has a head as its first argument, the iterator of the aterm starts at this head, where the iterator of the application starts at the first argument. This also means that t[n] for t an application is equal to t[n+1] if t is interpreted as an aterm.

Definition at line 394 of file application.h.

◆ iterator

Constructor & Destructor Documentation

◆ application() [1/10]

mcrl2::data::application::application ( )
inline

Default constructor.

Definition at line 340 of file application.h.

◆ application() [2/10]

template<typename... Terms>
requires (std::conjunction_v<std::is_convertible<Terms, data_expression>...>)
mcrl2::data::application::application ( const data_expression head,
const data_expression arg1,
const Terms &...  other_arguments 
)
inline

Constructor.

Definition at line 346 of file application.h.

◆ application() [3/10]

mcrl2::data::application::application ( const atermpp::aterm term)
inlineexplicit

Constructor.

Parameters
termA term

Definition at line 358 of file application.h.

◆ application() [4/10]

template<typename Container >
requires (std::ranges::forward_range<Container> && std::is_convertible_v<std::ranges::range_value_t<Container>, data_expression>)
mcrl2::data::application::application ( const data_expression head,
const Container &  arguments 
)
inline

Constructor.

Definition at line 368 of file application.h.

◆ application() [5/10]

template<typename FwdIter >
requires (!std::is_base_of_v<data_expression, FwdIter>)
mcrl2::data::application::application ( const data_expression head,
FwdIter  first,
FwdIter  last 
)
inline

Constructor.

Definition at line 399 of file application.h.

◆ application() [6/10]

template<typename FwdIter >
requires (!std::is_base_of_v<data_expression, FwdIter>)
mcrl2::data::application::application ( const std::size_t  arity,
const data_expression head,
FwdIter  first,
FwdIter  last 
)
inline

Constructor.

Definition at line 413 of file application.h.

◆ application() [7/10]

template<typename FwdIter , class ArgumentConverter >
requires (!std::is_base_of_v<data_expression, FwdIter> && !std::is_base_of_v<data_expression, ArgumentConverter>)
mcrl2::data::application::application ( const data_expression head,
FwdIter  first,
FwdIter  last,
ArgumentConverter  convert_arguments,
const bool  skip_first_argument = false 
)
inline

Constructor.

Construct at term head(arg_first,...,arg_last) where convert_arguments has been applied to the head and all the arguments. \parameter head This is the new head for the application. \parameter first This is a forward iterator yielding the first argument. \parameter last This is an iterator beyond the last argument. \parameter convert_arguments This is a function applied to optionally the head and the arguments. \parameter skip_first_argument A boolean which is true if the function must not be applied to the head.

Definition at line 437 of file application.h.

◆ application() [8/10]

template<typename FwdIter , class ArgumentConverter >
requires (!std::is_base_of_v<data_expression, FwdIter> && !std::is_base_of_v<data_expression, ArgumentConverter> && std::is_same_v<std::invoke_result_t<ArgumentConverter, data_expression&, typename FwdIter::value_type>, void>)
mcrl2::data::application::application ( const data_expression head,
FwdIter  first,
FwdIter  last,
ArgumentConverter  convert_arguments,
const bool  skip_first_argument = false 
)
inline

Constructor.

Construct at term head(arg_first,...,arg_last) where convert_arguments has been applied to the head and all the arguments. \parameter head This is the new head for the application. \parameter first This is a forward iterator yielding the first argument. \parameter last This is an iterator beyond the last argument. \parameter convert_arguments This is a function applied to optionally the head and the arguments. \parameter skip_first_argument A boolean which is true if the function must not be applied to the head.

Definition at line 464 of file application.h.

◆ application() [9/10]

mcrl2::data::application::application ( const application )
defaultnoexcept

Move semantics.

◆ application() [10/10]

mcrl2::data::application::application ( application &&  )
defaultnoexcept

Member Function Documentation

◆ begin()

const_iterator mcrl2::data::application::begin ( ) const
inline

Returns an iterator pointing to the first argument of the application.

Definition at line 500 of file application.h.

◆ end()

const_iterator mcrl2::data::application::end ( ) const
inline

Returns an iterator pointing past the last argument of the application.

Definition at line 507 of file application.h.

◆ head()

const data_expression & mcrl2::data::application::head ( ) const
inline

Get the function at the head of this expression.

Definition at line 486 of file application.h.

◆ operator=() [1/2]

application & mcrl2::data::application::operator= ( application &&  )
defaultnoexcept

◆ operator=() [2/2]

application & mcrl2::data::application::operator= ( const application )
defaultnoexcept

◆ operator[]()

const data_expression & mcrl2::data::application::operator[] ( std::size_t  index) const
inline

Get the i-th argument of this expression.

Definition at line 492 of file application.h.

◆ size()

std::size_t mcrl2::data::application::size ( ) const
inline
Returns
The number of arguments of this application.

Definition at line 513 of file application.h.


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