12#ifndef MCRL2_DATA_VARIABLE_H
16#ifndef MCRL2_DATA_APPLICATION_H
17#define MCRL2_DATA_APPLICATION_H
32template <
class IteratorTag>
47template <
class Iterator >
51 typedef std::iterator_traits<int*>
traits;
117 return *(this->
m_it);
127 return &*(this->
m_it);
154 return !(*
this==other);
185template <
class ArgumentConverter>
212template <
class ArgumentConverter>
247 const function_sort& fs=atermpp::down_cast<function_sort>(s);
279 typename std::enable_if<std::is_invocable_r<void, TERM, data_expression&>::value>::type* =
nullptr)
286template <
class TERM >
289 typename std::enable_if<std::is_invocable_r<const data_expression, TERM, void>::value>::type* =
nullptr)
294template <
class HEAD,
class CONTAINER>
316 typename CONTAINER::const_iterator i=l.begin();
333template <
class HEAD,
class... ARGUMENTS>
361 template<
typename ...Terms,
362 typename = std::enable_if_t<std::conjunction_v<std::is_convertible<Terms, data_expression>...>> >
365 const Terms& ...other_arguments
368 core::detail::function_symbol_DataAppl(sizeof...(Terms)+2),
head,
arg1,other_arguments...))
382 template <
typename Container>
384 const Container& arguments,
388 detail::term_appl_prepend_iterator<typename Container::
const_iterator>(arguments.
end())))
390 assert(arguments.size()>0);
413 template <
typename FwdIter>
417 typename std::enable_if< !std::is_base_of<data_expression, FwdIter>::value>::type* =
nullptr)
419 detail::term_appl_prepend_iterator<FwdIter>(first, &
head),
420 detail::term_appl_prepend_iterator<FwdIter>(last)))
427 template <
typename FwdIter>
432 typename std::enable_if< !std::is_base_of<data_expression, FwdIter>::value>::type* = 0)
434 detail::term_appl_prepend_iterator<FwdIter>(first, &
head),
435 detail::term_appl_prepend_iterator<FwdIter>(last)))
438 assert(std::distance(first, last)==arity);
451 template <
typename FwdIter,
class ArgumentConverter>
455 ArgumentConverter convert_arguments,
456 const bool skip_first_argument=
false,
457 typename std::enable_if< !std::is_base_of<data_expression, FwdIter>::value>::type* =
nullptr,
458 typename std::enable_if< !std::is_base_of<data_expression, ArgumentConverter>::value>::type* =
nullptr )
461 core::detail::function_symbol_DataAppl(
std::distance(first, last) + 1),
462 detail::term_appl_prepend_iterator<FwdIter>(first, &
head),
463 detail::term_appl_prepend_iterator<FwdIter>(last),
464 detail::skip_function_application_to_head(convert_arguments,skip_first_argument)))
478 template <
typename FwdIter,
class ArgumentConverter>
482 ArgumentConverter convert_arguments,
483 const bool skip_first_argument=
false,
484 typename std::enable_if< !std::is_base_of<data_expression, FwdIter>::value>::type* =
nullptr,
485 typename std::enable_if< !std::is_base_of<data_expression, ArgumentConverter>::value>::type* =
nullptr,
486 typename std::enable_if<std::is_same<
typename std::invoke_result<ArgumentConverter,data_expression&,typename FwdIter::value_type>::type,
void>::value>::type* =
nullptr)
489 core::detail::function_symbol_DataAppl(
std::distance(first, last) + 1),
490 detail::term_appl_prepend_iterator<FwdIter>(first, &
head),
491 detail::term_appl_prepend_iterator<FwdIter>(last),
492 detail::skip_function_application_to_head_assignment(convert_arguments,skip_first_argument)))
507 return atermpp::down_cast<data_expression>(atermpp::aterm::operator[](0));
513 assert(index<
size());
514 return atermpp::down_cast<data_expression>(atermpp::aterm::operator[](index+1));
569template<
typename HEAD,
typename TERM,
typename ...Terms,
570 typename = std::enable_if_t<
571 std::disjunction<typename std::is_convertible<HEAD, data_expression>,
572 typename std::is_invocable_r<void, HEAD, data_expression&>,
573 typename std::is_invocable_r<const data_expression, HEAD, void> >::value >,
574 typename = std::enable_if_t<std::conjunction_v<
575 std::disjunction<typename std::is_convertible<Terms, data_expression>,
576 typename std::is_invocable_r<void, Terms, data_expression&>,
577 typename std::is_invocable_r<const data_expression, Terms, void> > ...>> >
582 const Terms& ...other_arguments
595template <
typename Container>
598 const Container& arguments,
601 assert(arguments.size()>0);
611template <
typename FwdIter>
616 typename std::enable_if< !std::is_base_of<data_expression, FwdIter>::value>::type* =
nullptr)
624 atermpp::down_cast<application>(result).begin(),
625 atermpp::down_cast<application>(result).end())));
630template <
typename FwdIter>
632 const std::size_t arity,
636 typename std::enable_if< !std::is_base_of<data_expression, FwdIter>::value>::type* = 0)
639 assert(std::distance(first, last)==arity);
645 atermpp::down_cast<application>(result).begin(),
646 atermpp::down_cast<application>(result).end())));
659template <
typename FwdIter,
class ArgumentConverter>
664 ArgumentConverter convert_arguments,
665 const bool skip_first_argument=
false,
666 typename std::enable_if< !std::is_base_of<data_expression, FwdIter>::value>::type* =
nullptr,
667 typename std::enable_if< !std::is_base_of<data_expression, ArgumentConverter>::value>::type* =
nullptr,
668 typename std::enable_if< std::is_same<
typename std::invoke_result<ArgumentConverter,typename FwdIter::value_type>::type,
data_expression>::value>::type* =
nullptr)
677 atermpp::down_cast<application>(result).begin(),
678 atermpp::down_cast<application>(result).end())));
690template <
typename FwdIter,
class ArgumentConverter>
696 ArgumentConverter convert_arguments,
697 const bool skip_first_argument=
false,
698 typename std::enable_if< !std::is_base_of<data_expression, FwdIter>::value>::type* =
nullptr,
699 typename std::enable_if< !std::is_base_of<data_expression, ArgumentConverter>::value>::type* =
nullptr,
700 typename std::enable_if<std::is_same<
typename std::invoke_result<ArgumentConverter,data_expression&,typename FwdIter::value_type>::type,
void>::value>::type* =
nullptr)
713std::string
pp(
const application& x);
747 const application& y = atermpp::down_cast<application>(x);
754 const application& y = atermpp::down_cast<application>(x);
761 const application& y = atermpp::down_cast<application>(x);
const_iterator end() const
Returns a const_iterator pointing past the last argument.
aterm()
Default constructor.
const_iterator begin() const
Returns an iterator pointing to the first argument.
size_type size() const
Returns the number of arguments of this term.
size_type size() const
Returns the size of the term_list.
const Term & front() const
Returns the first element of the list.
void push_front(const Term &el)
Inserts a new element at the beginning of the current list.
void swap(unprotected_aterm_core &t) noexcept
Swaps this term with its argument.
An application of a data expression to a number of arguments.
application(application &&) noexcept=default
const_iterator end() const
Returns an iterator pointing past the last argument of the application.
application(const application &) noexcept=default
Move semantics.
const_iterator begin() const
Returns an iterator pointing to the first argument of the application.
const data_expression & head() const
Get the function at the head of this expression.
application(const data_expression &head, FwdIter first, FwdIter last, ArgumentConverter convert_arguments, const bool skip_first_argument=false, typename std::enable_if< !std::is_base_of< data_expression, FwdIter >::value >::type *=nullptr, typename std::enable_if< !std::is_base_of< data_expression, ArgumentConverter >::value >::type *=nullptr, typename std::enable_if< std::is_same< typename std::invoke_result< ArgumentConverter, data_expression &, typename FwdIter::value_type >::type, void >::value >::type *=nullptr)
Constructor.
atermpp::term_appl_iterator< data_expression > const_iterator
An iterator to traverse the arguments of an application.
application(const std::size_t arity, const data_expression &head, FwdIter first, FwdIter last, typename std::enable_if< !std::is_base_of< data_expression, FwdIter >::value >::type *=0)
Constructor.
const data_expression & operator[](std::size_t index) const
Get the i-th argument of this expression.
application(const data_expression &head, const Container &arguments, typename atermpp::enable_if_container< Container, data_expression >::type *=nullptr)
Constructor.
application(const atermpp::aterm &term)
Constructor.
application(const data_expression &head, FwdIter first, FwdIter last, typename std::enable_if< !std::is_base_of< data_expression, FwdIter >::value >::type *=nullptr)
Constructor.
application(const data_expression &head, const data_expression &arg1, const Terms &...other_arguments)
Constructor.
application(const data_expression &head, FwdIter first, FwdIter last, ArgumentConverter convert_arguments, const bool skip_first_argument=false, typename std::enable_if< !std::is_base_of< data_expression, FwdIter >::value >::type *=nullptr, typename std::enable_if< !std::is_base_of< data_expression, ArgumentConverter >::value >::type *=nullptr)
Constructor.
application()
Default constructor.
data_expression::iterator iterator
std::forward_iterator_tag iterator_category
void operator()(data_expression &result, const data_expression &d)
skip_function_application_to_head_assignment(ArgumentConverter &f, const bool skip_head)
std::size_t m_current_index
data_expression operator()(const data_expression &d)
std::size_t m_current_index
skip_function_application_to_head(ArgumentConverter &f, const bool skip_head)
prepend_iterator_tag_convertor< traits::iterator_category >::iterator_category iterator_category
term_appl_prepend_iterator(Iterator it, pointer prepend=nullptr)
term_appl_prepend_iterator operator+(difference_type n) const
bool operator!=(const term_appl_prepend_iterator &other) const
term_appl_prepend_iterator & operator--()
term_appl_prepend_iterator(const term_appl_prepend_iterator &other)
difference_type operator-(const term_appl_prepend_iterator &other) const
term_appl_prepend_iterator operator-(difference_type n) const
ptrdiff_t difference_type
bool operator<(const term_appl_prepend_iterator &other) const
term_appl_prepend_iterator & operator=(const term_appl_prepend_iterator &other)
reference operator[](difference_type n) const
std::iterator_traits< int * > traits
bool operator<=(const term_appl_prepend_iterator &other) const
term_appl_prepend_iterator & operator++()
bool operator>=(const term_appl_prepend_iterator &other) const
pointer operator->() const
data_expression value_type
bool operator==(const term_appl_prepend_iterator &other) const
const data_expression * pointer
const data_expression & reference
bool operator>(const term_appl_prepend_iterator &other) const
difference_type distance_to(const term_appl_prepend_iterator &other) const
term_appl_prepend_iterator & operator-=(difference_type n)
term_appl_prepend_iterator operator++(int)
term_appl_prepend_iterator & operator--(int)
reference operator*() const
term_appl_prepend_iterator & operator+=(difference_type n)
const sort_expression & codomain() const
const sort_expression_list & domain() const
const sort_expression & sort() const
The main namespace for the aterm++ library.
void make_term_appl(Term &target, const function_symbol &sym, ForwardIterator begin, ForwardIterator end)
Constructor an aterm in a variable based on a function symbol and an forward iterator providing the a...
const atermpp::function_symbol & function_symbol_DataAppl(std::size_t i)
bool check_term_DataAppl(const Term &t)
bool contains_untyped_sort(const sort_expression &s)
bool check_whether_sorts_match(const HEAD &head_lambda, const CONTAINER &l)
const data_expression & evaluate_lambda_data_expression(const data_expression &t)
data_expression_list get_arguments()
bool is_structured_sort(const atermpp::aterm &x)
Returns true if the term t is a structured sort.
const data_expression & binary_right(const application &x)
void swap(abstraction &t1, abstraction &t2)
\brief swap overload
const data_expression & arg1(const data_expression &e)
Function for projecting out argument. arg1 from an application.
const data_expression & unary_operand(const application &x)
bool is_untyped_sort(const atermpp::aterm &x)
Returns true if the term t is the unknown sort.
const data_expression & binary_left(const application &x)
std::string pp(const abstraction &x)
const data_expression & unary_operand1(const data_expression &x)
bool is_container_sort(const atermpp::aterm &x)
Returns true if the term t is a container sort.
atermpp::term_list< data_expression > data_expression_list
\brief list of data_expressions
bool is_basic_sort(const atermpp::aterm &x)
Returns true if the term t is a basic sort.
const data_expression & binary_right1(const data_expression &x)
bool is_function_sort(const atermpp::aterm &x)
Returns true if the term t is a function sort.
const data_expression & binary_left1(const data_expression &x)
void make_application(atermpp::aterm &result)
Make function for an application.
std::ostream & operator<<(std::ostream &out, const abstraction &x)
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...