mCRL2
Loading...
Searching...
No Matches
add_binding.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_ADD_BINDING_H
13#define MCRL2_LPS_ADD_BINDING_H
14
16
17namespace mcrl2
18{
19
20namespace lps
21{
22
24template <template <class> class Builder, class Derived>
26{
28 using super::apply;
33
34 void enter(const action_summand& x)
35 {
37 }
38
39 void leave(const action_summand& x)
40 {
42 }
43
45 {
48 }
49
51 {
54 }
55
56 void enter(const deadlock_summand& x)
57 {
59 }
60
61 void leave(const deadlock_summand& x)
62 {
64 }
65
66 void enter(const linear_process& x)
67 {
69 }
70
71 void leave(const linear_process& x)
72 {
74 }
75
77 {
79 }
80
82 {
84 }
85
86 void enter(const specification& x)
87 {
89 }
90
91 void leave(const specification& x)
92 {
94 }
95
97 {
99 }
100
102 {
104 }
105
107 {
109 }
110
111 void leave(const stochastic_process_initializer& x)
113 decrease_bind_count(x.distribution().variables());
114 }
115};
116
117// TODO: get rid of this code duplication
118// special handling for where clauses
119template <template <class> class Builder, class Derived>
121{
123 using super::enter;
124 using super::leave;
125 using super::apply;
129
131 {
132 static_cast<Derived&>(*this).apply(x.declarations());
133 static_cast<Derived&>(*this).enter(x);
134 static_cast<Derived&>(*this).apply(x.body());
135 static_cast<Derived&>(*this).leave(x);
136 }
137};
138
139// special handling for where clauses
140template <template <class> class Builder, class Derived>
142{
144 using super::enter;
145 using super::leave;
146 using super::apply;
150
151 template <class T>
152 void apply(T& result, data::where_clause& x)
153 {
154 data::assignment_expression declarations;
155 static_cast<Derived&>(*this).apply(declarations, x.declarations());
156 static_cast<Derived&>(*this).enter(x);
157 data::make_where_clause(result, [&](data::data_expression& r){ static_cast<Derived&>(*this).apply(r, x.body()); }, declarations);
158 static_cast<Derived&>(*this).leave(x);
159 }
160};
161
162} // namespace lps
163
164} // namespace mcrl2
165
166#endif // MCRL2_LPS_ADD_BINDING_H
const std::multiset< variable_type > & bound_variables() const
Returns the bound variables.
Definition add_binding.h:74
\brief Assignment expression
Definition assignment.h:27
\brief A where expression
const data_expression & body() const
const assignment_expression_list & declarations() const
LPS summand containing a multi-action.
LPS summand containing a deadlock.
const data::variable_list & process_parameters() const
Returns the sequence of process parameters.
const std::set< data::variable > & global_variables() const
Returns the declared free variables of the LPS.
Linear process specification.
LPS summand containing a multi-action.
const stochastic_distribution & distribution() const
Returns the distribution of this summand.
const data::variable_list & variables() const
const stochastic_distribution & distribution() const
data::variable_list & summation_variables()
Returns the sequence of summation variables.
Definition summand.h:46
void make_where_clause(atermpp::aterm &t, const ARGUMENTS &... args)
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
Maintains a multiset of bound data variables during traversal.
Definition add_binding.h:34
void decrease_bind_count(const assignment_list &assignments)
Definition add_binding.h:51
void increase_bind_count(const assignment_list &assignments)
Definition add_binding.h:43
void enter(const data::where_clause &x)
Definition add_binding.h:59
void leave(const data::where_clause &x)
Definition add_binding.h:64
Maintains a multiset of bound data variables during traversal.
Definition add_binding.h:26
void decrease_bind_count(const assignment_list &assignments)
Definition add_binding.h:51
void enter(const stochastic_specification &x)
Definition add_binding.h:96
void enter(const action_summand &x)
Definition add_binding.h:34
void leave(const stochastic_specification &x)
data::add_data_variable_binding< Builder, Derived > super
Definition add_binding.h:27
void leave(const deadlock_summand &x)
Definition add_binding.h:61
void leave(const linear_process &x)
Definition add_binding.h:71
void enter(const stochastic_linear_process &x)
Definition add_binding.h:76
void leave(const action_summand &x)
Definition add_binding.h:39
void leave(const stochastic_linear_process &x)
Definition add_binding.h:81
void enter(const specification &x)
Definition add_binding.h:86
void enter(const deadlock_summand &x)
Definition add_binding.h:56
void enter(const stochastic_action_summand &x)
Definition add_binding.h:44
void leave(const specification &x)
Definition add_binding.h:91
void enter(const linear_process &x)
Definition add_binding.h:66
void increase_bind_count(const assignment_list &assignments)
Definition add_binding.h:43
void enter(const stochastic_process_initializer &x)
void leave(const stochastic_action_summand &x)
Definition add_binding.h:50
add_data_variable_binding< Builder, Derived > super
void apply(T &result, data::where_clause &x)
add_data_variable_binding< Builder, Derived > super
void apply(const data::where_clause &x)