mCRL2
Loading...
Searching...
No Matches
structured_sort_constructor.h
Go to the documentation of this file.
1// Author(s): Jeroen Keiren, Jeroen van der Wulp
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_STRUCTURED_SORT_CONSTRUCTOR_H
13#define MCRL2_DATA_STRUCTURED_SORT_CONSTRUCTOR_H
14
15#include "mcrl2/data/bool.h"
17
18namespace mcrl2
19{
20
21namespace data
22{
23
24class structured_sort;
25
26//--- start generated class structured_sort_constructor ---//
29{
30 public:
33 : atermpp::aterm(core::detail::default_values::StructCons)
34 {}
35
39 : atermpp::aterm(term)
40 {
42 }
43
46 : atermpp::aterm(core::detail::function_symbol_StructCons(), name, arguments, recogniser)
47 {}
48
50 template <typename Container>
52 : atermpp::aterm(core::detail::function_symbol_StructCons(), core::identifier_string(name), structured_sort_constructor_argument_list(arguments.begin(), arguments.end()), core::identifier_string(recogniser))
53 {}
54
58 structured_sort_constructor& operator=(const structured_sort_constructor&) noexcept = default;
60
61 const core::identifier_string& name() const
62 {
63 return atermpp::down_cast<core::identifier_string>((*this)[0]);
64 }
65
67 {
68 return atermpp::down_cast<structured_sort_constructor_argument_list>((*this)[1]);
69 }
70
72 {
73 return atermpp::down_cast<core::identifier_string>((*this)[2]);
74 }
75//--- start user section structured_sort_constructor ---//
76 friend class structured_sort;
77
78 private:
79
81 {
83 {
84 return s.sort();
85 }
86 };
87
88 protected:
91 template <typename OutIter>
92 void argument_sorts(OutIter out) const
93 {
94 for(const auto & i : arguments())
95 {
96 *out++ = i.sort();
97 }
98 }
99
100 public:
103 : atermpp::aterm(core::detail::function_symbol_StructCons(), name, structured_sort_constructor_argument_list(), recogniser)
104 {}
105
107 structured_sort_constructor(const std::string& name, const std::string& recogniser)
108 : atermpp::aterm(core::detail::function_symbol_StructCons(), core::identifier_string(name), structured_sort_constructor_argument_list(), core::identifier_string(recogniser))
109 {}
110
112 template <typename Container>
114 : atermpp::aterm(core::detail::function_symbol_StructCons(), core::identifier_string(name), arguments, core::empty_identifier_string())
115 {}
116
118 template <typename Container>
120 : atermpp::aterm(core::detail::function_symbol_StructCons(), core::identifier_string(name), structured_sort_constructor_argument_list(arguments.begin(), arguments.end()), core::empty_identifier_string())
121 {}
122
125 : atermpp::aterm(core::detail::function_symbol_StructCons(), name, structured_sort_constructor_argument_list(), core::empty_identifier_string())
126 {}
127
130 : atermpp::aterm(core::detail::function_symbol_StructCons(), core::identifier_string(name), structured_sort_constructor_argument_list(), core::empty_identifier_string())
131 {}
132
136 template < typename Container, std::size_t S, std::size_t S0 >
138 const Container& arguments,
139 const char(&recogniser)[S0],
141 : atermpp::aterm(core::detail::function_symbol_StructCons(), core::identifier_string(name), structured_sort_constructor_argument_list(arguments.begin(), arguments.end()), core::identifier_string(recogniser))
142 {}
143
155 {
157 std::back_insert_iterator<sort_expression_vector> inserter(arguments);
158 argument_sorts(inserter);
159
161 }
162
167 {
169 for (const auto & i : arguments())
170 {
171 if (i.name() != core::empty_identifier_string())
172 {
173 result.push_back(function_symbol(i.name(), make_function_sort_(s, i.sort())));
174 }
175 }
176 return result;
177 }
178
184 {
186 }
187//--- end user section structured_sort_constructor ---//
188};
189
192template <class... ARGUMENTS>
193inline void make_structured_sort_constructor(atermpp::aterm& t, const ARGUMENTS&... args)
194{
196}
197
200
202typedef std::vector<structured_sort_constructor> structured_sort_constructor_vector;
203
207inline
209{
211}
212
213// prototype declaration
214std::string pp(const structured_sort_constructor& x);
215
220inline
221std::ostream& operator<<(std::ostream& out, const structured_sort_constructor& x)
222{
223 return out << data::pp(x);
224}
225
228{
229 t1.swap(t2);
230}
231//--- end generated class structured_sort_constructor ---//
232
233// template function overloads
234std::string pp(const structured_sort_constructor_list& x);
235std::string pp(const structured_sort_constructor_vector& x);
236
237} // namespace data
238
239} // namespace mcrl2
240
241#endif // MCRL2_DATA_STRUCTURED_SORT_CONSTRUCTOR_H
The standard sort bool_.
Term containing a string.
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
const function_symbol & function() const
Returns the function symbol belonging to an aterm.
Definition aterm.h:144
A list of aterm objects.
Definition aterm_list.h:24
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
\brief A function sort
\brief A function symbol
\brief A sort expression
\brief An argument of a constructor of a structured sort
\brief A constructor for a structured sort
function_symbol constructor_function(const sort_expression &s) const
Returns the constructor function for this constructor, assuming it is internally represented with sor...
const core::identifier_string & name() const
structured_sort_constructor(const std::string &name, const structured_sort_constructor_argument_list &arguments, typename atermpp::enable_if_container< Container, structured_sort_constructor_argument >::type *=0)
Constructor.
structured_sort_constructor(const char(&name)[S], const Container &arguments, const char(&recogniser)[S0], typename atermpp::enable_if_container< Container, structured_sort_constructor_argument >::type *=nullptr)
structured_sort_constructor(const structured_sort_constructor &) noexcept=default
Move semantics.
structured_sort_constructor(const core::identifier_string &name, const structured_sort_constructor_argument_list &arguments, core::identifier_string &recogniser)
\brief Constructor Z12.
structured_sort_constructor(const core::identifier_string &name, const core::identifier_string &recogniser)
Constructor.
structured_sort_constructor(const std::string &name, const std::string &recogniser)
Constructor.
function_symbol_vector projection_functions(const sort_expression &s) const
Returns the projection functions for this constructor.
structured_sort_constructor(const std::string &name)
Constructor.
structured_sort_constructor(structured_sort_constructor &&) noexcept=default
const core::identifier_string & recogniser() const
structured_sort_constructor(const std::string &name, const Container &arguments, const std::string &recogniser, typename atermpp::enable_if_container< Container, structured_sort_constructor_argument >::type *=nullptr)
\brief Constructor Z1.
function_symbol recogniser_function(const sort_expression &s) const
Returns the function corresponding to the recogniser of this constructor, such that it is usable in t...
structured_sort_constructor(const std::string &name, const Container &arguments, typename atermpp::enable_if_container< Container, structured_sort_constructor_argument >::type *=nullptr)
Constructor.
const structured_sort_constructor_argument_list & arguments() const
structured_sort_constructor()
\brief Default constructor X3.
void argument_sorts(OutIter out) const
Returns the sorts of the arguments in an output iterator.
structured_sort_constructor(const core::identifier_string &name)
Constructor.
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
const atermpp::function_symbol & function_symbol_StructCons()
bool check_term_StructCons(const Term &t)
identifier_string empty_identifier_string()
Provides the empty identifier string.
const basic_sort & bool_()
Constructor for sort expression Bool.
Definition bool.h:44
void swap(abstraction &t1, abstraction &t2)
\brief swap overload
std::vector< sort_expression > sort_expression_vector
\brief vector of sort_expressions
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< structured_sort_constructor > structured_sort_constructor_vector
\brief vector of structured_sort_constructors
bool is_structured_sort_constructor(const atermpp::aterm &x)
void make_structured_sort_constructor(atermpp::aterm &t, const ARGUMENTS &... args)
std::vector< function_symbol > function_symbol_vector
\brief vector of function_symbols
atermpp::term_list< structured_sort_constructor > structured_sort_constructor_list
\brief list of structured_sort_constructors
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
static const atermpp::function_symbol StructCons
sort_expression operator()(structured_sort_constructor_argument const &s) const
The class structured_sort_constructor_arguments.