mCRL2
Loading...
Searching...
No Matches
add_binding.h
Go to the documentation of this file.
1// Author(s): Wieger Wesselink
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_ADD_BINDING_H
13#define MCRL2_DATA_ADD_BINDING_H
14
16#include "mcrl2/data/exists.h"
17#include "mcrl2/data/forall.h"
18#include "mcrl2/data/lambda.h"
23
24
25namespace mcrl2
26{
27
28namespace data
32template <template <class> class Builder, class Derived>
33struct add_data_variable_binding: public core::add_binding<Builder, Derived, variable>
36 using super::enter;
37 using super::leave;
38 using super::apply;
42
43 void increase_bind_count(const assignment_list& assignments)
44 {
45 for (const auto& assignment : assignments)
46 {
48 }
49 }
50
51 void decrease_bind_count(const assignment_list& assignments)
52 {
53 for (const auto& assignment : assignments)
54 {
56 }
57 }
58
60 {
62 }
63
65 {
67 }
68
69 void enter(const data::forall& x)
70 {
72 }
73
74 void leave(const data::forall& x)
75 {
77 }
78
79 void enter(const data::exists& x)
80 {
82 }
83
84 void leave(const data::exists& x)
85 {
87 }
88
89 void enter(const data::lambda& x)
90 {
92 }
93
94 void leave(const data::lambda& x)
95 {
97 }
98
100 {
102 }
103
105 {
107 }
108
110 {
113
117 }
118
120 {
122 }
123
125 {
127 }
128
130 {
132 }
133
135 {
137 }
138};
139
140// special handling for where clauses
141template <template <class> class Builder, class Derived>
143{
145 using super::enter;
146 using super::leave;
147 using super::apply;
151
153 {
154 static_cast<Derived&>(*this).apply(x.declarations());
155 static_cast<Derived&>(*this).enter(x);
156 static_cast<Derived&>(*this).apply(x.body());
157 static_cast<Derived&>(*this).leave(x);
158 }
159};
160
161// special handling for where clauses
162template <template <class> class Builder, class Derived>
164{
166 using super::enter;
167 using super::leave;
168 using super::apply;
172
173 template <class T>
174 void apply(T& result, const data::where_clause& x)
175 {
176 assignment_expression_list declarations;
177 static_cast<Derived&>(*this).apply(declarations, x.declarations());
178 static_cast<Derived&>(*this).enter(x);
180 [&](data_expression& r){ static_cast<Derived&>(*this).apply(r, x.body()); },
181 declarations);
182 static_cast<Derived&>(*this).leave(x);
183 }
184};
185
186} // namespace data
187
188} // namespace mcrl2
189
190#endif // MCRL2_DATA_ADD_BINDING_H
add your file description here.
Traverser that defines functions for maintaining bound variables.
Definition add_binding.h:26
const std::multiset< variable_type > & bound_variables() const
Returns the bound variables.
Definition add_binding.h:74
void decrease_bind_count(const variable_type &var)
Remove a variable from the multiset of bound variables.
Definition add_binding.h:51
void increase_bind_count(const variable_type &var)
Add a variable to the multiset of bound variables.
Definition add_binding.h:35
const variable_list & variables() const
Definition abstraction.h:63
\brief Assignment of a data expression to a variable
Definition assignment.h:91
const variable & lhs() const
Definition assignment.h:117
universal quantification.
\brief A data equation
const variable_list & variables() const
existential quantification.
Definition exists.h:26
universal quantification.
Definition forall.h:26
function symbol.
Definition lambda.h:27
universal quantification.
\brief A where expression
const assignment_list & assignments() const
const data_expression & body() const
const assignment_expression_list & declarations() const
add your file description here.
The class exists.
The class forall.
The class lambda.
void make_where_clause(atermpp::aterm &t, const ARGUMENTS &... args)
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
add your file description here.
Maintains a multiset of bound data variables during traversal.
Definition add_binding.h:34
void decrease_bind_count(const assignment_list &assignments)
Definition add_binding.h:51
void leave(const data::exists &x)
Definition add_binding.h:84
void enter(const data::forall &x)
Definition add_binding.h:69
void leave(const data::forall &x)
Definition add_binding.h:74
void leave(const data::data_equation &x)
void enter(const data::set_comprehension &x)
Definition add_binding.h:99
core::add_binding< Builder, Derived, variable > super
Definition add_binding.h:35
void enter(const data::data_equation &x)
void leave(const data::set_comprehension &x)
void enter(const data::exists &x)
Definition add_binding.h:79
void leave(const data::bag_comprehension &x)
void enter(const data::lambda &x)
Definition add_binding.h:89
void leave(const data::untyped_set_or_bag_comprehension &x)
void increase_bind_count(const assignment_list &assignments)
Definition add_binding.h:43
void enter(const data::bag_comprehension &x)
void leave(const data::lambda &x)
Definition add_binding.h:94
void enter(const data::untyped_set_or_bag_comprehension &x)
void enter(const data::where_clause &x)
Definition add_binding.h:59
void leave(const data::where_clause &x)
Definition add_binding.h:64
add_data_variable_binding< Builder, Derived > super
void apply(T &result, const data::where_clause &x)
add_data_variable_binding< Builder, Derived > super
void apply(const data::where_clause &x)
add your file description here.
The class where_clause.