mCRL2
Loading...
Searching...
No Matches
variable_substitution.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_DATA_SUBSTITUTIONS_VARIABLE_SUBSTITUTION_H
13#define MCRL2_DATA_SUBSTITUTIONS_VARIABLE_SUBSTITUTION_H
14
16#include "mcrl2/data/find.h"
18
19namespace mcrl2 {
20
21namespace data {
22
25{
30
31 const variable& lhs;
33
35 : lhs(lhs_),
36 rhs(rhs_)
37 {}
38
39 const data_expression& operator()(const variable& x) const
40 {
41 if (x == lhs)
42 {
43 return rhs;
44 }
45 return x;
46 }
47};
48
49inline
50std::set<data::variable> substitution_variables(const variable_substitution& sigma)
51{
52 std::set<data::variable> result;
53 data::find_free_variables(sigma.rhs, std::inserter(result, result.end()));
54 return result;
55}
56
57} // namespace data
58
59} // namespace mcrl2
60
61#endif // MCRL2_DATA_SUBSTITUTIONS_VARIABLE_SUBSTITUTION_H
\brief A data variable
Definition variable.h:28
Search functions of the data library.
add your file description here.
static RewriterCompilingJitty::substitution_type & sigma(RewriterCompilingJitty *this_rewriter)
std::set< data::variable > substitution_variables(const Substitution &)
Returns the variables appearing in the right hand sides of the substitution.
Definition replace.h:161
std::set< data::variable > find_free_variables(const data::data_expression &x)
Definition data.cpp:99
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
Substitution that maps a single variable to a data expression.
const data_expression & operator()(const variable &x) const
variable_substitution(const variable &lhs_, const data_expression &rhs_)
add your file description here.