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//
9/// \file mcrl2/lps/if_rewrite.h
10/// \brief Applies the if rewriter to the data expressions in an LPS.
11
12#ifndef MCRL2_LPS_IF_REWRITE_H
13#define MCRL2_LPS_IF_REWRITE_H
14
15#include "mcrl2/data/rewriters/if_rewriter.h"
16#include "mcrl2/lps/builder.h"
17
18namespace mcrl2::lps
19{
20
21namespace detail {
22
24{
26 using super::apply;
27 using super::update;
28
30
31 template <class T>
32 void apply(T& result, const data::data_expression& x)
33 {
34 result = r(x);
35 }
36};
37
38} // namespace detail
39
40/// \brief Applies the if rewriter to all embedded data expressions in an object x
41/// \param x an object containing data expressions
42template <typename T>
43 requires(!std::is_base_of_v<atermpp::aterm, T>)
45{
47 f.update(x);
48}
49
50/// \brief Applies the if rewriter to all embedded data expressions in an object x
51/// \param x an object containing data expressions
52/// \return the rewrite result
53template <typename T>
54 requires(std::is_base_of_v<atermpp::aterm, T>)
55T if_rewrite(const T& x)
56{
57 T result;
59 f.apply(result, x);
60 return result;
61}
62
63} // namespace mcrl2::lps
64
65#endif // MCRL2_LPS_IF_REWRITE_H
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
The main namespace for the LPS library.
Definition constelm.h:18
data_expression operator()(const data_expression &x) const
void apply(T &result, const data::data_expression &x)
Definition if_rewrite.h:32