mCRL2
Loading...
Searching...
No Matches
variable.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_VARIABLE_H
13#define MCRL2_DATA_VARIABLE_H
14
15#include "mcrl2/atermpp/aterm.h"
18
19namespace mcrl2
20{
21
22namespace data
23{
24
25//--- start generated class variable ---//
28{
29 public:
30
31
33 variable(const variable&) noexcept = default;
34 variable(variable&&) noexcept = default;
35 variable& operator=(const variable&) noexcept = default;
36 variable& operator=(variable&&) noexcept = default;
37
38 const core::identifier_string& name() const
39 {
40 return atermpp::down_cast<core::identifier_string>((*this)[0]);
41 }
42
43 const sort_expression& sort() const
44 {
45 return atermpp::down_cast<sort_expression>((*this)[1]);
46 }
47//--- start user section variable ---//
50 : data_expression(core::detail::default_values::DataVarId)
51 {}
52
55 explicit variable(const atermpp::aterm& term)
56 : data_expression(term)
57 {
59 }
60
63 {
65 }
66
67
69 variable(const std::string& name, const sort_expression& sort)
70 {
72 }
73
74//--- end user section variable ---//
75};
76
79template <class... ARGUMENTS>
80inline void make_variable(atermpp::aterm& t, const ARGUMENTS&... args)
81{
83}
84
87
89typedef std::vector<variable> variable_vector;
90
91// prototype declaration
92std::string pp(const variable& x);
93
98inline
99std::ostream& operator<<(std::ostream& out, const variable& x)
100{
101 return out << data::pp(x);
102}
103
105inline void swap(variable& t1, variable& t2)
106{
107 t1.swap(t2);
108}
109//--- end generated class variable ---//
110
111
112// template function overloads
113std::string pp(const variable_list& x);
114std::string pp(const variable_vector& x);
115std::string pp(const std::set<variable>& x);
116std::string pp(const std::set<variable>& x);
117std::set<data::variable> find_all_variables(const data::variable& x);
118std::set<data::variable> find_all_variables(const data::variable_list& x);
119std::set<core::identifier_string> find_identifiers(const data::variable_list& x);
120
121} // namespace data
122
123} // namespace mcrl2
124
125
126namespace std
127{
128
129template<>
130struct hash<mcrl2::data::variable>
131{
132 // Default constructor, required for const qualified hash functions.
134 {}
135
136 std::size_t operator()(const mcrl2::data::variable& v) const
137 {
138 const hash<atermpp::aterm> hasher;
139 return hasher(v);
140 }
141};
142
143} // namespace std
144
145#endif // MCRL2_DATA_VARIABLE_H
146
The term_appl class represents function application.
Term containing a string.
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
\brief A data variable
Definition variable.h:28
variable(const variable &) noexcept=default
Move semantics.
variable(const std::string &name, const sort_expression &sort)
Constructor.
Definition variable.h:69
variable(variable &&) noexcept=default
variable()
Default constructor.
Definition variable.h:49
const core::identifier_string & name() const
Definition variable.h:38
const sort_expression & sort() const
Definition variable.h:43
variable(const core::identifier_string &name, const sort_expression &sort)
Constructor.
Definition variable.h:62
variable(const atermpp::aterm &term)
Constructor.
Definition variable.h:55
The class data_expression.
aterm representations of identifier strings.
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_DataVarId()
bool check_term_DataVarId(const Term &t)
void find_identifiers(const T &x, OutputIterator o)
Definition find.h:359
void swap(abstraction &t1, abstraction &t2)
\brief swap overload
std::set< data::variable > find_all_variables(const data::data_expression &x)
Definition data.cpp:94
void make_variable(atermpp::aterm &t, const ARGUMENTS &... args)
Definition variable.h:80
std::vector< variable > variable_vector
\brief vector of variables
Definition variable.h:89
std::string pp(const abstraction &x)
Definition data.cpp:39
atermpp::term_list< variable > variable_list
\brief list of variables
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.
std::size_t operator()(const mcrl2::data::variable &v) const
Definition variable.h:136
#define hash(l, r, m)
Definition tree_set.cpp:23