mCRL2
Loading...
Searching...
No Matches
substitution_utility.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_SUBSTITUTION_UTILITY_H
13#define MCRL2_DATA_SUBSTITUTION_UTILITY_H
14
15#include "mcrl2/data/variable.h"
17
18namespace mcrl2 {
19
20namespace data {
21
23template <typename VariableSequence, typename DataExpressionSequence>
24inline
25void add_assignments(data::mutable_indexed_substitution<>& sigma, const VariableSequence& v, const DataExpressionSequence& e)
26{
27 assert(v.size() <= e.size());
28 auto vi = v.begin();
29 auto ei = e.begin();
30 for (; vi != v.end(); ++vi, ++ei)
31 {
32 sigma[*vi] = *ei;
33 }
34}
35
37template <typename VariableSequence>
38inline
40{
41 for (const data::variable& vi: v)
42 {
43 sigma[vi] = vi;
44 }
45}
46
47} // namespace data
48
49} // namespace mcrl2
50
51#endif // MCRL2_DATA_SUBSTITUTION_UTILITY_H
\brief A data variable
Definition variable.h:28
static RewriterCompilingJitty::substitution_type & sigma(RewriterCompilingJitty *this_rewriter)
add your file description here.
void add_assignments(data::mutable_indexed_substitution<> &sigma, const VariableSequence &v, const DataExpressionSequence &e)
Adds assignments [v := e] to the substitution sigma for each variable in v.
void remove_assignments(data::mutable_indexed_substitution<> &sigma, const VariableSequence &v)
Removes assignments to variables in v from the substitution sigma.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
The class variable.