mCRL2
Loading...
Searching...
No Matches
lambda.h
Go to the documentation of this file.
1// Author(s): Jeroen Keiren
2// Copyright: see the accompanying file COPYING or copy at
3// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
11
12#ifndef MCRL2_DATA_LAMBDA_H
13#define MCRL2_DATA_LAMBDA_H
14
17
18namespace mcrl2
19{
20
21namespace data
22{
23
26class lambda: public abstraction
27{
28 public:
31 {}
32
37 explicit lambda(const aterm& d)
38 : abstraction(d)
39 {
40 assert(is_abstraction(d));
41 assert(static_cast<abstraction>(d).binding_operator() == lambda_binder());
42 }
43
50 const data_expression& body)
52 {
53 }
54
60 template < typename Container >
61 lambda(const Container& variables,
62 const data_expression& body,
65 {
66 assert(!variables.empty());
67 }
68
70 lambda(const lambda&) noexcept = default;
71 lambda(lambda&&) noexcept = default;
72 lambda& operator=(const lambda&) noexcept = default;
73 lambda& operator=(lambda&&) noexcept = default;
74
75}; // class lambda
76
77template <class... ARGUMENTS>
78void make_lambda(atermpp::aterm& result, ARGUMENTS... arguments)
79{
80 make_abstraction(result, lambda_binder(), arguments...);
81}
82
83
84//--- start generated class lambda ---//
85// prototype declaration
86std::string pp(const lambda& x);
87
92inline
93std::ostream& operator<<(std::ostream& out, const lambda& x)
94{
95 return out << data::pp(x);
96}
97
99inline void swap(lambda& t1, lambda& t2)
100{
101 t1.swap(t2);
102}
103//--- end generated class lambda ---//
104
105} // namespace data
106
107} // namespace mcrl2
108
109#endif // MCRL2_DATA_LAMBDA_H
110
The class abstraction.
The class application.
aterm()
Default constructor.
Definition aterm.h:48
bool empty() const
Returns true if the list's size is 0.
Definition aterm_list.h:268
void swap(unprotected_aterm_core &t) noexcept
Swaps this term with its argument.
Definition aterm_core.h:152
An abstraction expression.
Definition abstraction.h:26
const variable_list & variables() const
Definition abstraction.h:63
const data_expression & body() const
Definition abstraction.h:68
const binder_type & binding_operator() const
Definition abstraction.h:58
\brief Binder for lambda abstraction
function symbol.
Definition lambda.h:27
lambda(const Container &variables, const data_expression &body, typename atermpp::enable_if_container< Container, variable >::type *=nullptr)
Definition lambda.h:61
lambda(const variable &variable, const data_expression &body)
Definition lambda.h:49
lambda(const aterm &d)
Definition lambda.h:37
lambda()
Constructor.
Definition lambda.h:30
lambda(const lambda &) noexcept=default
Move semantics.
lambda(lambda &&) noexcept=default
\brief A data variable
Definition variable.h:28
The main namespace for the aterm++ library.
Definition algorithm.h:21
void swap(abstraction &t1, abstraction &t2)
\brief swap overload
bool is_abstraction(const atermpp::aterm &x)
Returns true if the term t is an abstraction.
std::string pp(const abstraction &x)
Definition data.cpp:39
void make_lambda(atermpp::aterm &result, ARGUMENTS... arguments)
Definition lambda.h:78
void make_abstraction(atermpp::aterm &result, ARGUMENTS... arguments)
Definition abstraction.h:75
std::ostream & operator<<(std::ostream &out, const abstraction &x)
Definition abstraction.h:94
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72