mCRL2
Loading...
Searching...
No Matches
replace_capture_avoiding_with_an_identifier_generator.h
Go to the documentation of this file.
1// Author(s): Jan Friso Groote
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_MODAL_FORMULA_REPLACE_CAPTURE_AVOIDING_WITH_AN_IDENTIFIER_GENERATOR_H
13#define MCRL2_MODAL_FORMULA_REPLACE_CAPTURE_AVOIDING_WITH_AN_IDENTIFIER_GENERATOR_H
14
18
19namespace mcrl2 {
20
21namespace action_formulas {
22
23namespace detail {
24
25// Below the functions to do a capture avoiding replacement with an identifier generator are given.
26template <template <class> class Builder, class Derived, class Substitution, class IdentifierGenerator>
28{
30 using super::enter;
31 using super::leave;
32 using super::update;
33 using super::apply;
35
36 template <class T>
37 void apply(T& result, const forall& x)
38 {
40 action_formula body;
41 apply(body, x.body());
42 make_forall(result, v, body);
43 update_sigma.pop(v);
44 }
45
46 template <class T>
47 void apply(T& result, const exists& x)
48 {
50 action_formula body;
51 apply(body, x.body());
52 make_exists(result, v, body);
53 update_sigma.pop(v);
54 }
55
56 add_capture_avoiding_replacement_with_an_identifier_generator(Substitution& sigma, IdentifierGenerator& id_generator)
57 : super(sigma, id_generator)
58 { }
59};
60
61} // namespace detail
62
63//--- start generated action_formulas replace_capture_avoiding_with_identifier_generator code ---//
72
73template <typename T, typename Substitution, typename IdentifierGenerator>
75 Substitution& sigma,
76 IdentifierGenerator& id_generator,
77 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
78 )
79{
80 data::detail::apply_replace_capture_avoiding_variables_builder_with_an_identifier_generator<action_formulas::data_expression_builder, action_formulas::detail::add_capture_avoiding_replacement_with_an_identifier_generator>(sigma, id_generator).update(x);
81}
82
92template <typename T, typename Substitution, typename IdentifierGenerator>
94 Substitution& sigma,
95 IdentifierGenerator& id_generator,
96 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
97 )
98{
99 T result;
100 data::detail::apply_replace_capture_avoiding_variables_builder_with_an_identifier_generator<action_formulas::data_expression_builder, action_formulas::detail::add_capture_avoiding_replacement_with_an_identifier_generator>(sigma, id_generator).apply(result, x);
101 return result;
102}
103//--- end generated action_formulas replace_capture_avoiding_with_identifier_generator code ---//
104
105} // namespace action_formulas
106
107} // namespace mcrl2
108
109namespace mcrl2 {
110
111namespace regular_formulas {
112
113namespace detail {
114
115// Below the code is provided for a capture avoiding replacement with an identifier generator.
116template <template <class> class Builder, class Derived, class Substitution, class IdentifierGenerator>
118{
120 using super::enter;
121 using super::leave;
122 using super::update;
123 using super::apply;
125
126 add_capture_avoiding_replacement_with_an_identifier_generator(Substitution& sigma, IdentifierGenerator& id_generator)
127 : super(sigma, id_generator)
128 { }
129};
130
131template <template <class> class Builder, class Substitution, class IdentifierGenerator>
132add_capture_avoiding_replacement_with_an_identifier_generator<Builder, class Derived, Substitution, IdentifierGenerator>
133make_add_capture_avoiding_replacement_with_an_identifier_generator(Substitution& sigma, IdentifierGenerator& id_generator)
134{
136}
137
138} // namespace detail
139
140//--- start generated regular_formulas replace_capture_avoiding_with_identifier_generator code ---//
149
150template <typename T, typename Substitution, typename IdentifierGenerator>
152 Substitution& sigma,
153 IdentifierGenerator& id_generator,
154 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
155 )
156{
157 data::detail::apply_replace_capture_avoiding_variables_builder_with_an_identifier_generator<regular_formulas::data_expression_builder, regular_formulas::detail::add_capture_avoiding_replacement_with_an_identifier_generator>(sigma, id_generator).update(x);
158}
159
169template <typename T, typename Substitution, typename IdentifierGenerator>
171 Substitution& sigma,
172 IdentifierGenerator& id_generator,
173 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
174 )
175{
176 T result;
177 data::detail::apply_replace_capture_avoiding_variables_builder_with_an_identifier_generator<regular_formulas::data_expression_builder, regular_formulas::detail::add_capture_avoiding_replacement_with_an_identifier_generator>(sigma, id_generator).apply(result, x);
178 return result;
179}
180//--- end generated regular_formulas replace_capture_avoiding_with_identifier_generator code ---//
181
182} // namespace regular_formulas
183
184} // namespace mcrl2
185
186namespace mcrl2 {
187
188namespace state_formulas {
189
190namespace detail {
191
192// Below the code for add capture avoiding replacment with an identifier generator is provided.
193
194template <template <class> class Builder, class Derived, class Substitution, class IdentifierGenerator>
196{
198 using super::enter;
199 using super::leave;
200 using super::update;
201 using super::apply;
202 using super::sigma;
204
206 {
208 state_formula result = forall(v, (*this)(x.body()));
209 update_sigma.pop(v);
210 return result;
211 }
212
214 {
216 state_formula result = exists(v, (*this)(x.body()));
217 update_sigma.pop(v);
218 return result;
219 }
220
221 add_capture_avoiding_replacement_with_an_identifier_generator(Substitution& sigma, IdentifierGenerator& id_generator)
222 : super(sigma, id_generator)
223 { }
224};
225
226template <template <class> class Builder, class Substitution, class IdentifierGenerator>
227add_capture_avoiding_replacement_with_an_identifier_generator<Builder, class Derived, Substitution, IdentifierGenerator>
228make_add_capture_avoiding_replacement_with_an_identifier_generator(Substitution& sigma, IdentifierGenerator& id_generator)
229{
231}
232
233} // namespace detail
234
235//--- start generated state_formulas replace_capture_avoiding_with_identifier_generator code ---//
244
245template <typename T, typename Substitution, typename IdentifierGenerator>
247 Substitution& sigma,
248 IdentifierGenerator& id_generator,
249 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
250 )
251{
252 data::detail::apply_replace_capture_avoiding_variables_builder_with_an_identifier_generator<state_formulas::data_expression_builder, state_formulas::detail::add_capture_avoiding_replacement_with_an_identifier_generator>(sigma, id_generator).update(x);
253}
254
264template <typename T, typename Substitution, typename IdentifierGenerator>
266 Substitution& sigma,
267 IdentifierGenerator& id_generator,
268 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
269 )
270{
271 T result;
272 data::detail::apply_replace_capture_avoiding_variables_builder_with_an_identifier_generator<state_formulas::data_expression_builder, state_formulas::detail::add_capture_avoiding_replacement_with_an_identifier_generator>(sigma, id_generator).apply(result, x);
273 return result;
274}
275//--- end generated state_formulas replace_capture_avoiding_with_identifier_generator code ---//
276
277} // namespace state_formulas
278
279} // namespace mcrl2
280
281#endif // MCRL2_MODAL_FORMULA_REPLACE_CAPTURE_AVOIDING_WITH_AN_IDENTIFIER_GENERATOR_H
\brief The existential quantification operator for action formulas
const data::variable_list & variables() const
const action_formula & body() const
\brief The universal quantification operator for action formulas
const action_formula & body() const
const data::variable_list & variables() const
\brief The existential quantification operator for state formulas
const state_formula & body() const
const data::variable_list & variables() const
\brief The universal quantification operator for state formulas
const state_formula & body() const
const data::variable_list & variables() const
static RewriterCompilingJitty::substitution_type & sigma(RewriterCompilingJitty *this_rewriter)
add your file description here.
add your file description here.
void replace_variables_capture_avoiding_with_an_identifier_generator(T &x, Substitution &sigma, IdentifierGenerator &id_generator, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
void make_exists(atermpp::aterm &t, const ARGUMENTS &... args)
void make_forall(atermpp::aterm &t, const ARGUMENTS &... args)
add_capture_avoiding_replacement_with_an_identifier_generator< Builder, class Derived, Substitution, IdentifierGenerator > make_add_capture_avoiding_replacement_with_an_identifier_generator(Substitution &sigma, IdentifierGenerator &id_generator)
void replace_variables_capture_avoiding_with_an_identifier_generator(T &x, Substitution &sigma, IdentifierGenerator &id_generator, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
add_capture_avoiding_replacement_with_an_identifier_generator< Builder, class Derived, Substitution, IdentifierGenerator > make_add_capture_avoiding_replacement_with_an_identifier_generator(Substitution &sigma, IdentifierGenerator &id_generator)
void replace_variables_capture_avoiding_with_an_identifier_generator(T &x, Substitution &sigma, IdentifierGenerator &id_generator, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
lps::detail::add_capture_avoiding_replacement_with_an_identifier_generator< Builder, Derived, Substitution, IdentifierGenerator > super
substitution_updater_with_an_identifier_generator< Substitution, IdentifierGenerator > update_sigma
substitution_updater_with_an_identifier_generator< Substitution, IdentifierGenerator > update_sigma
action_formulas::detail::add_capture_avoiding_replacement_with_an_identifier_generator< Builder, Derived, Substitution, IdentifierGenerator > super
substitution_updater_with_an_identifier_generator< Substitution, IdentifierGenerator > update_sigma
data::detail::add_capture_avoiding_replacement_with_an_identifier_generator< Builder, Derived, Substitution, IdentifierGenerator > super