mCRL2
Loading...
Searching...
No Matches
function_sort.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_FUNCTION_SORT_H
13#define MCRL2_DATA_FUNCTION_SORT_H
14
16
17namespace mcrl2
18{
19
20namespace data
21{
22
23//--- start generated class function_sort ---//
26{
27 public:
30 : sort_expression(core::detail::default_values::SortArrow)
31 {}
32
35 explicit function_sort(const atermpp::aterm& term)
36 : sort_expression(term)
37 {
39 }
40
43 : sort_expression(atermpp::aterm(core::detail::function_symbol_SortArrow(), domain, codomain))
44 {}
45
47 template <typename Container>
49 : sort_expression(atermpp::aterm(core::detail::function_symbol_SortArrow(), sort_expression_list(domain.begin(), domain.end()), codomain))
50 {}
51
53 function_sort(const function_sort&) noexcept = default;
54 function_sort(function_sort&&) noexcept = default;
55 function_sort& operator=(const function_sort&) noexcept = default;
56 function_sort& operator=(function_sort&&) noexcept = default;
57
59 {
60 return atermpp::down_cast<sort_expression_list>((*this)[0]);
61 }
62
64 {
65 return atermpp::down_cast<sort_expression>((*this)[1]);
66 }
67};
68
71template <class... ARGUMENTS>
72inline void make_function_sort(atermpp::aterm& t, const ARGUMENTS&... args)
73{
75}
76
77// prototype declaration
78std::string pp(const function_sort& x);
79
84inline
85std::ostream& operator<<(std::ostream& out, const function_sort& x)
86{
87 return out << data::pp(x);
88}
89
91inline void swap(function_sort& t1, function_sort& t2)
92{
93 t1.swap(t2);
94}
95//--- end generated class function_sort ---//
96
100typedef std::vector<function_sort> function_sort_vector;
101
108 const sort_expression& codomain)
109{
110 return function_sort({ dom1 }, codomain);
111}
112
120 const sort_expression& dom2,
121 const sort_expression& codomain)
122{
123 return function_sort({ dom1, dom2 }, codomain);
124}
125
134 const sort_expression& dom2,
135 const sort_expression& dom3,
136 const sort_expression& codomain)
137{
138 return function_sort({ dom1, dom2, dom3 }, codomain);
139}
140
150 const sort_expression& dom2,
151 const sort_expression& dom3,
152 const sort_expression& dom4,
153 const sort_expression& codomain)
154{
155 return function_sort({ dom1, dom2, dom3, dom4 }, codomain);
156}
157
168 const sort_expression& dom2,
169 const sort_expression& dom3,
170 const sort_expression& dom4,
171 const sort_expression& dom5,
172 const sort_expression& codomain)
173{
174 return function_sort({ dom1, dom2, dom3, dom4, dom5 }, codomain);
175}
176
187 const sort_expression& dom2,
188 const sort_expression& dom3,
189 const sort_expression& dom4,
190 const sort_expression& dom5,
191 const sort_expression& dom6,
192 const sort_expression& codomain)
193{
194 return function_sort({ dom1, dom2, dom3, dom4, dom5, dom6 }, codomain);
195}
196
197} // namespace data
198
199} // namespace mcrl2
200
201#endif // MCRL2_DATA_FUNCTION_SORT_H
202
const_iterator end() const
Returns a const_iterator pointing past the last argument.
Definition aterm.h:172
aterm()
Default constructor.
Definition aterm.h:48
const_iterator begin() const
Returns an iterator pointing to the first argument.
Definition aterm.h:165
A list of aterm objects.
Definition aterm_list.h:24
void swap(unprotected_aterm_core &t) noexcept
Swaps this term with its argument.
Definition aterm_core.h:152
\brief A function sort
const sort_expression & codomain() const
function_sort()
\brief Default constructor X3.
function_sort(const sort_expression_list &domain, const sort_expression &codomain)
\brief Constructor Z14.
function_sort(const atermpp::aterm &term)
function_sort(const Container &domain, const sort_expression &codomain, typename atermpp::enable_if_container< Container, sort_expression >::type *=nullptr)
\brief Constructor Z2.
function_sort(function_sort &&) noexcept=default
function_sort(const function_sort &) noexcept=default
Move semantics.
const sort_expression_list & domain() const
\brief A sort expression
The main namespace for the aterm++ library.
Definition algorithm.h:21
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...
Definition aterm.h:213
bool check_term_SortArrow(const Term &t)
const atermpp::function_symbol & function_symbol_SortArrow()
atermpp::term_list< function_sort > function_sort_list
list of function sorts
void swap(abstraction &t1, abstraction &t2)
\brief swap overload
function_sort make_function_sort_(const sort_expression &dom1, const sort_expression &codomain)
Convenience constructor for function sort with domain size 1.
std::string pp(const abstraction &x)
Definition data.cpp:39
std::vector< function_sort > function_sort_vector
vector of function sorts
void make_function_sort(atermpp::aterm &t, const ARGUMENTS &... args)
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
The class sort_expression.