mCRL2
Loading...
Searching...
No Matches
sort_expression.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_SORT_EXPRESSION_H
13#define MCRL2_DATA_SORT_EXPRESSION_H
14
17
18namespace mcrl2
19{
20
21namespace data
22{
23
25inline bool is_basic_sort(const atermpp::aterm& x)
26{
28}
29
31inline bool is_function_sort(const atermpp::aterm& x)
32{
34}
35
37inline bool is_container_sort(const atermpp::aterm& x)
38{
40}
41
44{
46}
47
49inline bool is_untyped_sort(const atermpp::aterm& x)
50{
52}
53
56{
58}
59
60//--- start generated class sort_expression ---//
63{
64 public:
67 : atermpp::aterm(core::detail::default_values::SortExpr)
68 {}
69
72 explicit sort_expression(const atermpp::aterm& term)
73 : atermpp::aterm(term)
74 {
76 }
77
79 sort_expression(const sort_expression&) noexcept = default;
80 sort_expression(sort_expression&&) noexcept = default;
81 sort_expression& operator=(const sort_expression&) noexcept = default;
82 sort_expression& operator=(sort_expression&&) noexcept = default;
83//--- start user section sort_expression ---//
86 inline
88 {
89 if (is_function_sort(*this))
90 {
91 return atermpp::down_cast<const sort_expression>((*this)[1]);
92 }
93 else
94 {
95 return *this;
96 }
97 }
98//--- end user section sort_expression ---//
99};
100
103
105typedef std::vector<sort_expression> sort_expression_vector;
106
107// prototype declaration
108std::string pp(const sort_expression& x);
109
114inline
115std::ostream& operator<<(std::ostream& out, const sort_expression& x)
116{
117 return out << data::pp(x);
118}
119
122{
123 t1.swap(t2);
124}
125//--- end generated class sort_expression ---//
126
130inline
132{
133 return is_basic_sort(x) ||
134 is_function_sort(x) ||
137 is_untyped_sort(x) ||
139}
140
141// template function overloads
142std::string pp(const sort_expression_list& x);
143std::string pp(const sort_expression_vector& x);
144std::set<data::sort_expression> find_sort_expressions(const data::sort_expression& x);
145
146} // namespace data
147
148} // namespace mcrl2
149
150namespace std
151{
152
153template <>
154struct hash<mcrl2::data::sort_expression>
155{
156 std::size_t operator()(const mcrl2::data::sort_expression& x) const
157 {
158 return hash<atermpp::aterm>()(x);
159 }
160};
161
162} // namespace std
163
164#endif // MCRL2_DATA_SORT_EXPRESSION_H
165
aterm()
Default constructor.
Definition aterm.h:48
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
void swap(unprotected_aterm_core &t) noexcept
Swaps this term with its argument.
Definition aterm_core.h:152
\brief A sort expression
sort_expression(const sort_expression &) noexcept=default
Move semantics.
const sort_expression & target_sort() const
Returns the target sort of this expression.
sort_expression(sort_expression &&) noexcept=default
sort_expression()
\brief Default constructor X3.
sort_expression(const atermpp::aterm &term)
add your file description here.
The main namespace for the aterm++ library.
Definition algorithm.h:21
bool check_rule_SortExpr(const Term &t)
bool is_structured_sort(const atermpp::aterm &x)
Returns true if the term t is a structured sort.
void swap(abstraction &t1, abstraction &t2)
\brief swap overload
std::vector< sort_expression > sort_expression_vector
\brief vector of sort_expressions
bool is_untyped_possible_sorts(const atermpp::aterm &x)
Returns true if the term t is an expression for multiple possible sorts.
bool is_untyped_sort(const atermpp::aterm &x)
Returns true if the term t is the unknown sort.
atermpp::term_list< sort_expression > sort_expression_list
\brief list of sort_expressions
std::string pp(const abstraction &x)
Definition data.cpp:39
bool is_container_sort(const atermpp::aterm &x)
Returns true if the term t is a container sort.
bool is_basic_sort(const atermpp::aterm &x)
Returns true if the term t is a basic sort.
std::set< data::sort_expression > find_sort_expressions(const data::data_equation &x)
Definition data.cpp:91
bool is_function_sort(const atermpp::aterm &x)
Returns true if the term t is a function sort.
bool is_sort_expression(const atermpp::aterm &x)
Test for a sort_expression expression.
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
STL namespace.
Add your file description here.
static const atermpp::function_symbol SortArrow
static const atermpp::function_symbol SortCons
static const atermpp::function_symbol SortStruct
static const atermpp::function_symbol UntypedSortsPossible
static const atermpp::function_symbol SortId
static const atermpp::function_symbol UntypedSortUnknown
std::size_t operator()(const mcrl2::data::sort_expression &x) const
#define hash(l, r, m)
Definition tree_set.cpp:23