12#ifndef MCRL2_MODAL_FORMULA_REPLACE_H
13#define MCRL2_MODAL_FORMULA_REPLACE_H
21namespace action_formulas
25template <
typename T,
typename Substitution>
27 const Substitution&
sigma,
29 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
32 data::detail::make_replace_sort_expressions_builder<action_formulas::sort_expression_builder>(
sigma, innermost).update(x);
35template <
typename T,
typename Substitution>
37 const Substitution&
sigma,
39 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
43 data::detail::make_replace_sort_expressions_builder<action_formulas::sort_expression_builder>(
sigma, innermost).apply(result, x);
47template <
typename T,
typename Substitution>
49 const Substitution&
sigma,
51 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
54 data::detail::make_replace_data_expressions_builder<action_formulas::data_expression_builder>(
sigma, innermost).update(x);
57template <
typename T,
typename Substitution>
59 const Substitution&
sigma,
61 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
65 data::detail::make_replace_data_expressions_builder<action_formulas::data_expression_builder>(
sigma, innermost).apply(result, x);
70template <
typename T,
typename Substitution>
72 const Substitution&
sigma,
73 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
76 core::make_update_apply_builder<action_formulas::data_expression_builder>(
sigma).update(x);
79template <
typename T,
typename Substitution>
81 const Substitution&
sigma,
82 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
86 core::make_update_apply_builder<action_formulas::data_expression_builder>(
sigma).apply(result, x);
90template <
typename T,
typename Substitution>
92 const Substitution&
sigma,
93 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
96 core::make_update_apply_builder<action_formulas::variable_builder>(
sigma).update(x);
99template <
typename T,
typename Substitution>
101 const Substitution&
sigma,
102 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
106 core::make_update_apply_builder<action_formulas::variable_builder>(
sigma).apply(result, x);
112template <
typename T,
typename Substitution>
114 const Substitution&
sigma,
115 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
119 data::detail::make_replace_free_variables_builder<action_formulas::data_expression_builder, action_formulas::add_data_variable_builder_binding>(
sigma).update(x);
124template <
typename T,
typename Substitution>
126 const Substitution&
sigma,
127 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
132 data::detail::make_replace_free_variables_builder<action_formulas::data_expression_builder, action_formulas::add_data_variable_builder_binding>(
sigma).apply(result, x);
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
146 data::detail::make_replace_free_variables_builder<action_formulas::data_expression_builder, action_formulas::add_data_variable_builder_binding>(
sigma).update(x, bound_variables);
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
160 data::detail::make_replace_free_variables_builder<action_formulas::data_expression_builder, action_formulas::add_data_variable_builder_binding>(
sigma).apply(result, x, bound_variables);
167namespace regular_formulas
171template <
typename T,
typename Substitution>
173 const Substitution&
sigma,
175 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
178 data::detail::make_replace_sort_expressions_builder<regular_formulas::sort_expression_builder>(
sigma, innermost).update(x);
181template <
typename T,
typename Substitution>
183 const Substitution&
sigma,
185 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
189 data::detail::make_replace_sort_expressions_builder<regular_formulas::sort_expression_builder>(
sigma, innermost).apply(result, x);
193template <
typename T,
typename Substitution>
195 const Substitution&
sigma,
197 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
200 data::detail::make_replace_data_expressions_builder<regular_formulas::data_expression_builder>(
sigma, innermost).update(x);
203template <
typename T,
typename Substitution>
205 const Substitution&
sigma,
207 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
211 data::detail::make_replace_data_expressions_builder<regular_formulas::data_expression_builder>(
sigma, innermost).apply(result, x);
216template <
typename T,
typename Substitution>
218 const Substitution&
sigma,
219 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
222 core::make_update_apply_builder<regular_formulas::data_expression_builder>(
sigma).update(x);
225template <
typename T,
typename Substitution>
227 const Substitution&
sigma,
228 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
232 core::make_update_apply_builder<regular_formulas::data_expression_builder>(
sigma).apply(result, x);
236template <
typename T,
typename Substitution>
238 const Substitution&
sigma,
239 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
242 core::make_update_apply_builder<regular_formulas::variable_builder>(
sigma).update(x);
245template <
typename T,
typename Substitution>
247 const Substitution&
sigma,
248 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
252 core::make_update_apply_builder<regular_formulas::variable_builder>(
sigma).apply(result, x);
258template <
typename T,
typename Substitution>
260 const Substitution&
sigma,
261 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
265 data::detail::make_replace_free_variables_builder<regular_formulas::data_expression_builder, regular_formulas::add_data_variable_builder_binding>(
sigma).update(x);
270template <
typename T,
typename Substitution>
272 const Substitution&
sigma,
273 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
278 data::detail::make_replace_free_variables_builder<regular_formulas::data_expression_builder, regular_formulas::add_data_variable_builder_binding>(
sigma).apply(result, x);
284template <
typename T,
typename Substitution,
typename VariableContainer>
286 const Substitution&
sigma,
287 const VariableContainer& bound_variables,
288 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
292 data::detail::make_replace_free_variables_builder<regular_formulas::data_expression_builder, regular_formulas::add_data_variable_builder_binding>(
sigma).update(x, bound_variables);
297template <
typename T,
typename Substitution,
typename VariableContainer>
299 const Substitution&
sigma,
300 const VariableContainer& bound_variables,
301 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
306 data::detail::make_replace_free_variables_builder<regular_formulas::data_expression_builder, regular_formulas::add_data_variable_builder_binding>(
sigma).apply(result, x, bound_variables);
313namespace state_formulas
317template <
typename T,
typename Substitution>
319 const Substitution&
sigma,
321 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
324 data::detail::make_replace_sort_expressions_builder<state_formulas::sort_expression_builder>(
sigma, innermost).update(x);
327template <
typename T,
typename Substitution>
329 const Substitution&
sigma,
331 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
335 data::detail::make_replace_sort_expressions_builder<state_formulas::sort_expression_builder>(
sigma, innermost).apply(result, x);
339template <
typename T,
typename Substitution>
341 const Substitution&
sigma,
343 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
346 data::detail::make_replace_data_expressions_builder<state_formulas::data_expression_builder>(
sigma, innermost).update(x);
349template <
typename T,
typename Substitution>
351 const Substitution&
sigma,
353 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
357 data::detail::make_replace_data_expressions_builder<state_formulas::data_expression_builder>(
sigma, innermost).apply(result, x);
362template <
typename T,
typename Substitution>
364 const Substitution&
sigma,
365 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
368 core::make_update_apply_builder<state_formulas::data_expression_builder>(
sigma).update(x);
371template <
typename T,
typename Substitution>
373 const Substitution&
sigma,
374 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
378 core::make_update_apply_builder<state_formulas::data_expression_builder>(
sigma).apply(result, x);
382template <
typename T,
typename Substitution>
384 const Substitution&
sigma,
385 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
388 core::make_update_apply_builder<state_formulas::variable_builder>(
sigma).update(x);
391template <
typename T,
typename Substitution>
393 const Substitution&
sigma,
394 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
398 core::make_update_apply_builder<state_formulas::variable_builder>(
sigma).apply(result, x);
404template <
typename T,
typename Substitution>
406 const Substitution&
sigma,
407 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
411 data::detail::make_replace_free_variables_builder<state_formulas::data_expression_builder, state_formulas::add_data_variable_builder_binding>(
sigma).update(x);
416template <
typename T,
typename Substitution>
418 const Substitution&
sigma,
419 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
424 data::detail::make_replace_free_variables_builder<state_formulas::data_expression_builder, state_formulas::add_data_variable_builder_binding>(
sigma).apply(result, x);
430template <
typename T,
typename Substitution,
typename VariableContainer>
432 const Substitution&
sigma,
433 const VariableContainer& bound_variables,
434 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
438 data::detail::make_replace_free_variables_builder<state_formulas::data_expression_builder, state_formulas::add_data_variable_builder_binding>(
sigma).update(x, bound_variables);
443template <
typename T,
typename Substitution,
typename VariableContainer>
445 const Substitution&
sigma,
446 const VariableContainer& bound_variables,
447 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
452 data::detail::make_replace_free_variables_builder<state_formulas::data_expression_builder, state_formulas::add_data_variable_builder_binding>(
sigma).apply(result, x, bound_variables);
461template <
template <
class>
class Builder,
class Substitution>
462struct substitute_state_formulas_builder:
public Builder<substitute_state_formulas_builder<Builder, Substitution> >
464 typedef Builder<substitute_state_formulas_builder<Builder, Substitution> > super;
473 substitute_state_formulas_builder(Substitution sigma_,
bool innermost_)
475 innermost(innermost_)
479 void apply(T& result,
const state_formula& x)
492template <
template <
class>
class Builder,
class Substitution>
493substitute_state_formulas_builder<Builder, Substitution>
494make_replace_state_formulas_builder(Substitution
sigma,
bool innermost)
496 return substitute_state_formulas_builder<Builder, Substitution>(
sigma, innermost);
502template <
typename T,
typename Substitution>
505 bool innermost =
true,
506 typename std::enable_if< !std::is_base_of< atermpp::aterm, T >::value>::type* = 0
509 state_formulas::detail::make_replace_state_formulas_builder<state_formulas::state_formula_builder>(
sigma, innermost).update(x);
512template <
typename T,
typename Substitution>
515 bool innermost =
true,
516 typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value>::type* =
nullptr
520 state_formulas::detail::make_replace_state_formulas_builder<state_formulas::state_formula_builder>(
sigma, innermost).apply(result, x);
static RewriterCompilingJitty::substitution_type & sigma(RewriterCompilingJitty *this_rewriter)
add your file description here.
bool is_simple_substitution(const Substitution &)
Returns true if the substitution sigma satisfies the property that FV(sigma(x)) is included in {x} fo...
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...