mCRL2
Loading...
Searching...
No Matches
if_rewrite.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_LPS_IF_REWRITE_H
13#define MCRL2_LPS_IF_REWRITE_H
14
16#include "mcrl2/lps/builder.h"
17
18namespace mcrl2 {
19
20namespace lps {
21
22namespace detail {
23
24struct if_rewrite_builder: public lps::data_expression_builder<if_rewrite_builder>
25{
27 using super::apply;
28 using super::update;
29
31
32 template <class T>
33 void apply(T& result, const data::data_expression& x)
34 {
35 result = r(x);
36 }
37};
38
39} // namespace detail
40
43template <typename T>
44void if_rewrite(T& x, typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr)
45{
47 f.update(x);
48}
49
53template <typename T>
54T if_rewrite(const T& x, typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr)
55{
56 T result;
58 f.apply(result, x);
59 return result;
60}
61
62} // namespace lps
63
64} // namespace mcrl2
65
66#endif // MCRL2_LPS_IF_REWRITE_H
add your file description here.
add your file description here.
void if_rewrite(T &x, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
Applies the one point rule rewriter to all embedded data expressions in an object x.
Definition if_rewrite.h:44
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
void apply(T &result, const lps::multi_action &x)
Definition builder.h:212
void update(lps::deadlock &x)
Definition builder.h:202
void apply(T &result, const data::data_expression &x)
Definition if_rewrite.h:33
lps::data_expression_builder< if_rewrite_builder > super
Definition if_rewrite.h:26