Line data Source code
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/process/builder.h
10 : /// \brief add your file description here.
11 :
12 : #ifndef MCRL2_PROCESS_BUILDER_H
13 : #define MCRL2_PROCESS_BUILDER_H
14 :
15 : #include "mcrl2/data/builder.h"
16 : #include "mcrl2/process/process_specification.h"
17 : #include "mcrl2/process/untyped_multi_action.h"
18 : // #include "mcrl2/lps/multi_action.h"
19 :
20 : namespace mcrl2
21 : {
22 :
23 : namespace process
24 : {
25 :
26 : // Adds sort expression traversal to a builder
27 : //--- start generated add_sort_expressions code ---//
28 : template <template <class> class Builder, class Derived>
29 : struct add_sort_expressions: public Builder<Derived>
30 : {
31 : typedef Builder<Derived> super;
32 : using super::enter;
33 : using super::leave;
34 : using super::update;
35 : using super::apply;
36 :
37 : template <class T>
38 2869 : void apply(T& result, const process::action_label& x)
39 : {
40 :
41 2869 : static_cast<Derived&>(*this).enter(x);
42 5738 : process::make_action_label(result, x.name(), [&](data::sort_expression_list& result){ static_cast<Derived&>(*this).apply(result, x.sorts()); });
43 2869 : static_cast<Derived&>(*this).leave(x);
44 2869 : }
45 :
46 1135 : void update(process::process_specification& x)
47 : {
48 1135 : static_cast<Derived&>(*this).enter(x);
49 1135 : process::action_label_list result_action_labels;
50 1135 : static_cast<Derived&>(*this).apply(result_action_labels, x.action_labels());
51 1135 : x.action_labels() = result_action_labels;
52 1135 : static_cast<Derived&>(*this).update(x.global_variables());
53 1135 : static_cast<Derived&>(*this).update(x.equations());
54 1135 : process_expression result_init;
55 1135 : static_cast<Derived&>(*this).apply(result_init, x.init());
56 1135 : x.init() = result_init;
57 1135 : static_cast<Derived&>(*this).leave(x);
58 1135 : }
59 :
60 : template <class T>
61 1140 : void apply(T& result, const process::process_identifier& x)
62 : {
63 :
64 1140 : static_cast<Derived&>(*this).enter(x);
65 2280 : process::make_process_identifier(result, x.name(), [&](data::variable_list& result){ static_cast<Derived&>(*this).apply(result, x.variables()); });
66 1140 : static_cast<Derived&>(*this).leave(x);
67 1140 : }
68 :
69 : template <class T>
70 1140 : void apply(T& result, const process::process_equation& x)
71 : {
72 :
73 1140 : static_cast<Derived&>(*this).enter(x);
74 4560 : process::make_process_equation(result, [&](process_identifier& result){ static_cast<Derived&>(*this).apply(result, x.identifier()); }, [&](data::variable_list& result){ static_cast<Derived&>(*this).apply(result, x.formal_parameters()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.expression()); });
75 1140 : static_cast<Derived&>(*this).leave(x);
76 1140 : }
77 :
78 : template <class T>
79 165 : void apply(T& result, const process::untyped_multi_action& x)
80 : {
81 :
82 165 : static_cast<Derived&>(*this).enter(x);
83 330 : process::make_untyped_multi_action(result, [&](data::untyped_data_parameter_list& result){ static_cast<Derived&>(*this).apply(result, x.actions()); });
84 165 : static_cast<Derived&>(*this).leave(x);
85 165 : }
86 :
87 : template <class T>
88 270 : void apply(T& result, const process::action& x)
89 : {
90 :
91 270 : static_cast<Derived&>(*this).enter(x);
92 810 : process::make_action(result, [&](action_label& result){ static_cast<Derived&>(*this).apply(result, x.label()); }, [&](data::data_expression_list& result){ static_cast<Derived&>(*this).apply(result, x.arguments()); });
93 270 : static_cast<Derived&>(*this).leave(x);
94 270 : }
95 :
96 : template <class T>
97 0 : void apply(T& result, const process::process_instance& x)
98 : {
99 :
100 0 : static_cast<Derived&>(*this).enter(x);
101 0 : process::make_process_instance(result, [&](process_identifier& result){ static_cast<Derived&>(*this).apply(result, x.identifier()); }, [&](data::data_expression_list& result){ static_cast<Derived&>(*this).apply(result, x.actual_parameters()); });
102 0 : static_cast<Derived&>(*this).leave(x);
103 0 : }
104 :
105 : template <class T>
106 0 : void apply(T& result, const process::process_instance_assignment& x)
107 : {
108 :
109 0 : static_cast<Derived&>(*this).enter(x);
110 0 : process::make_process_instance_assignment(result, [&](process_identifier& result){ static_cast<Derived&>(*this).apply(result, x.identifier()); }, [&](data::assignment_list& result){ static_cast<Derived&>(*this).apply(result, x.assignments()); });
111 0 : static_cast<Derived&>(*this).leave(x);
112 0 : }
113 :
114 : template <class T>
115 504 : void apply(T& result, const process::delta& x)
116 : {
117 :
118 504 : result = x;
119 504 : static_cast<Derived&>(*this).enter(x);
120 : // skip
121 504 : static_cast<Derived&>(*this).leave(x);
122 504 : result = x;
123 504 : }
124 :
125 : template <class T>
126 162 : void apply(T& result, const process::tau& x)
127 : {
128 :
129 162 : result = x;
130 162 : static_cast<Derived&>(*this).enter(x);
131 : // skip
132 162 : static_cast<Derived&>(*this).leave(x);
133 162 : result = x;
134 162 : }
135 :
136 : template <class T>
137 613 : void apply(T& result, const process::sum& x)
138 : {
139 :
140 613 : static_cast<Derived&>(*this).enter(x);
141 1839 : process::make_sum(result, [&](data::variable_list& result){ static_cast<Derived&>(*this).apply(result, x.variables()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
142 613 : static_cast<Derived&>(*this).leave(x);
143 613 : }
144 :
145 : template <class T>
146 0 : void apply(T& result, const process::block& x)
147 : {
148 :
149 0 : static_cast<Derived&>(*this).enter(x);
150 0 : process::make_block(result, x.block_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
151 0 : static_cast<Derived&>(*this).leave(x);
152 0 : }
153 :
154 : template <class T>
155 24 : void apply(T& result, const process::hide& x)
156 : {
157 :
158 24 : static_cast<Derived&>(*this).enter(x);
159 48 : process::make_hide(result, x.hide_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
160 24 : static_cast<Derived&>(*this).leave(x);
161 24 : }
162 :
163 : template <class T>
164 0 : void apply(T& result, const process::rename& x)
165 : {
166 :
167 0 : static_cast<Derived&>(*this).enter(x);
168 0 : process::make_rename(result, x.rename_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
169 0 : static_cast<Derived&>(*this).leave(x);
170 0 : }
171 :
172 : template <class T>
173 121 : void apply(T& result, const process::comm& x)
174 : {
175 :
176 121 : static_cast<Derived&>(*this).enter(x);
177 242 : process::make_comm(result, x.comm_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
178 121 : static_cast<Derived&>(*this).leave(x);
179 121 : }
180 :
181 : template <class T>
182 69 : void apply(T& result, const process::allow& x)
183 : {
184 :
185 69 : static_cast<Derived&>(*this).enter(x);
186 138 : process::make_allow(result, x.allow_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
187 69 : static_cast<Derived&>(*this).leave(x);
188 69 : }
189 :
190 : template <class T>
191 325 : void apply(T& result, const process::sync& x)
192 : {
193 :
194 325 : static_cast<Derived&>(*this).enter(x);
195 975 : process::make_sync(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
196 325 : static_cast<Derived&>(*this).leave(x);
197 325 : }
198 :
199 : template <class T>
200 342 : void apply(T& result, const process::at& x)
201 : {
202 :
203 342 : static_cast<Derived&>(*this).enter(x);
204 1026 : process::make_at(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); }, [&](data::data_expression& result){ static_cast<Derived&>(*this).apply(result, x.time_stamp()); });
205 342 : static_cast<Derived&>(*this).leave(x);
206 342 : }
207 :
208 : template <class T>
209 2202 : void apply(T& result, const process::seq& x)
210 : {
211 :
212 2202 : static_cast<Derived&>(*this).enter(x);
213 6606 : process::make_seq(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
214 2202 : static_cast<Derived&>(*this).leave(x);
215 2202 : }
216 :
217 : template <class T>
218 672 : void apply(T& result, const process::if_then& x)
219 : {
220 :
221 672 : static_cast<Derived&>(*this).enter(x);
222 2016 : process::make_if_then(result, [&](data::data_expression& result){ static_cast<Derived&>(*this).apply(result, x.condition()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.then_case()); });
223 672 : static_cast<Derived&>(*this).leave(x);
224 672 : }
225 :
226 : template <class T>
227 125 : void apply(T& result, const process::if_then_else& x)
228 : {
229 :
230 125 : static_cast<Derived&>(*this).enter(x);
231 500 : process::make_if_then_else(result, [&](data::data_expression& result){ static_cast<Derived&>(*this).apply(result, x.condition()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.then_case()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.else_case()); });
232 125 : static_cast<Derived&>(*this).leave(x);
233 125 : }
234 :
235 : template <class T>
236 0 : void apply(T& result, const process::bounded_init& x)
237 : {
238 :
239 0 : static_cast<Derived&>(*this).enter(x);
240 0 : process::make_bounded_init(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
241 0 : static_cast<Derived&>(*this).leave(x);
242 0 : }
243 :
244 : template <class T>
245 341 : void apply(T& result, const process::merge& x)
246 : {
247 :
248 341 : static_cast<Derived&>(*this).enter(x);
249 1023 : process::make_merge(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
250 341 : static_cast<Derived&>(*this).leave(x);
251 341 : }
252 :
253 : template <class T>
254 0 : void apply(T& result, const process::left_merge& x)
255 : {
256 :
257 0 : static_cast<Derived&>(*this).enter(x);
258 0 : process::make_left_merge(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
259 0 : static_cast<Derived&>(*this).leave(x);
260 0 : }
261 :
262 : template <class T>
263 806 : void apply(T& result, const process::choice& x)
264 : {
265 :
266 806 : static_cast<Derived&>(*this).enter(x);
267 2418 : process::make_choice(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
268 806 : static_cast<Derived&>(*this).leave(x);
269 806 : }
270 :
271 : template <class T>
272 136 : void apply(T& result, const process::stochastic_operator& x)
273 : {
274 :
275 136 : static_cast<Derived&>(*this).enter(x);
276 544 : process::make_stochastic_operator(result, [&](data::variable_list& result){ static_cast<Derived&>(*this).apply(result, x.variables()); }, [&](data::data_expression& result){ static_cast<Derived&>(*this).apply(result, x.distribution()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
277 136 : static_cast<Derived&>(*this).leave(x);
278 136 : }
279 :
280 : template <class T>
281 441 : void apply(T& result, const process::untyped_process_assignment& x)
282 : {
283 :
284 441 : static_cast<Derived&>(*this).enter(x);
285 882 : process::make_untyped_process_assignment(result, x.name(), [&](data::untyped_identifier_assignment_list& result){ static_cast<Derived&>(*this).apply(result, x.assignments()); });
286 441 : static_cast<Derived&>(*this).leave(x);
287 441 : }
288 :
289 : template <class T>
290 11873 : void apply(T& result, const process::process_expression& x)
291 : {
292 :
293 11873 : static_cast<Derived&>(*this).enter(x);
294 11873 : if (data::is_untyped_data_parameter(x))
295 : {
296 4978 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<data::untyped_data_parameter>(x));
297 : }
298 6895 : else if (process::is_action(x))
299 : {
300 12 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::action>(x));
301 : }
302 6883 : else if (process::is_process_instance(x))
303 : {
304 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::process_instance>(x));
305 : }
306 6883 : else if (process::is_process_instance_assignment(x))
307 : {
308 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::process_instance_assignment>(x));
309 : }
310 6883 : else if (process::is_delta(x))
311 : {
312 504 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::delta>(x));
313 : }
314 6379 : else if (process::is_tau(x))
315 : {
316 162 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::tau>(x));
317 : }
318 6217 : else if (process::is_sum(x))
319 : {
320 613 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::sum>(x));
321 : }
322 5604 : else if (process::is_block(x))
323 : {
324 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::block>(x));
325 : }
326 5604 : else if (process::is_hide(x))
327 : {
328 24 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::hide>(x));
329 : }
330 5580 : else if (process::is_rename(x))
331 : {
332 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::rename>(x));
333 : }
334 5580 : else if (process::is_comm(x))
335 : {
336 121 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::comm>(x));
337 : }
338 5459 : else if (process::is_allow(x))
339 : {
340 69 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::allow>(x));
341 : }
342 5390 : else if (process::is_sync(x))
343 : {
344 325 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::sync>(x));
345 : }
346 5065 : else if (process::is_at(x))
347 : {
348 342 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::at>(x));
349 : }
350 4723 : else if (process::is_seq(x))
351 : {
352 2202 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::seq>(x));
353 : }
354 2521 : else if (process::is_if_then(x))
355 : {
356 672 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::if_then>(x));
357 : }
358 1849 : else if (process::is_if_then_else(x))
359 : {
360 125 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::if_then_else>(x));
361 : }
362 1724 : else if (process::is_bounded_init(x))
363 : {
364 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::bounded_init>(x));
365 : }
366 1724 : else if (process::is_merge(x))
367 : {
368 341 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::merge>(x));
369 : }
370 1383 : else if (process::is_left_merge(x))
371 : {
372 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::left_merge>(x));
373 : }
374 1383 : else if (process::is_choice(x))
375 : {
376 806 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::choice>(x));
377 : }
378 577 : else if (process::is_stochastic_operator(x))
379 : {
380 136 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::stochastic_operator>(x));
381 : }
382 441 : else if (process::is_untyped_process_assignment(x))
383 : {
384 441 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::untyped_process_assignment>(x));
385 : }
386 11873 : static_cast<Derived&>(*this).leave(x);
387 11873 : }
388 :
389 : };
390 :
391 : /// \\brief Builder class
392 : template <typename Derived>
393 : struct sort_expression_builder: public add_sort_expressions<data::sort_expression_builder, Derived>
394 : {
395 : };
396 : //--- end generated add_sort_expressions code ---//
397 :
398 : // Adds data expression traversal to a builder
399 : //--- start generated add_data_expressions code ---//
400 : template <template <class> class Builder, class Derived>
401 : struct add_data_expressions: public Builder<Derived>
402 : {
403 : typedef Builder<Derived> super;
404 : using super::enter;
405 : using super::leave;
406 : using super::update;
407 : using super::apply;
408 :
409 1128 : void update(process::process_specification& x)
410 : {
411 1128 : static_cast<Derived&>(*this).enter(x);
412 1128 : static_cast<Derived&>(*this).update(x.equations());
413 1128 : process_expression result_init;
414 1128 : static_cast<Derived&>(*this).apply(result_init, x.init());
415 1128 : x.init() = result_init;
416 1128 : static_cast<Derived&>(*this).leave(x);
417 1128 : }
418 :
419 : template <class T>
420 1135 : void apply(T& result, const process::process_equation& x)
421 : {
422 :
423 1135 : static_cast<Derived&>(*this).enter(x);
424 2270 : process::make_process_equation(result, x.identifier(), x.formal_parameters(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.expression()); });
425 1135 : static_cast<Derived&>(*this).leave(x);
426 1135 : }
427 :
428 : template <class T>
429 0 : void apply(T& result, const process::untyped_multi_action& x)
430 : {
431 :
432 0 : static_cast<Derived&>(*this).enter(x);
433 0 : process::make_untyped_multi_action(result, [&](data::untyped_data_parameter_list& result){ static_cast<Derived&>(*this).apply(result, x.actions()); });
434 0 : static_cast<Derived&>(*this).leave(x);
435 0 : }
436 :
437 : template <class T>
438 16097 : void apply(T& result, const process::action& x)
439 : {
440 :
441 16097 : static_cast<Derived&>(*this).enter(x);
442 32194 : process::make_action(result, x.label(), [&](data::data_expression_list& result){ static_cast<Derived&>(*this).apply(result, x.arguments()); });
443 16097 : static_cast<Derived&>(*this).leave(x);
444 16097 : }
445 :
446 : template <class T>
447 2119 : void apply(T& result, const process::process_instance& x)
448 : {
449 :
450 2119 : static_cast<Derived&>(*this).enter(x);
451 4238 : process::make_process_instance(result, x.identifier(), [&](data::data_expression_list& result){ static_cast<Derived&>(*this).apply(result, x.actual_parameters()); });
452 2119 : static_cast<Derived&>(*this).leave(x);
453 2119 : }
454 :
455 : template <class T>
456 434 : void apply(T& result, const process::process_instance_assignment& x)
457 : {
458 :
459 434 : static_cast<Derived&>(*this).enter(x);
460 868 : process::make_process_instance_assignment(result, x.identifier(), [&](data::assignment_list& result){ static_cast<Derived&>(*this).apply(result, x.assignments()); });
461 434 : static_cast<Derived&>(*this).leave(x);
462 434 : }
463 :
464 : template <class T>
465 503 : void apply(T& result, const process::delta& x)
466 : {
467 :
468 503 : result = x;
469 503 : static_cast<Derived&>(*this).enter(x);
470 : // skip
471 503 : static_cast<Derived&>(*this).leave(x);
472 503 : result = x;
473 503 : }
474 :
475 : template <class T>
476 156 : void apply(T& result, const process::tau& x)
477 : {
478 :
479 156 : result = x;
480 156 : static_cast<Derived&>(*this).enter(x);
481 : // skip
482 156 : static_cast<Derived&>(*this).leave(x);
483 156 : result = x;
484 156 : }
485 :
486 : template <class T>
487 613 : void apply(T& result, const process::sum& x)
488 : {
489 :
490 613 : static_cast<Derived&>(*this).enter(x);
491 1226 : process::make_sum(result, x.variables(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
492 613 : static_cast<Derived&>(*this).leave(x);
493 613 : }
494 :
495 : template <class T>
496 0 : void apply(T& result, const process::block& x)
497 : {
498 :
499 0 : static_cast<Derived&>(*this).enter(x);
500 0 : process::make_block(result, x.block_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
501 0 : static_cast<Derived&>(*this).leave(x);
502 0 : }
503 :
504 : template <class T>
505 24 : void apply(T& result, const process::hide& x)
506 : {
507 :
508 24 : static_cast<Derived&>(*this).enter(x);
509 48 : process::make_hide(result, x.hide_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
510 24 : static_cast<Derived&>(*this).leave(x);
511 24 : }
512 :
513 : template <class T>
514 0 : void apply(T& result, const process::rename& x)
515 : {
516 :
517 0 : static_cast<Derived&>(*this).enter(x);
518 0 : process::make_rename(result, x.rename_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
519 0 : static_cast<Derived&>(*this).leave(x);
520 0 : }
521 :
522 : template <class T>
523 121 : void apply(T& result, const process::comm& x)
524 : {
525 :
526 121 : static_cast<Derived&>(*this).enter(x);
527 242 : process::make_comm(result, x.comm_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
528 121 : static_cast<Derived&>(*this).leave(x);
529 121 : }
530 :
531 : template <class T>
532 69 : void apply(T& result, const process::allow& x)
533 : {
534 :
535 69 : static_cast<Derived&>(*this).enter(x);
536 138 : process::make_allow(result, x.allow_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
537 69 : static_cast<Derived&>(*this).leave(x);
538 69 : }
539 :
540 : template <class T>
541 325 : void apply(T& result, const process::sync& x)
542 : {
543 :
544 325 : static_cast<Derived&>(*this).enter(x);
545 975 : process::make_sync(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
546 325 : static_cast<Derived&>(*this).leave(x);
547 325 : }
548 :
549 : template <class T>
550 343 : void apply(T& result, const process::at& x)
551 : {
552 :
553 343 : static_cast<Derived&>(*this).enter(x);
554 1029 : process::make_at(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); }, [&](data::data_expression& result){ static_cast<Derived&>(*this).apply(result, x.time_stamp()); });
555 343 : static_cast<Derived&>(*this).leave(x);
556 343 : }
557 :
558 : template <class T>
559 2361 : void apply(T& result, const process::seq& x)
560 : {
561 :
562 2361 : static_cast<Derived&>(*this).enter(x);
563 7083 : process::make_seq(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
564 2361 : static_cast<Derived&>(*this).leave(x);
565 2361 : }
566 :
567 : template <class T>
568 798 : void apply(T& result, const process::if_then& x)
569 : {
570 :
571 798 : static_cast<Derived&>(*this).enter(x);
572 2394 : process::make_if_then(result, [&](data::data_expression& result){ static_cast<Derived&>(*this).apply(result, x.condition()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.then_case()); });
573 798 : static_cast<Derived&>(*this).leave(x);
574 798 : }
575 :
576 : template <class T>
577 125 : void apply(T& result, const process::if_then_else& x)
578 : {
579 :
580 125 : static_cast<Derived&>(*this).enter(x);
581 500 : process::make_if_then_else(result, [&](data::data_expression& result){ static_cast<Derived&>(*this).apply(result, x.condition()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.then_case()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.else_case()); });
582 125 : static_cast<Derived&>(*this).leave(x);
583 125 : }
584 :
585 : template <class T>
586 0 : void apply(T& result, const process::bounded_init& x)
587 : {
588 :
589 0 : static_cast<Derived&>(*this).enter(x);
590 0 : process::make_bounded_init(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
591 0 : static_cast<Derived&>(*this).leave(x);
592 0 : }
593 :
594 : template <class T>
595 341 : void apply(T& result, const process::merge& x)
596 : {
597 :
598 341 : static_cast<Derived&>(*this).enter(x);
599 1023 : process::make_merge(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
600 341 : static_cast<Derived&>(*this).leave(x);
601 341 : }
602 :
603 : template <class T>
604 0 : void apply(T& result, const process::left_merge& x)
605 : {
606 :
607 0 : static_cast<Derived&>(*this).enter(x);
608 0 : process::make_left_merge(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
609 0 : static_cast<Derived&>(*this).leave(x);
610 0 : }
611 :
612 : template <class T>
613 913 : void apply(T& result, const process::choice& x)
614 : {
615 :
616 913 : static_cast<Derived&>(*this).enter(x);
617 2739 : process::make_choice(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
618 913 : static_cast<Derived&>(*this).leave(x);
619 913 : }
620 :
621 : template <class T>
622 136 : void apply(T& result, const process::stochastic_operator& x)
623 : {
624 :
625 136 : static_cast<Derived&>(*this).enter(x);
626 408 : process::make_stochastic_operator(result, x.variables(), [&](data::data_expression& result){ static_cast<Derived&>(*this).apply(result, x.distribution()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
627 136 : static_cast<Derived&>(*this).leave(x);
628 136 : }
629 :
630 : template <class T>
631 0 : void apply(T& result, const process::untyped_process_assignment& x)
632 : {
633 :
634 0 : static_cast<Derived&>(*this).enter(x);
635 0 : process::make_untyped_process_assignment(result, x.name(), [&](data::untyped_identifier_assignment_list& result){ static_cast<Derived&>(*this).apply(result, x.assignments()); });
636 0 : static_cast<Derived&>(*this).leave(x);
637 0 : }
638 :
639 : template <class T>
640 12587 : void apply(T& result, const process::process_expression& x)
641 : {
642 :
643 12587 : static_cast<Derived&>(*this).enter(x);
644 12587 : if (data::is_untyped_data_parameter(x))
645 : {
646 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<data::untyped_data_parameter>(x));
647 : }
648 12587 : else if (process::is_action(x))
649 : {
650 3025 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::action>(x));
651 : }
652 9562 : else if (process::is_process_instance(x))
653 : {
654 2119 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::process_instance>(x));
655 : }
656 7443 : else if (process::is_process_instance_assignment(x))
657 : {
658 599 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::process_instance_assignment>(x));
659 : }
660 6844 : else if (process::is_delta(x))
661 : {
662 503 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::delta>(x));
663 : }
664 6341 : else if (process::is_tau(x))
665 : {
666 156 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::tau>(x));
667 : }
668 6185 : else if (process::is_sum(x))
669 : {
670 622 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::sum>(x));
671 : }
672 5563 : else if (process::is_block(x))
673 : {
674 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::block>(x));
675 : }
676 5563 : else if (process::is_hide(x))
677 : {
678 24 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::hide>(x));
679 : }
680 5539 : else if (process::is_rename(x))
681 : {
682 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::rename>(x));
683 : }
684 5539 : else if (process::is_comm(x))
685 : {
686 121 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::comm>(x));
687 : }
688 5418 : else if (process::is_allow(x))
689 : {
690 69 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::allow>(x));
691 : }
692 5349 : else if (process::is_sync(x))
693 : {
694 325 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::sync>(x));
695 : }
696 5024 : else if (process::is_at(x))
697 : {
698 343 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::at>(x));
699 : }
700 4681 : else if (process::is_seq(x))
701 : {
702 2361 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::seq>(x));
703 : }
704 2320 : else if (process::is_if_then(x))
705 : {
706 798 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::if_then>(x));
707 : }
708 1522 : else if (process::is_if_then_else(x))
709 : {
710 125 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::if_then_else>(x));
711 : }
712 1397 : else if (process::is_bounded_init(x))
713 : {
714 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::bounded_init>(x));
715 : }
716 1397 : else if (process::is_merge(x))
717 : {
718 341 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::merge>(x));
719 : }
720 1056 : else if (process::is_left_merge(x))
721 : {
722 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::left_merge>(x));
723 : }
724 1056 : else if (process::is_choice(x))
725 : {
726 913 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::choice>(x));
727 : }
728 143 : else if (process::is_stochastic_operator(x))
729 : {
730 143 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::stochastic_operator>(x));
731 : }
732 0 : else if (process::is_untyped_process_assignment(x))
733 : {
734 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::untyped_process_assignment>(x));
735 : }
736 12587 : static_cast<Derived&>(*this).leave(x);
737 12587 : }
738 :
739 : };
740 :
741 : /// \\brief Builder class
742 : template <typename Derived>
743 : struct data_expression_builder: public add_data_expressions<data::data_expression_builder, Derived>
744 : {
745 : };
746 : //--- end generated add_data_expressions code ---//
747 :
748 : //--- start generated add_variables code ---//
749 : template <template <class> class Builder, class Derived>
750 : struct add_variables: public Builder<Derived>
751 : {
752 : typedef Builder<Derived> super;
753 : using super::enter;
754 : using super::leave;
755 : using super::update;
756 : using super::apply;
757 :
758 : void update(process::process_specification& x)
759 : {
760 : static_cast<Derived&>(*this).enter(x);
761 : static_cast<Derived&>(*this).update(x.global_variables());
762 : static_cast<Derived&>(*this).update(x.equations());
763 : process_expression result_init;
764 : static_cast<Derived&>(*this).apply(result_init, x.init());
765 : x.init() = result_init;
766 : static_cast<Derived&>(*this).leave(x);
767 : }
768 :
769 : template <class T>
770 : void apply(T& result, const process::process_identifier& x)
771 : {
772 :
773 : static_cast<Derived&>(*this).enter(x);
774 : process::make_process_identifier(result, x.name(), [&](data::variable_list& result){ static_cast<Derived&>(*this).apply(result, x.variables()); });
775 : static_cast<Derived&>(*this).leave(x);
776 : }
777 :
778 : template <class T>
779 : void apply(T& result, const process::process_equation& x)
780 : {
781 :
782 : static_cast<Derived&>(*this).enter(x);
783 : process::make_process_equation(result, [&](process_identifier& result){ static_cast<Derived&>(*this).apply(result, x.identifier()); }, [&](data::variable_list& result){ static_cast<Derived&>(*this).apply(result, x.formal_parameters()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.expression()); });
784 : static_cast<Derived&>(*this).leave(x);
785 : }
786 :
787 : template <class T>
788 : void apply(T& result, const process::untyped_multi_action& x)
789 : {
790 :
791 : static_cast<Derived&>(*this).enter(x);
792 : process::make_untyped_multi_action(result, [&](data::untyped_data_parameter_list& result){ static_cast<Derived&>(*this).apply(result, x.actions()); });
793 : static_cast<Derived&>(*this).leave(x);
794 : }
795 :
796 : template <class T>
797 : void apply(T& result, const process::action& x)
798 : {
799 :
800 : static_cast<Derived&>(*this).enter(x);
801 : process::make_action(result, x.label(), [&](data::data_expression_list& result){ static_cast<Derived&>(*this).apply(result, x.arguments()); });
802 : static_cast<Derived&>(*this).leave(x);
803 : }
804 :
805 : template <class T>
806 : void apply(T& result, const process::process_instance& x)
807 : {
808 :
809 : static_cast<Derived&>(*this).enter(x);
810 : process::make_process_instance(result, [&](process_identifier& result){ static_cast<Derived&>(*this).apply(result, x.identifier()); }, [&](data::data_expression_list& result){ static_cast<Derived&>(*this).apply(result, x.actual_parameters()); });
811 : static_cast<Derived&>(*this).leave(x);
812 : }
813 :
814 : template <class T>
815 : void apply(T& result, const process::process_instance_assignment& x)
816 : {
817 :
818 : static_cast<Derived&>(*this).enter(x);
819 : process::make_process_instance_assignment(result, [&](process_identifier& result){ static_cast<Derived&>(*this).apply(result, x.identifier()); }, [&](data::assignment_list& result){ static_cast<Derived&>(*this).apply(result, x.assignments()); });
820 : static_cast<Derived&>(*this).leave(x);
821 : }
822 :
823 : template <class T>
824 : void apply(T& result, const process::delta& x)
825 : {
826 :
827 : result = x;
828 : static_cast<Derived&>(*this).enter(x);
829 : // skip
830 : static_cast<Derived&>(*this).leave(x);
831 : result = x;
832 : }
833 :
834 : template <class T>
835 : void apply(T& result, const process::tau& x)
836 : {
837 :
838 : result = x;
839 : static_cast<Derived&>(*this).enter(x);
840 : // skip
841 : static_cast<Derived&>(*this).leave(x);
842 : result = x;
843 : }
844 :
845 : template <class T>
846 : void apply(T& result, const process::sum& x)
847 : {
848 :
849 : static_cast<Derived&>(*this).enter(x);
850 : process::make_sum(result, [&](data::variable_list& result){ static_cast<Derived&>(*this).apply(result, x.variables()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
851 : static_cast<Derived&>(*this).leave(x);
852 : }
853 :
854 : template <class T>
855 : void apply(T& result, const process::block& x)
856 : {
857 :
858 : static_cast<Derived&>(*this).enter(x);
859 : process::make_block(result, x.block_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
860 : static_cast<Derived&>(*this).leave(x);
861 : }
862 :
863 : template <class T>
864 : void apply(T& result, const process::hide& x)
865 : {
866 :
867 : static_cast<Derived&>(*this).enter(x);
868 : process::make_hide(result, x.hide_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
869 : static_cast<Derived&>(*this).leave(x);
870 : }
871 :
872 : template <class T>
873 : void apply(T& result, const process::rename& x)
874 : {
875 :
876 : static_cast<Derived&>(*this).enter(x);
877 : process::make_rename(result, x.rename_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
878 : static_cast<Derived&>(*this).leave(x);
879 : }
880 :
881 : template <class T>
882 : void apply(T& result, const process::comm& x)
883 : {
884 :
885 : static_cast<Derived&>(*this).enter(x);
886 : process::make_comm(result, x.comm_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
887 : static_cast<Derived&>(*this).leave(x);
888 : }
889 :
890 : template <class T>
891 : void apply(T& result, const process::allow& x)
892 : {
893 :
894 : static_cast<Derived&>(*this).enter(x);
895 : process::make_allow(result, x.allow_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
896 : static_cast<Derived&>(*this).leave(x);
897 : }
898 :
899 : template <class T>
900 : void apply(T& result, const process::sync& x)
901 : {
902 :
903 : static_cast<Derived&>(*this).enter(x);
904 : process::make_sync(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
905 : static_cast<Derived&>(*this).leave(x);
906 : }
907 :
908 : template <class T>
909 : void apply(T& result, const process::at& x)
910 : {
911 :
912 : static_cast<Derived&>(*this).enter(x);
913 : process::make_at(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); }, [&](data::data_expression& result){ static_cast<Derived&>(*this).apply(result, x.time_stamp()); });
914 : static_cast<Derived&>(*this).leave(x);
915 : }
916 :
917 : template <class T>
918 : void apply(T& result, const process::seq& x)
919 : {
920 :
921 : static_cast<Derived&>(*this).enter(x);
922 : process::make_seq(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
923 : static_cast<Derived&>(*this).leave(x);
924 : }
925 :
926 : template <class T>
927 : void apply(T& result, const process::if_then& x)
928 : {
929 :
930 : static_cast<Derived&>(*this).enter(x);
931 : process::make_if_then(result, [&](data::data_expression& result){ static_cast<Derived&>(*this).apply(result, x.condition()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.then_case()); });
932 : static_cast<Derived&>(*this).leave(x);
933 : }
934 :
935 : template <class T>
936 : void apply(T& result, const process::if_then_else& x)
937 : {
938 :
939 : static_cast<Derived&>(*this).enter(x);
940 : process::make_if_then_else(result, [&](data::data_expression& result){ static_cast<Derived&>(*this).apply(result, x.condition()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.then_case()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.else_case()); });
941 : static_cast<Derived&>(*this).leave(x);
942 : }
943 :
944 : template <class T>
945 : void apply(T& result, const process::bounded_init& x)
946 : {
947 :
948 : static_cast<Derived&>(*this).enter(x);
949 : process::make_bounded_init(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
950 : static_cast<Derived&>(*this).leave(x);
951 : }
952 :
953 : template <class T>
954 : void apply(T& result, const process::merge& x)
955 : {
956 :
957 : static_cast<Derived&>(*this).enter(x);
958 : process::make_merge(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
959 : static_cast<Derived&>(*this).leave(x);
960 : }
961 :
962 : template <class T>
963 : void apply(T& result, const process::left_merge& x)
964 : {
965 :
966 : static_cast<Derived&>(*this).enter(x);
967 : process::make_left_merge(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
968 : static_cast<Derived&>(*this).leave(x);
969 : }
970 :
971 : template <class T>
972 : void apply(T& result, const process::choice& x)
973 : {
974 :
975 : static_cast<Derived&>(*this).enter(x);
976 : process::make_choice(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
977 : static_cast<Derived&>(*this).leave(x);
978 : }
979 :
980 : template <class T>
981 : void apply(T& result, const process::stochastic_operator& x)
982 : {
983 :
984 : static_cast<Derived&>(*this).enter(x);
985 : process::make_stochastic_operator(result, [&](data::variable_list& result){ static_cast<Derived&>(*this).apply(result, x.variables()); }, [&](data::data_expression& result){ static_cast<Derived&>(*this).apply(result, x.distribution()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
986 : static_cast<Derived&>(*this).leave(x);
987 : }
988 :
989 : template <class T>
990 : void apply(T& result, const process::untyped_process_assignment& x)
991 : {
992 :
993 : static_cast<Derived&>(*this).enter(x);
994 : process::make_untyped_process_assignment(result, x.name(), [&](data::untyped_identifier_assignment_list& result){ static_cast<Derived&>(*this).apply(result, x.assignments()); });
995 : static_cast<Derived&>(*this).leave(x);
996 : }
997 :
998 : template <class T>
999 : void apply(T& result, const process::process_expression& x)
1000 : {
1001 :
1002 : static_cast<Derived&>(*this).enter(x);
1003 : if (data::is_untyped_data_parameter(x))
1004 : {
1005 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<data::untyped_data_parameter>(x));
1006 : }
1007 : else if (process::is_action(x))
1008 : {
1009 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::action>(x));
1010 : }
1011 : else if (process::is_process_instance(x))
1012 : {
1013 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::process_instance>(x));
1014 : }
1015 : else if (process::is_process_instance_assignment(x))
1016 : {
1017 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::process_instance_assignment>(x));
1018 : }
1019 : else if (process::is_delta(x))
1020 : {
1021 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::delta>(x));
1022 : }
1023 : else if (process::is_tau(x))
1024 : {
1025 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::tau>(x));
1026 : }
1027 : else if (process::is_sum(x))
1028 : {
1029 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::sum>(x));
1030 : }
1031 : else if (process::is_block(x))
1032 : {
1033 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::block>(x));
1034 : }
1035 : else if (process::is_hide(x))
1036 : {
1037 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::hide>(x));
1038 : }
1039 : else if (process::is_rename(x))
1040 : {
1041 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::rename>(x));
1042 : }
1043 : else if (process::is_comm(x))
1044 : {
1045 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::comm>(x));
1046 : }
1047 : else if (process::is_allow(x))
1048 : {
1049 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::allow>(x));
1050 : }
1051 : else if (process::is_sync(x))
1052 : {
1053 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::sync>(x));
1054 : }
1055 : else if (process::is_at(x))
1056 : {
1057 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::at>(x));
1058 : }
1059 : else if (process::is_seq(x))
1060 : {
1061 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::seq>(x));
1062 : }
1063 : else if (process::is_if_then(x))
1064 : {
1065 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::if_then>(x));
1066 : }
1067 : else if (process::is_if_then_else(x))
1068 : {
1069 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::if_then_else>(x));
1070 : }
1071 : else if (process::is_bounded_init(x))
1072 : {
1073 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::bounded_init>(x));
1074 : }
1075 : else if (process::is_merge(x))
1076 : {
1077 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::merge>(x));
1078 : }
1079 : else if (process::is_left_merge(x))
1080 : {
1081 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::left_merge>(x));
1082 : }
1083 : else if (process::is_choice(x))
1084 : {
1085 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::choice>(x));
1086 : }
1087 : else if (process::is_stochastic_operator(x))
1088 : {
1089 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::stochastic_operator>(x));
1090 : }
1091 : else if (process::is_untyped_process_assignment(x))
1092 : {
1093 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::untyped_process_assignment>(x));
1094 : }
1095 : static_cast<Derived&>(*this).leave(x);
1096 : }
1097 :
1098 : };
1099 :
1100 : /// \\brief Builder class
1101 : template <typename Derived>
1102 : struct variable_builder: public add_variables<data::data_expression_builder, Derived>
1103 : {
1104 : };
1105 : //--- end generated add_variables code ---//
1106 :
1107 : // Adds process expression traversal to a builder
1108 : //--- start generated add_process_expressions code ---//
1109 : template <template <class> class Builder, class Derived>
1110 : struct add_process_expressions: public Builder<Derived>
1111 : {
1112 : typedef Builder<Derived> super;
1113 : using super::enter;
1114 : using super::leave;
1115 : using super::update;
1116 : using super::apply;
1117 :
1118 0 : void update(process::process_specification& x)
1119 : {
1120 0 : static_cast<Derived&>(*this).enter(x);
1121 0 : static_cast<Derived&>(*this).update(x.equations());
1122 0 : process_expression result_init;
1123 0 : static_cast<Derived&>(*this).apply(result_init, x.init());
1124 0 : x.init() = result_init;
1125 0 : static_cast<Derived&>(*this).leave(x);
1126 0 : }
1127 :
1128 : template <class T>
1129 0 : void apply(T& result, const process::process_equation& x)
1130 : {
1131 :
1132 0 : static_cast<Derived&>(*this).enter(x);
1133 0 : process::make_process_equation(result, x.identifier(), x.formal_parameters(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.expression()); });
1134 0 : static_cast<Derived&>(*this).leave(x);
1135 0 : }
1136 :
1137 : template <class T>
1138 0 : void apply(T& result, const process::action& x)
1139 : {
1140 :
1141 0 : result = x;
1142 0 : static_cast<Derived&>(*this).enter(x);
1143 : // skip
1144 0 : static_cast<Derived&>(*this).leave(x);
1145 0 : result = x;
1146 0 : }
1147 :
1148 : template <class T>
1149 0 : void apply(T& result, const process::process_instance& x)
1150 : {
1151 :
1152 0 : result = x;
1153 0 : static_cast<Derived&>(*this).enter(x);
1154 : // skip
1155 0 : static_cast<Derived&>(*this).leave(x);
1156 0 : result = x;
1157 0 : }
1158 :
1159 : template <class T>
1160 0 : void apply(T& result, const process::process_instance_assignment& x)
1161 : {
1162 :
1163 0 : result = x;
1164 0 : static_cast<Derived&>(*this).enter(x);
1165 : // skip
1166 0 : static_cast<Derived&>(*this).leave(x);
1167 0 : result = x;
1168 0 : }
1169 :
1170 : template <class T>
1171 602 : void apply(T& result, const process::delta& x)
1172 : {
1173 :
1174 602 : result = x;
1175 602 : static_cast<Derived&>(*this).enter(x);
1176 : // skip
1177 602 : static_cast<Derived&>(*this).leave(x);
1178 602 : result = x;
1179 602 : }
1180 :
1181 : template <class T>
1182 160 : void apply(T& result, const process::tau& x)
1183 : {
1184 :
1185 160 : result = x;
1186 160 : static_cast<Derived&>(*this).enter(x);
1187 : // skip
1188 160 : static_cast<Derived&>(*this).leave(x);
1189 160 : result = x;
1190 160 : }
1191 :
1192 : template <class T>
1193 0 : void apply(T& result, const process::sum& x)
1194 : {
1195 :
1196 0 : static_cast<Derived&>(*this).enter(x);
1197 0 : process::make_sum(result, x.variables(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
1198 0 : static_cast<Derived&>(*this).leave(x);
1199 0 : }
1200 :
1201 : template <class T>
1202 0 : void apply(T& result, const process::block& x)
1203 : {
1204 :
1205 0 : static_cast<Derived&>(*this).enter(x);
1206 0 : process::make_block(result, x.block_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
1207 0 : static_cast<Derived&>(*this).leave(x);
1208 0 : }
1209 :
1210 : template <class T>
1211 0 : void apply(T& result, const process::hide& x)
1212 : {
1213 :
1214 0 : static_cast<Derived&>(*this).enter(x);
1215 0 : process::make_hide(result, x.hide_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
1216 0 : static_cast<Derived&>(*this).leave(x);
1217 0 : }
1218 :
1219 : template <class T>
1220 0 : void apply(T& result, const process::rename& x)
1221 : {
1222 :
1223 0 : static_cast<Derived&>(*this).enter(x);
1224 0 : process::make_rename(result, x.rename_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
1225 0 : static_cast<Derived&>(*this).leave(x);
1226 0 : }
1227 :
1228 : template <class T>
1229 0 : void apply(T& result, const process::comm& x)
1230 : {
1231 :
1232 0 : static_cast<Derived&>(*this).enter(x);
1233 0 : process::make_comm(result, x.comm_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
1234 0 : static_cast<Derived&>(*this).leave(x);
1235 0 : }
1236 :
1237 : template <class T>
1238 0 : void apply(T& result, const process::allow& x)
1239 : {
1240 :
1241 0 : static_cast<Derived&>(*this).enter(x);
1242 0 : process::make_allow(result, x.allow_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
1243 0 : static_cast<Derived&>(*this).leave(x);
1244 0 : }
1245 :
1246 : template <class T>
1247 325 : void apply(T& result, const process::sync& x)
1248 : {
1249 :
1250 325 : static_cast<Derived&>(*this).enter(x);
1251 975 : process::make_sync(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
1252 325 : static_cast<Derived&>(*this).leave(x);
1253 325 : }
1254 :
1255 : template <class T>
1256 0 : void apply(T& result, const process::at& x)
1257 : {
1258 :
1259 0 : static_cast<Derived&>(*this).enter(x);
1260 0 : process::make_at(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); }, x.time_stamp());
1261 0 : static_cast<Derived&>(*this).leave(x);
1262 0 : }
1263 :
1264 : template <class T>
1265 2203 : void apply(T& result, const process::seq& x)
1266 : {
1267 :
1268 2203 : static_cast<Derived&>(*this).enter(x);
1269 6609 : process::make_seq(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
1270 2202 : static_cast<Derived&>(*this).leave(x);
1271 2202 : }
1272 :
1273 : template <class T>
1274 0 : void apply(T& result, const process::if_then& x)
1275 : {
1276 :
1277 0 : static_cast<Derived&>(*this).enter(x);
1278 0 : process::make_if_then(result, x.condition(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.then_case()); });
1279 0 : static_cast<Derived&>(*this).leave(x);
1280 0 : }
1281 :
1282 : template <class T>
1283 0 : void apply(T& result, const process::if_then_else& x)
1284 : {
1285 :
1286 0 : static_cast<Derived&>(*this).enter(x);
1287 0 : process::make_if_then_else(result, x.condition(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.then_case()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.else_case()); });
1288 0 : static_cast<Derived&>(*this).leave(x);
1289 0 : }
1290 :
1291 : template <class T>
1292 0 : void apply(T& result, const process::bounded_init& x)
1293 : {
1294 :
1295 0 : static_cast<Derived&>(*this).enter(x);
1296 0 : process::make_bounded_init(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
1297 0 : static_cast<Derived&>(*this).leave(x);
1298 0 : }
1299 :
1300 : template <class T>
1301 341 : void apply(T& result, const process::merge& x)
1302 : {
1303 :
1304 341 : static_cast<Derived&>(*this).enter(x);
1305 1023 : process::make_merge(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
1306 341 : static_cast<Derived&>(*this).leave(x);
1307 341 : }
1308 :
1309 : template <class T>
1310 0 : void apply(T& result, const process::left_merge& x)
1311 : {
1312 :
1313 0 : static_cast<Derived&>(*this).enter(x);
1314 0 : process::make_left_merge(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
1315 0 : static_cast<Derived&>(*this).leave(x);
1316 0 : }
1317 :
1318 : template <class T>
1319 806 : void apply(T& result, const process::choice& x)
1320 : {
1321 :
1322 806 : static_cast<Derived&>(*this).enter(x);
1323 2418 : process::make_choice(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
1324 806 : static_cast<Derived&>(*this).leave(x);
1325 806 : }
1326 :
1327 : template <class T>
1328 0 : void apply(T& result, const process::stochastic_operator& x)
1329 : {
1330 :
1331 0 : static_cast<Derived&>(*this).enter(x);
1332 0 : process::make_stochastic_operator(result, x.variables(), x.distribution(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
1333 0 : static_cast<Derived&>(*this).leave(x);
1334 0 : }
1335 :
1336 : template <class T>
1337 0 : void apply(T& result, const process::untyped_process_assignment& x)
1338 : {
1339 :
1340 0 : result = x;
1341 0 : static_cast<Derived&>(*this).enter(x);
1342 : // skip
1343 0 : static_cast<Derived&>(*this).leave(x);
1344 0 : result = x;
1345 0 : }
1346 :
1347 : template <class T>
1348 11968 : void apply(T& result, const process::process_expression& x)
1349 : {
1350 :
1351 11968 : static_cast<Derived&>(*this).enter(x);
1352 11968 : if (data::is_untyped_data_parameter(x))
1353 : {
1354 4977 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<data::untyped_data_parameter>(x));
1355 : }
1356 6991 : else if (process::is_action(x))
1357 : {
1358 7 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::action>(x));
1359 : }
1360 6984 : else if (process::is_process_instance(x))
1361 : {
1362 2 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::process_instance>(x));
1363 : }
1364 6982 : else if (process::is_process_instance_assignment(x))
1365 : {
1366 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::process_instance_assignment>(x));
1367 : }
1368 6982 : else if (process::is_delta(x))
1369 : {
1370 602 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::delta>(x));
1371 : }
1372 6380 : else if (process::is_tau(x))
1373 : {
1374 160 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::tau>(x));
1375 : }
1376 6220 : else if (process::is_sum(x))
1377 : {
1378 613 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::sum>(x));
1379 : }
1380 5607 : else if (process::is_block(x))
1381 : {
1382 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::block>(x));
1383 : }
1384 5607 : else if (process::is_hide(x))
1385 : {
1386 24 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::hide>(x));
1387 : }
1388 5583 : else if (process::is_rename(x))
1389 : {
1390 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::rename>(x));
1391 : }
1392 5583 : else if (process::is_comm(x))
1393 : {
1394 121 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::comm>(x));
1395 : }
1396 5462 : else if (process::is_allow(x))
1397 : {
1398 70 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::allow>(x));
1399 : }
1400 5392 : else if (process::is_sync(x))
1401 : {
1402 325 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::sync>(x));
1403 : }
1404 5067 : else if (process::is_at(x))
1405 : {
1406 342 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::at>(x));
1407 : }
1408 4725 : else if (process::is_seq(x))
1409 : {
1410 2203 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::seq>(x));
1411 : }
1412 2522 : else if (process::is_if_then(x))
1413 : {
1414 672 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::if_then>(x));
1415 : }
1416 1850 : else if (process::is_if_then_else(x))
1417 : {
1418 125 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::if_then_else>(x));
1419 : }
1420 1725 : else if (process::is_bounded_init(x))
1421 : {
1422 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::bounded_init>(x));
1423 : }
1424 1725 : else if (process::is_merge(x))
1425 : {
1426 341 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::merge>(x));
1427 : }
1428 1384 : else if (process::is_left_merge(x))
1429 : {
1430 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::left_merge>(x));
1431 : }
1432 1384 : else if (process::is_choice(x))
1433 : {
1434 807 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::choice>(x));
1435 : }
1436 577 : else if (process::is_stochastic_operator(x))
1437 : {
1438 136 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::stochastic_operator>(x));
1439 : }
1440 441 : else if (process::is_untyped_process_assignment(x))
1441 : {
1442 441 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::untyped_process_assignment>(x));
1443 : }
1444 11963 : static_cast<Derived&>(*this).leave(x);
1445 11963 : }
1446 :
1447 : };
1448 :
1449 : /// \\brief Builder class
1450 : template <typename Derived>
1451 : struct process_expression_builder: public add_process_expressions<core::builder, Derived>
1452 : {
1453 : };
1454 : //--- end generated add_process_expressions code ---//
1455 :
1456 : //--- start generated add_process_identifiers code ---//
1457 : template <template <class> class Builder, class Derived>
1458 : struct add_process_identifiers: public Builder<Derived>
1459 : {
1460 : typedef Builder<Derived> super;
1461 : using super::enter;
1462 : using super::leave;
1463 : using super::update;
1464 : using super::apply;
1465 :
1466 : void update(process::process_specification& x)
1467 : {
1468 : static_cast<Derived&>(*this).enter(x);
1469 : static_cast<Derived&>(*this).update(x.equations());
1470 : process_expression result_init;
1471 : static_cast<Derived&>(*this).apply(result_init, x.init());
1472 : x.init() = result_init;
1473 : static_cast<Derived&>(*this).leave(x);
1474 : }
1475 :
1476 : template <class T>
1477 : void apply(T& result, const process::process_identifier& x)
1478 : {
1479 :
1480 : result = x;
1481 : static_cast<Derived&>(*this).enter(x);
1482 : // skip
1483 : static_cast<Derived&>(*this).leave(x);
1484 : result = x;
1485 : }
1486 :
1487 : template <class T>
1488 : void apply(T& result, const process::process_equation& x)
1489 : {
1490 :
1491 : static_cast<Derived&>(*this).enter(x);
1492 : process::make_process_equation(result, [&](process_identifier& result){ static_cast<Derived&>(*this).apply(result, x.identifier()); }, x.formal_parameters(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.expression()); });
1493 : static_cast<Derived&>(*this).leave(x);
1494 : }
1495 :
1496 : template <class T>
1497 5 : void apply(T& result, const process::action& x)
1498 : {
1499 :
1500 5 : result = x;
1501 5 : static_cast<Derived&>(*this).enter(x);
1502 : // skip
1503 5 : static_cast<Derived&>(*this).leave(x);
1504 5 : result = x;
1505 5 : }
1506 :
1507 : template <class T>
1508 8 : void apply(T& result, const process::process_instance& x)
1509 : {
1510 :
1511 8 : static_cast<Derived&>(*this).enter(x);
1512 16 : process::make_process_instance(result, [&](process_identifier& result){ static_cast<Derived&>(*this).apply(result, x.identifier()); }, x.actual_parameters());
1513 8 : static_cast<Derived&>(*this).leave(x);
1514 8 : }
1515 :
1516 : template <class T>
1517 1 : void apply(T& result, const process::process_instance_assignment& x)
1518 : {
1519 :
1520 1 : static_cast<Derived&>(*this).enter(x);
1521 2 : process::make_process_instance_assignment(result, [&](process_identifier& result){ static_cast<Derived&>(*this).apply(result, x.identifier()); }, x.assignments());
1522 1 : static_cast<Derived&>(*this).leave(x);
1523 1 : }
1524 :
1525 : template <class T>
1526 0 : void apply(T& result, const process::delta& x)
1527 : {
1528 :
1529 0 : result = x;
1530 0 : static_cast<Derived&>(*this).enter(x);
1531 : // skip
1532 0 : static_cast<Derived&>(*this).leave(x);
1533 0 : result = x;
1534 0 : }
1535 :
1536 : template <class T>
1537 0 : void apply(T& result, const process::tau& x)
1538 : {
1539 :
1540 0 : result = x;
1541 0 : static_cast<Derived&>(*this).enter(x);
1542 : // skip
1543 0 : static_cast<Derived&>(*this).leave(x);
1544 0 : result = x;
1545 0 : }
1546 :
1547 : template <class T>
1548 2 : void apply(T& result, const process::sum& x)
1549 : {
1550 :
1551 2 : static_cast<Derived&>(*this).enter(x);
1552 4 : process::make_sum(result, x.variables(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
1553 2 : static_cast<Derived&>(*this).leave(x);
1554 2 : }
1555 :
1556 : template <class T>
1557 0 : void apply(T& result, const process::block& x)
1558 : {
1559 :
1560 0 : static_cast<Derived&>(*this).enter(x);
1561 0 : process::make_block(result, x.block_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
1562 0 : static_cast<Derived&>(*this).leave(x);
1563 0 : }
1564 :
1565 : template <class T>
1566 0 : void apply(T& result, const process::hide& x)
1567 : {
1568 :
1569 0 : static_cast<Derived&>(*this).enter(x);
1570 0 : process::make_hide(result, x.hide_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
1571 0 : static_cast<Derived&>(*this).leave(x);
1572 0 : }
1573 :
1574 : template <class T>
1575 0 : void apply(T& result, const process::rename& x)
1576 : {
1577 :
1578 0 : static_cast<Derived&>(*this).enter(x);
1579 0 : process::make_rename(result, x.rename_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
1580 0 : static_cast<Derived&>(*this).leave(x);
1581 0 : }
1582 :
1583 : template <class T>
1584 0 : void apply(T& result, const process::comm& x)
1585 : {
1586 :
1587 0 : static_cast<Derived&>(*this).enter(x);
1588 0 : process::make_comm(result, x.comm_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
1589 0 : static_cast<Derived&>(*this).leave(x);
1590 0 : }
1591 :
1592 : template <class T>
1593 1 : void apply(T& result, const process::allow& x)
1594 : {
1595 :
1596 1 : static_cast<Derived&>(*this).enter(x);
1597 2 : process::make_allow(result, x.allow_set(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
1598 1 : static_cast<Derived&>(*this).leave(x);
1599 1 : }
1600 :
1601 : template <class T>
1602 0 : void apply(T& result, const process::sync& x)
1603 : {
1604 :
1605 0 : static_cast<Derived&>(*this).enter(x);
1606 0 : process::make_sync(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
1607 0 : static_cast<Derived&>(*this).leave(x);
1608 0 : }
1609 :
1610 : template <class T>
1611 0 : void apply(T& result, const process::at& x)
1612 : {
1613 :
1614 0 : static_cast<Derived&>(*this).enter(x);
1615 0 : process::make_at(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); }, x.time_stamp());
1616 0 : static_cast<Derived&>(*this).leave(x);
1617 0 : }
1618 :
1619 : template <class T>
1620 6 : void apply(T& result, const process::seq& x)
1621 : {
1622 :
1623 6 : static_cast<Derived&>(*this).enter(x);
1624 18 : process::make_seq(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
1625 6 : static_cast<Derived&>(*this).leave(x);
1626 6 : }
1627 :
1628 : template <class T>
1629 0 : void apply(T& result, const process::if_then& x)
1630 : {
1631 :
1632 0 : static_cast<Derived&>(*this).enter(x);
1633 0 : process::make_if_then(result, x.condition(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.then_case()); });
1634 0 : static_cast<Derived&>(*this).leave(x);
1635 0 : }
1636 :
1637 : template <class T>
1638 0 : void apply(T& result, const process::if_then_else& x)
1639 : {
1640 :
1641 0 : static_cast<Derived&>(*this).enter(x);
1642 0 : process::make_if_then_else(result, x.condition(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.then_case()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.else_case()); });
1643 0 : static_cast<Derived&>(*this).leave(x);
1644 0 : }
1645 :
1646 : template <class T>
1647 0 : void apply(T& result, const process::bounded_init& x)
1648 : {
1649 :
1650 0 : static_cast<Derived&>(*this).enter(x);
1651 0 : process::make_bounded_init(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
1652 0 : static_cast<Derived&>(*this).leave(x);
1653 0 : }
1654 :
1655 : template <class T>
1656 0 : void apply(T& result, const process::merge& x)
1657 : {
1658 :
1659 0 : static_cast<Derived&>(*this).enter(x);
1660 0 : process::make_merge(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
1661 0 : static_cast<Derived&>(*this).leave(x);
1662 0 : }
1663 :
1664 : template <class T>
1665 0 : void apply(T& result, const process::left_merge& x)
1666 : {
1667 :
1668 0 : static_cast<Derived&>(*this).enter(x);
1669 0 : process::make_left_merge(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
1670 0 : static_cast<Derived&>(*this).leave(x);
1671 0 : }
1672 :
1673 : template <class T>
1674 0 : void apply(T& result, const process::choice& x)
1675 : {
1676 :
1677 0 : static_cast<Derived&>(*this).enter(x);
1678 0 : process::make_choice(result, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.left()); }, [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.right()); });
1679 0 : static_cast<Derived&>(*this).leave(x);
1680 0 : }
1681 :
1682 : template <class T>
1683 0 : void apply(T& result, const process::stochastic_operator& x)
1684 : {
1685 :
1686 0 : static_cast<Derived&>(*this).enter(x);
1687 0 : process::make_stochastic_operator(result, x.variables(), x.distribution(), [&](process_expression& result){ static_cast<Derived&>(*this).apply(result, x.operand()); });
1688 0 : static_cast<Derived&>(*this).leave(x);
1689 0 : }
1690 :
1691 : template <class T>
1692 0 : void apply(T& result, const process::untyped_process_assignment& x)
1693 : {
1694 :
1695 0 : result = x;
1696 0 : static_cast<Derived&>(*this).enter(x);
1697 : // skip
1698 0 : static_cast<Derived&>(*this).leave(x);
1699 0 : result = x;
1700 0 : }
1701 :
1702 : template <class T>
1703 23 : void apply(T& result, const process::process_expression& x)
1704 : {
1705 :
1706 23 : static_cast<Derived&>(*this).enter(x);
1707 23 : if (data::is_untyped_data_parameter(x))
1708 : {
1709 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<data::untyped_data_parameter>(x));
1710 : }
1711 23 : else if (process::is_action(x))
1712 : {
1713 5 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::action>(x));
1714 : }
1715 18 : else if (process::is_process_instance(x))
1716 : {
1717 8 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::process_instance>(x));
1718 : }
1719 10 : else if (process::is_process_instance_assignment(x))
1720 : {
1721 1 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::process_instance_assignment>(x));
1722 : }
1723 9 : else if (process::is_delta(x))
1724 : {
1725 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::delta>(x));
1726 : }
1727 9 : else if (process::is_tau(x))
1728 : {
1729 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::tau>(x));
1730 : }
1731 9 : else if (process::is_sum(x))
1732 : {
1733 2 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::sum>(x));
1734 : }
1735 7 : else if (process::is_block(x))
1736 : {
1737 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::block>(x));
1738 : }
1739 7 : else if (process::is_hide(x))
1740 : {
1741 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::hide>(x));
1742 : }
1743 7 : else if (process::is_rename(x))
1744 : {
1745 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::rename>(x));
1746 : }
1747 7 : else if (process::is_comm(x))
1748 : {
1749 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::comm>(x));
1750 : }
1751 7 : else if (process::is_allow(x))
1752 : {
1753 1 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::allow>(x));
1754 : }
1755 6 : else if (process::is_sync(x))
1756 : {
1757 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::sync>(x));
1758 : }
1759 6 : else if (process::is_at(x))
1760 : {
1761 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::at>(x));
1762 : }
1763 6 : else if (process::is_seq(x))
1764 : {
1765 6 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::seq>(x));
1766 : }
1767 0 : else if (process::is_if_then(x))
1768 : {
1769 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::if_then>(x));
1770 : }
1771 0 : else if (process::is_if_then_else(x))
1772 : {
1773 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::if_then_else>(x));
1774 : }
1775 0 : else if (process::is_bounded_init(x))
1776 : {
1777 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::bounded_init>(x));
1778 : }
1779 0 : else if (process::is_merge(x))
1780 : {
1781 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::merge>(x));
1782 : }
1783 0 : else if (process::is_left_merge(x))
1784 : {
1785 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::left_merge>(x));
1786 : }
1787 0 : else if (process::is_choice(x))
1788 : {
1789 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::choice>(x));
1790 : }
1791 0 : else if (process::is_stochastic_operator(x))
1792 : {
1793 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::stochastic_operator>(x));
1794 : }
1795 0 : else if (process::is_untyped_process_assignment(x))
1796 : {
1797 0 : static_cast<Derived&>(*this).apply(result, atermpp::down_cast<process::untyped_process_assignment>(x));
1798 : }
1799 23 : static_cast<Derived&>(*this).leave(x);
1800 23 : }
1801 :
1802 : };
1803 :
1804 : /// \\brief Builder class
1805 : template <typename Derived>
1806 : struct process_identifier_builder: public add_process_identifiers<core::builder, Derived>
1807 : {
1808 : };
1809 : //--- end generated add_process_identifiers code ---//
1810 :
1811 : } // namespace process
1812 :
1813 : } // namespace mcrl2
1814 :
1815 : #endif // MCRL2_PROCESS_BUILDER_H
|