mCRL2
Loading...
Searching...
No Matches
replace.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_PROCESS_REPLACE_H
13#define MCRL2_PROCESS_REPLACE_H
14
15#include "mcrl2/data/replace.h"
17
18namespace mcrl2
19{
20
21namespace process
22{
23
24//--- start generated process replace code ---//
25template <typename T, typename Substitution>
27 const Substitution& sigma,
28 bool innermost,
29 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
30 )
31{
32 data::detail::make_replace_sort_expressions_builder<process::sort_expression_builder>(sigma, innermost).update(x);
33}
34
35template <typename T, typename Substitution>
37 const Substitution& sigma,
38 bool innermost,
39 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
40 )
41{
42 T result;
43 data::detail::make_replace_sort_expressions_builder<process::sort_expression_builder>(sigma, innermost).apply(result, x);
44 return result;
45}
46
47template <typename T, typename Substitution>
49 const Substitution& sigma,
50 bool innermost,
51 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
52 )
53{
54 data::detail::make_replace_data_expressions_builder<process::data_expression_builder>(sigma, innermost).update(x);
55}
56
57template <typename T, typename Substitution>
59 const Substitution& sigma,
60 bool innermost,
61 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
62 )
63{
64 T result;
65 data::detail::make_replace_data_expressions_builder<process::data_expression_builder>(sigma, innermost).apply(result, x);
66 return result;
67}
68
69
70template <typename T, typename Substitution>
72 const Substitution& sigma,
73 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
74 )
75{
76 core::make_update_apply_builder<process::data_expression_builder>(sigma).update(x);
77}
78
79template <typename T, typename Substitution>
80T replace_variables(const T& x,
81 const Substitution& sigma,
82 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
83 )
84{
85 T result;
86 core::make_update_apply_builder<process::data_expression_builder>(sigma).apply(result, x);
87 return result;
88}
89
90template <typename T, typename Substitution>
92 const Substitution& sigma,
93 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
94 )
95{
96 core::make_update_apply_builder<process::variable_builder>(sigma).update(x);
97}
98
99template <typename T, typename Substitution>
101 const Substitution& sigma,
102 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
103 )
104{
105 T result;
106 core::make_update_apply_builder<process::variable_builder>(sigma).apply(result, x);
107 return result;
108}
109
112template <typename T, typename Substitution>
114 const Substitution& sigma,
115 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
116 )
117{
119 data::detail::make_replace_free_variables_builder<process::data_expression_builder, process::add_data_variable_builder_binding>(sigma).update(x);
120}
121
124template <typename T, typename Substitution>
126 const Substitution& sigma,
127 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
128 )
129{
131 T result;
132 data::detail::make_replace_free_variables_builder<process::data_expression_builder, process::add_data_variable_builder_binding>(sigma).apply(result, x);
133 return result;
134}
135
138template <typename T, typename Substitution, typename VariableContainer>
140 const Substitution& sigma,
141 const VariableContainer& bound_variables,
142 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
143 )
144{
146 data::detail::make_replace_free_variables_builder<process::data_expression_builder, process::add_data_variable_builder_binding>(sigma).update(x, bound_variables);
147}
148
151template <typename T, typename Substitution, typename VariableContainer>
153 const Substitution& sigma,
154 const VariableContainer& bound_variables,
155 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
156 )
157{
159 T result;
160 data::detail::make_replace_free_variables_builder<process::data_expression_builder, process::add_data_variable_builder_binding>(sigma).apply(result, x, bound_variables);
161 return result;
162}
163//--- end generated process replace code ---//
164
166{
169
172
174 : lhs(lhs_), rhs(rhs_)
175 {}
176
178 {
179 if (x == lhs)
180 {
181 return rhs;
182 }
183 return x;
184 }
185};
186
187template <typename T, typename Substitution>
189 const Substitution& sigma,
190 typename std::enable_if< !std::is_base_of< atermpp::aterm, T >::value >::type* = 0
191 )
192{
193 core::make_update_apply_builder<process::process_identifier_builder>(sigma).update(x);
194}
195
196template <typename T, typename Substitution>
198 const Substitution& sigma,
199 typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value >::type* = nullptr
200 )
201{
202 T result;
203 core::make_update_apply_builder<process::process_identifier_builder>(sigma).apply(result, x);
204 return result;
205}
206
207} // namespace process
208
209} // namespace mcrl2
210
211#endif // MCRL2_PROCESS_REPLACE_H
\brief A process identifier
add your file description here.
static RewriterCompilingJitty::substitution_type & sigma(RewriterCompilingJitty *this_rewriter)
bool is_simple_substitution(const Substitution &)
Returns true if the substitution sigma satisfies the property that FV(sigma(x)) is included in {x} fo...
void replace_sort_expressions(T &x, const Substitution &sigma, bool innermost, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
Definition replace.h:26
void replace_process_identifiers(T &x, const Substitution &sigma, typename std::enable_if< !std::is_base_of< atermpp::aterm, T >::value >::type *=0)
Definition replace.h:188
void replace_free_variables(T &x, const Substitution &sigma, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
Definition replace.h:113
void replace_data_expressions(T &x, const Substitution &sigma, bool innermost, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
Definition replace.h:48
void replace_variables(T &x, const Substitution &sigma, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
Definition replace.h:71
void replace_all_variables(T &x, const Substitution &sigma, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
Definition replace.h:91
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.
process_identifier_assignment(const process_identifier &lhs_, const process_identifier &rhs_)
Definition replace.h:173
process_identifier operator()(const process_identifier &x) const
Definition replace.h:177