mCRL2
Loading...
Searching...
No Matches
traverser.h
Go to the documentation of this file.
1// Author(s): Jeroen van der Wulp, 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_TRAVERSER_H
13#define MCRL2_DATA_TRAVERSER_H
14
16#include "mcrl2/data/alias.h"
18#include "mcrl2/data/exists.h"
19#include "mcrl2/data/forall.h"
20#include "mcrl2/data/lambda.h"
29
30namespace mcrl2
31{
32
33namespace data
34{
35
36// Adds sort expression traversal to a traverser
37//--- start generated add_traverser_sort_expressions code ---//
38template <template <class> class Traverser, class Derived>
39struct add_traverser_sort_expressions: public Traverser<Derived>
40{
41 typedef Traverser<Derived> super;
42 using super::enter;
43 using super::leave;
44 using super::apply;
45
46 void apply(const data::variable& x)
47 {
48 static_cast<Derived&>(*this).enter(x);
49 static_cast<Derived&>(*this).apply(x.sort());
50 static_cast<Derived&>(*this).leave(x);
51 }
52
54 {
55 static_cast<Derived&>(*this).enter(x);
56 static_cast<Derived&>(*this).apply(x.sort());
57 static_cast<Derived&>(*this).leave(x);
58 }
59
60 void apply(const data::application& x)
61 {
62 static_cast<Derived&>(*this).enter(x);
63 static_cast<Derived&>(*this).apply(x.head());
64 for (const data_expression& t: x) { static_cast<Derived&>(*this).apply(t); }
65 static_cast<Derived&>(*this).leave(x);
66 }
67
69 {
70 static_cast<Derived&>(*this).enter(x);
71 static_cast<Derived&>(*this).apply(x.body());
72 static_cast<Derived&>(*this).apply(x.declarations());
73 static_cast<Derived&>(*this).leave(x);
74 }
75
77 {
78 static_cast<Derived&>(*this).enter(x);
79 // skip
80 static_cast<Derived&>(*this).leave(x);
81 }
82
84 {
85 static_cast<Derived&>(*this).enter(x);
86 // skip
87 static_cast<Derived&>(*this).leave(x);
88 }
89
90 void apply(const data::assignment& x)
91 {
92 static_cast<Derived&>(*this).enter(x);
93 static_cast<Derived&>(*this).apply(x.lhs());
94 static_cast<Derived&>(*this).apply(x.rhs());
95 static_cast<Derived&>(*this).leave(x);
96 }
97
99 {
100 static_cast<Derived&>(*this).enter(x);
101 static_cast<Derived&>(*this).apply(x.rhs());
102 static_cast<Derived&>(*this).leave(x);
103 }
104
105 void apply(const data::basic_sort& x)
106 {
107 static_cast<Derived&>(*this).enter(x);
108 // skip
109 static_cast<Derived&>(*this).leave(x);
110 }
111
113 {
114 static_cast<Derived&>(*this).enter(x);
115 static_cast<Derived&>(*this).apply(x.element_sort());
116 static_cast<Derived&>(*this).leave(x);
117 }
118
120 {
121 static_cast<Derived&>(*this).enter(x);
122 static_cast<Derived&>(*this).apply(x.constructors());
123 static_cast<Derived&>(*this).leave(x);
124 }
125
127 {
128 static_cast<Derived&>(*this).enter(x);
129 static_cast<Derived&>(*this).apply(x.domain());
130 static_cast<Derived&>(*this).apply(x.codomain());
131 static_cast<Derived&>(*this).leave(x);
132 }
133
135 {
136 static_cast<Derived&>(*this).enter(x);
137 // skip
138 static_cast<Derived&>(*this).leave(x);
139 }
140
142 {
143 static_cast<Derived&>(*this).enter(x);
144 static_cast<Derived&>(*this).apply(x.sorts());
145 static_cast<Derived&>(*this).leave(x);
146 }
147
149 {
150 static_cast<Derived&>(*this).enter(x);
151 // skip
152 static_cast<Derived&>(*this).leave(x);
153 }
154
155 void apply(const data::forall& x)
156 {
157 static_cast<Derived&>(*this).enter(x);
158 static_cast<Derived&>(*this).apply(x.variables());
159 static_cast<Derived&>(*this).apply(x.body());
160 static_cast<Derived&>(*this).leave(x);
161 }
162
163 void apply(const data::exists& x)
164 {
165 static_cast<Derived&>(*this).enter(x);
166 static_cast<Derived&>(*this).apply(x.variables());
167 static_cast<Derived&>(*this).apply(x.body());
168 static_cast<Derived&>(*this).leave(x);
169 }
170
171 void apply(const data::lambda& x)
172 {
173 static_cast<Derived&>(*this).enter(x);
174 static_cast<Derived&>(*this).apply(x.variables());
175 static_cast<Derived&>(*this).apply(x.body());
176 static_cast<Derived&>(*this).leave(x);
177 }
178
180 {
181 static_cast<Derived&>(*this).enter(x);
182 static_cast<Derived&>(*this).apply(x.variables());
183 static_cast<Derived&>(*this).apply(x.body());
184 static_cast<Derived&>(*this).leave(x);
185 }
186
188 {
189 static_cast<Derived&>(*this).enter(x);
190 static_cast<Derived&>(*this).apply(x.variables());
191 static_cast<Derived&>(*this).apply(x.body());
192 static_cast<Derived&>(*this).leave(x);
193 }
194
196 {
197 static_cast<Derived&>(*this).enter(x);
198 static_cast<Derived&>(*this).apply(x.variables());
199 static_cast<Derived&>(*this).apply(x.body());
200 static_cast<Derived&>(*this).leave(x);
201 }
202
204 {
205 static_cast<Derived&>(*this).enter(x);
206 static_cast<Derived&>(*this).apply(x.sort());
207 static_cast<Derived&>(*this).leave(x);
208 }
209
211 {
212 static_cast<Derived&>(*this).enter(x);
213 static_cast<Derived&>(*this).apply(x.arguments());
214 static_cast<Derived&>(*this).leave(x);
215 }
216
217 void apply(const data::alias& x)
218 {
219 static_cast<Derived&>(*this).enter(x);
220 static_cast<Derived&>(*this).apply(x.reference());
221 static_cast<Derived&>(*this).leave(x);
222 }
223
225 {
226 static_cast<Derived&>(*this).enter(x);
227 static_cast<Derived&>(*this).apply(x.variables());
228 static_cast<Derived&>(*this).apply(x.condition());
229 static_cast<Derived&>(*this).apply(x.lhs());
230 static_cast<Derived&>(*this).apply(x.rhs());
231 static_cast<Derived&>(*this).leave(x);
232 }
233
235 {
236 static_cast<Derived&>(*this).enter(x);
237 static_cast<Derived&>(*this).apply(x.arguments());
238 static_cast<Derived&>(*this).leave(x);
239 }
240
242 {
243 static_cast<Derived&>(*this).enter(x);
245 {
246 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::abstraction>(x));
247 }
248 else if (data::is_variable(x))
249 {
250 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::variable>(x));
251 }
252 else if (data::is_function_symbol(x))
253 {
254 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::function_symbol>(x));
255 }
256 else if (data::is_application(x))
257 {
258 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::application>(x));
259 }
260 else if (data::is_where_clause(x))
261 {
262 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::where_clause>(x));
263 }
264 else if (data::is_machine_number(x))
265 {
266 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::machine_number>(x));
267 }
268 else if (data::is_untyped_identifier(x))
269 {
270 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::untyped_identifier>(x));
271 }
272 static_cast<Derived&>(*this).leave(x);
273 }
274
276 {
277 static_cast<Derived&>(*this).enter(x);
278 if (data::is_assignment(x))
279 {
280 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::assignment>(x));
281 }
283 {
284 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::untyped_identifier_assignment>(x));
285 }
286 static_cast<Derived&>(*this).leave(x);
287 }
288
290 {
291 static_cast<Derived&>(*this).enter(x);
292 if (data::is_basic_sort(x))
293 {
294 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::basic_sort>(x));
295 }
296 else if (data::is_container_sort(x))
297 {
298 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::container_sort>(x));
299 }
300 else if (data::is_structured_sort(x))
301 {
302 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::structured_sort>(x));
303 }
304 else if (data::is_function_sort(x))
305 {
306 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::function_sort>(x));
307 }
308 else if (data::is_untyped_sort(x))
309 {
310 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::untyped_sort>(x));
311 }
313 {
314 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::untyped_possible_sorts>(x));
315 }
317 {
318 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::untyped_sort_variable>(x));
319 }
320 static_cast<Derived&>(*this).leave(x);
321 }
322
324 {
325 static_cast<Derived&>(*this).enter(x);
326 if (data::is_forall(x))
327 {
328 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::forall>(x));
329 }
330 else if (data::is_exists(x))
331 {
332 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::exists>(x));
333 }
334 else if (data::is_lambda(x))
335 {
336 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::lambda>(x));
337 }
338 else if (data::is_set_comprehension(x))
339 {
340 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::set_comprehension>(x));
341 }
342 else if (data::is_bag_comprehension(x))
343 {
344 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::bag_comprehension>(x));
345 }
347 {
348 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::untyped_set_or_bag_comprehension>(x));
349 }
350 static_cast<Derived&>(*this).leave(x);
351 }
352
353};
354
356template <typename Derived>
357struct sort_expression_traverser: public add_traverser_sort_expressions<core::traverser, Derived>
358{
359};
360//--- end generated add_traverser_sort_expressions code ---//
361
362//--- start generated add_traverser_data_expressions code ---//
363template <template <class> class Traverser, class Derived>
364struct add_traverser_data_expressions: public Traverser<Derived>
365{
366 typedef Traverser<Derived> super;
367 using super::enter;
368 using super::leave;
369 using super::apply;
370
371 void apply(const data::variable& x)
372 {
373 static_cast<Derived&>(*this).enter(x);
374 // skip
375 static_cast<Derived&>(*this).leave(x);
376 }
377
379 {
380 static_cast<Derived&>(*this).enter(x);
381 // skip
382 static_cast<Derived&>(*this).leave(x);
383 }
384
386 {
387 static_cast<Derived&>(*this).enter(x);
388 static_cast<Derived&>(*this).apply(x.head());
389 for (const data_expression& t: x) { static_cast<Derived&>(*this).apply(t); }
390 static_cast<Derived&>(*this).leave(x);
391 }
392
394 {
395 static_cast<Derived&>(*this).enter(x);
396 static_cast<Derived&>(*this).apply(x.body());
397 static_cast<Derived&>(*this).apply(x.declarations());
398 static_cast<Derived&>(*this).leave(x);
399 }
400
402 {
403 static_cast<Derived&>(*this).enter(x);
404 // skip
405 static_cast<Derived&>(*this).leave(x);
406 }
407
409 {
410 static_cast<Derived&>(*this).enter(x);
411 // skip
412 static_cast<Derived&>(*this).leave(x);
413 }
414
415 void apply(const data::assignment& x)
416 {
417 static_cast<Derived&>(*this).enter(x);
418 static_cast<Derived&>(*this).apply(x.rhs());
419 static_cast<Derived&>(*this).leave(x);
420 }
421
423 {
424 static_cast<Derived&>(*this).enter(x);
425 static_cast<Derived&>(*this).apply(x.rhs());
426 static_cast<Derived&>(*this).leave(x);
427 }
428
429 void apply(const data::forall& x)
430 {
431 static_cast<Derived&>(*this).enter(x);
432 static_cast<Derived&>(*this).apply(x.body());
433 static_cast<Derived&>(*this).leave(x);
434 }
435
436 void apply(const data::exists& x)
437 {
438 static_cast<Derived&>(*this).enter(x);
439 static_cast<Derived&>(*this).apply(x.body());
440 static_cast<Derived&>(*this).leave(x);
441 }
442
443 void apply(const data::lambda& x)
444 {
445 static_cast<Derived&>(*this).enter(x);
446 static_cast<Derived&>(*this).apply(x.body());
447 static_cast<Derived&>(*this).leave(x);
448 }
449
451 {
452 static_cast<Derived&>(*this).enter(x);
453 static_cast<Derived&>(*this).apply(x.body());
454 static_cast<Derived&>(*this).leave(x);
455 }
456
458 {
459 static_cast<Derived&>(*this).enter(x);
460 static_cast<Derived&>(*this).apply(x.body());
461 static_cast<Derived&>(*this).leave(x);
462 }
463
465 {
466 static_cast<Derived&>(*this).enter(x);
467 static_cast<Derived&>(*this).apply(x.body());
468 static_cast<Derived&>(*this).leave(x);
469 }
470
472 {
473 static_cast<Derived&>(*this).enter(x);
474 static_cast<Derived&>(*this).apply(x.condition());
475 static_cast<Derived&>(*this).apply(x.lhs());
476 static_cast<Derived&>(*this).apply(x.rhs());
477 static_cast<Derived&>(*this).leave(x);
478 }
479
481 {
482 static_cast<Derived&>(*this).enter(x);
483 static_cast<Derived&>(*this).apply(x.arguments());
484 static_cast<Derived&>(*this).leave(x);
485 }
486
488 {
489 static_cast<Derived&>(*this).enter(x);
491 {
492 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::abstraction>(x));
493 }
494 else if (data::is_variable(x))
495 {
496 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::variable>(x));
497 }
498 else if (data::is_function_symbol(x))
499 {
500 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::function_symbol>(x));
501 }
502 else if (data::is_application(x))
503 {
504 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::application>(x));
505 }
506 else if (data::is_where_clause(x))
507 {
508 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::where_clause>(x));
509 }
510 else if (data::is_machine_number(x))
511 {
512 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::machine_number>(x));
513 }
514 else if (data::is_untyped_identifier(x))
515 {
516 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::untyped_identifier>(x));
517 }
518 static_cast<Derived&>(*this).leave(x);
519 }
520
522 {
523 static_cast<Derived&>(*this).enter(x);
524 if (data::is_assignment(x))
525 {
526 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::assignment>(x));
527 }
529 {
530 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::untyped_identifier_assignment>(x));
531 }
532 static_cast<Derived&>(*this).leave(x);
533 }
534
536 {
537 static_cast<Derived&>(*this).enter(x);
538 if (data::is_forall(x))
539 {
540 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::forall>(x));
541 }
542 else if (data::is_exists(x))
543 {
544 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::exists>(x));
545 }
546 else if (data::is_lambda(x))
547 {
548 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::lambda>(x));
549 }
550 else if (data::is_set_comprehension(x))
551 {
552 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::set_comprehension>(x));
553 }
554 else if (data::is_bag_comprehension(x))
555 {
556 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::bag_comprehension>(x));
557 }
559 {
560 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::untyped_set_or_bag_comprehension>(x));
561 }
562 static_cast<Derived&>(*this).leave(x);
563 }
564
565};
566
568template <typename Derived>
569struct data_expression_traverser: public add_traverser_data_expressions<core::traverser, Derived>
570{
571};
572//--- end generated add_traverser_data_expressions code ---//
573
574//--- start generated add_traverser_variables code ---//
575template <template <class> class Traverser, class Derived>
576struct add_traverser_variables: public Traverser<Derived>
577{
578 typedef Traverser<Derived> super;
579 using super::enter;
580 using super::leave;
581 using super::apply;
582
583 void apply(const data::variable& x)
584 {
585 static_cast<Derived&>(*this).enter(x);
586 // skip
587 static_cast<Derived&>(*this).leave(x);
588 }
589
591 {
592 static_cast<Derived&>(*this).enter(x);
593 // skip
594 static_cast<Derived&>(*this).leave(x);
595 }
596
598 {
599 static_cast<Derived&>(*this).enter(x);
600 static_cast<Derived&>(*this).apply(x.head());
601 for (const data_expression& t: x) { static_cast<Derived&>(*this).apply(t); }
602 static_cast<Derived&>(*this).leave(x);
603 }
604
606 {
607 static_cast<Derived&>(*this).enter(x);
608 static_cast<Derived&>(*this).apply(x.body());
609 static_cast<Derived&>(*this).apply(x.declarations());
610 static_cast<Derived&>(*this).leave(x);
611 }
612
614 {
615 static_cast<Derived&>(*this).enter(x);
616 // skip
617 static_cast<Derived&>(*this).leave(x);
618 }
619
621 {
622 static_cast<Derived&>(*this).enter(x);
623 // skip
624 static_cast<Derived&>(*this).leave(x);
625 }
626
627 void apply(const data::assignment& x)
628 {
629 static_cast<Derived&>(*this).enter(x);
630 static_cast<Derived&>(*this).apply(x.lhs());
631 static_cast<Derived&>(*this).apply(x.rhs());
632 static_cast<Derived&>(*this).leave(x);
633 }
634
636 {
637 static_cast<Derived&>(*this).enter(x);
638 static_cast<Derived&>(*this).apply(x.rhs());
639 static_cast<Derived&>(*this).leave(x);
640 }
641
642 void apply(const data::forall& x)
643 {
644 static_cast<Derived&>(*this).enter(x);
645 static_cast<Derived&>(*this).apply(x.variables());
646 static_cast<Derived&>(*this).apply(x.body());
647 static_cast<Derived&>(*this).leave(x);
648 }
649
650 void apply(const data::exists& x)
651 {
652 static_cast<Derived&>(*this).enter(x);
653 static_cast<Derived&>(*this).apply(x.variables());
654 static_cast<Derived&>(*this).apply(x.body());
655 static_cast<Derived&>(*this).leave(x);
656 }
657
658 void apply(const data::lambda& x)
659 {
660 static_cast<Derived&>(*this).enter(x);
661 static_cast<Derived&>(*this).apply(x.variables());
662 static_cast<Derived&>(*this).apply(x.body());
663 static_cast<Derived&>(*this).leave(x);
664 }
665
667 {
668 static_cast<Derived&>(*this).enter(x);
669 static_cast<Derived&>(*this).apply(x.variables());
670 static_cast<Derived&>(*this).apply(x.body());
671 static_cast<Derived&>(*this).leave(x);
672 }
673
675 {
676 static_cast<Derived&>(*this).enter(x);
677 static_cast<Derived&>(*this).apply(x.variables());
678 static_cast<Derived&>(*this).apply(x.body());
679 static_cast<Derived&>(*this).leave(x);
680 }
681
683 {
684 static_cast<Derived&>(*this).enter(x);
685 static_cast<Derived&>(*this).apply(x.variables());
686 static_cast<Derived&>(*this).apply(x.body());
687 static_cast<Derived&>(*this).leave(x);
688 }
689
691 {
692 static_cast<Derived&>(*this).enter(x);
693 static_cast<Derived&>(*this).apply(x.variables());
694 static_cast<Derived&>(*this).apply(x.condition());
695 static_cast<Derived&>(*this).apply(x.lhs());
696 static_cast<Derived&>(*this).apply(x.rhs());
697 static_cast<Derived&>(*this).leave(x);
698 }
699
701 {
702 static_cast<Derived&>(*this).enter(x);
703 static_cast<Derived&>(*this).apply(x.arguments());
704 static_cast<Derived&>(*this).leave(x);
705 }
706
708 {
709 static_cast<Derived&>(*this).enter(x);
711 {
712 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::abstraction>(x));
713 }
714 else if (data::is_variable(x))
715 {
716 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::variable>(x));
717 }
718 else if (data::is_function_symbol(x))
719 {
720 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::function_symbol>(x));
721 }
722 else if (data::is_application(x))
723 {
724 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::application>(x));
725 }
726 else if (data::is_where_clause(x))
727 {
728 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::where_clause>(x));
729 }
730 else if (data::is_machine_number(x))
731 {
732 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::machine_number>(x));
733 }
734 else if (data::is_untyped_identifier(x))
735 {
736 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::untyped_identifier>(x));
737 }
738 static_cast<Derived&>(*this).leave(x);
739 }
740
742 {
743 static_cast<Derived&>(*this).enter(x);
744 if (data::is_assignment(x))
745 {
746 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::assignment>(x));
747 }
749 {
750 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::untyped_identifier_assignment>(x));
751 }
752 static_cast<Derived&>(*this).leave(x);
753 }
754
756 {
757 static_cast<Derived&>(*this).enter(x);
758 if (data::is_forall(x))
759 {
760 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::forall>(x));
761 }
762 else if (data::is_exists(x))
763 {
764 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::exists>(x));
765 }
766 else if (data::is_lambda(x))
767 {
768 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::lambda>(x));
769 }
770 else if (data::is_set_comprehension(x))
771 {
772 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::set_comprehension>(x));
773 }
774 else if (data::is_bag_comprehension(x))
775 {
776 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::bag_comprehension>(x));
777 }
779 {
780 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::untyped_set_or_bag_comprehension>(x));
781 }
782 static_cast<Derived&>(*this).leave(x);
783 }
784
785};
786
788template <typename Derived>
789struct variable_traverser: public add_traverser_variables<core::traverser, Derived>
790{
791};
792//--- end generated add_traverser_variables code ---//
793
794//--- start generated add_traverser_identifier_strings code ---//
795template <template <class> class Traverser, class Derived>
796struct add_traverser_identifier_strings: public Traverser<Derived>
797{
798 typedef Traverser<Derived> super;
799 using super::enter;
800 using super::leave;
801 using super::apply;
802
803 void apply(const data::variable& x)
804 {
805 static_cast<Derived&>(*this).enter(x);
806 static_cast<Derived&>(*this).apply(x.name());
807 static_cast<Derived&>(*this).apply(x.sort());
808 static_cast<Derived&>(*this).leave(x);
809 }
810
812 {
813 static_cast<Derived&>(*this).enter(x);
814 static_cast<Derived&>(*this).apply(x.name());
815 static_cast<Derived&>(*this).apply(x.sort());
816 static_cast<Derived&>(*this).leave(x);
817 }
818
820 {
821 static_cast<Derived&>(*this).enter(x);
822 static_cast<Derived&>(*this).apply(x.head());
823 for (const data_expression& t: x) { static_cast<Derived&>(*this).apply(t); }
824 static_cast<Derived&>(*this).leave(x);
825 }
826
828 {
829 static_cast<Derived&>(*this).enter(x);
830 static_cast<Derived&>(*this).apply(x.body());
831 static_cast<Derived&>(*this).apply(x.declarations());
832 static_cast<Derived&>(*this).leave(x);
833 }
834
836 {
837 static_cast<Derived&>(*this).enter(x);
838 // skip
839 static_cast<Derived&>(*this).leave(x);
840 }
841
843 {
844 static_cast<Derived&>(*this).enter(x);
845 static_cast<Derived&>(*this).apply(x.name());
846 static_cast<Derived&>(*this).leave(x);
847 }
848
849 void apply(const data::assignment& x)
850 {
851 static_cast<Derived&>(*this).enter(x);
852 static_cast<Derived&>(*this).apply(x.lhs());
853 static_cast<Derived&>(*this).apply(x.rhs());
854 static_cast<Derived&>(*this).leave(x);
855 }
856
858 {
859 static_cast<Derived&>(*this).enter(x);
860 static_cast<Derived&>(*this).apply(x.lhs());
861 static_cast<Derived&>(*this).apply(x.rhs());
862 static_cast<Derived&>(*this).leave(x);
863 }
864
865 void apply(const data::basic_sort& x)
866 {
867 static_cast<Derived&>(*this).enter(x);
868 static_cast<Derived&>(*this).apply(x.name());
869 static_cast<Derived&>(*this).leave(x);
870 }
871
873 {
874 static_cast<Derived&>(*this).enter(x);
875 static_cast<Derived&>(*this).apply(x.element_sort());
876 static_cast<Derived&>(*this).leave(x);
877 }
878
880 {
881 static_cast<Derived&>(*this).enter(x);
882 static_cast<Derived&>(*this).apply(x.constructors());
883 static_cast<Derived&>(*this).leave(x);
884 }
885
887 {
888 static_cast<Derived&>(*this).enter(x);
889 static_cast<Derived&>(*this).apply(x.domain());
890 static_cast<Derived&>(*this).apply(x.codomain());
891 static_cast<Derived&>(*this).leave(x);
892 }
893
895 {
896 static_cast<Derived&>(*this).enter(x);
897 // skip
898 static_cast<Derived&>(*this).leave(x);
899 }
900
902 {
903 static_cast<Derived&>(*this).enter(x);
904 static_cast<Derived&>(*this).apply(x.sorts());
905 static_cast<Derived&>(*this).leave(x);
906 }
907
909 {
910 static_cast<Derived&>(*this).enter(x);
911 // skip
912 static_cast<Derived&>(*this).leave(x);
913 }
914
915 void apply(const data::forall& x)
916 {
917 static_cast<Derived&>(*this).enter(x);
918 static_cast<Derived&>(*this).apply(x.variables());
919 static_cast<Derived&>(*this).apply(x.body());
920 static_cast<Derived&>(*this).leave(x);
921 }
922
923 void apply(const data::exists& x)
924 {
925 static_cast<Derived&>(*this).enter(x);
926 static_cast<Derived&>(*this).apply(x.variables());
927 static_cast<Derived&>(*this).apply(x.body());
928 static_cast<Derived&>(*this).leave(x);
929 }
930
931 void apply(const data::lambda& x)
932 {
933 static_cast<Derived&>(*this).enter(x);
934 static_cast<Derived&>(*this).apply(x.variables());
935 static_cast<Derived&>(*this).apply(x.body());
936 static_cast<Derived&>(*this).leave(x);
937 }
938
940 {
941 static_cast<Derived&>(*this).enter(x);
942 static_cast<Derived&>(*this).apply(x.variables());
943 static_cast<Derived&>(*this).apply(x.body());
944 static_cast<Derived&>(*this).leave(x);
945 }
946
948 {
949 static_cast<Derived&>(*this).enter(x);
950 static_cast<Derived&>(*this).apply(x.variables());
951 static_cast<Derived&>(*this).apply(x.body());
952 static_cast<Derived&>(*this).leave(x);
953 }
954
956 {
957 static_cast<Derived&>(*this).enter(x);
958 static_cast<Derived&>(*this).apply(x.variables());
959 static_cast<Derived&>(*this).apply(x.body());
960 static_cast<Derived&>(*this).leave(x);
961 }
962
964 {
965 static_cast<Derived&>(*this).enter(x);
966 static_cast<Derived&>(*this).apply(x.name());
967 static_cast<Derived&>(*this).apply(x.sort());
968 static_cast<Derived&>(*this).leave(x);
969 }
970
972 {
973 static_cast<Derived&>(*this).enter(x);
974 static_cast<Derived&>(*this).apply(x.name());
975 static_cast<Derived&>(*this).apply(x.arguments());
976 static_cast<Derived&>(*this).apply(x.recogniser());
977 static_cast<Derived&>(*this).leave(x);
978 }
979
980 void apply(const data::alias& x)
981 {
982 static_cast<Derived&>(*this).enter(x);
983 static_cast<Derived&>(*this).apply(x.name());
984 static_cast<Derived&>(*this).apply(x.reference());
985 static_cast<Derived&>(*this).leave(x);
986 }
987
989 {
990 static_cast<Derived&>(*this).enter(x);
991 static_cast<Derived&>(*this).apply(x.variables());
992 static_cast<Derived&>(*this).apply(x.condition());
993 static_cast<Derived&>(*this).apply(x.lhs());
994 static_cast<Derived&>(*this).apply(x.rhs());
995 static_cast<Derived&>(*this).leave(x);
996 }
997
999 {
1000 static_cast<Derived&>(*this).enter(x);
1001 static_cast<Derived&>(*this).apply(x.name());
1002 static_cast<Derived&>(*this).apply(x.arguments());
1003 static_cast<Derived&>(*this).leave(x);
1004 }
1005
1007 {
1008 static_cast<Derived&>(*this).enter(x);
1009 if (data::is_abstraction(x))
1010 {
1011 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::abstraction>(x));
1012 }
1013 else if (data::is_variable(x))
1014 {
1015 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::variable>(x));
1016 }
1017 else if (data::is_function_symbol(x))
1018 {
1019 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::function_symbol>(x));
1020 }
1021 else if (data::is_application(x))
1022 {
1023 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::application>(x));
1024 }
1025 else if (data::is_where_clause(x))
1026 {
1027 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::where_clause>(x));
1028 }
1029 else if (data::is_machine_number(x))
1030 {
1031 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::machine_number>(x));
1032 }
1033 else if (data::is_untyped_identifier(x))
1034 {
1035 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::untyped_identifier>(x));
1036 }
1037 static_cast<Derived&>(*this).leave(x);
1038 }
1039
1041 {
1042 static_cast<Derived&>(*this).enter(x);
1043 if (data::is_assignment(x))
1044 {
1045 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::assignment>(x));
1046 }
1048 {
1049 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::untyped_identifier_assignment>(x));
1050 }
1051 static_cast<Derived&>(*this).leave(x);
1052 }
1053
1055 {
1056 static_cast<Derived&>(*this).enter(x);
1057 if (data::is_basic_sort(x))
1058 {
1059 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::basic_sort>(x));
1060 }
1061 else if (data::is_container_sort(x))
1062 {
1063 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::container_sort>(x));
1064 }
1065 else if (data::is_structured_sort(x))
1066 {
1067 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::structured_sort>(x));
1068 }
1069 else if (data::is_function_sort(x))
1070 {
1071 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::function_sort>(x));
1072 }
1073 else if (data::is_untyped_sort(x))
1074 {
1075 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::untyped_sort>(x));
1076 }
1078 {
1079 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::untyped_possible_sorts>(x));
1080 }
1082 {
1083 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::untyped_sort_variable>(x));
1084 }
1085 static_cast<Derived&>(*this).leave(x);
1086 }
1087
1089 {
1090 static_cast<Derived&>(*this).enter(x);
1091 if (data::is_forall(x))
1092 {
1093 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::forall>(x));
1094 }
1095 else if (data::is_exists(x))
1096 {
1097 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::exists>(x));
1098 }
1099 else if (data::is_lambda(x))
1100 {
1101 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::lambda>(x));
1102 }
1103 else if (data::is_set_comprehension(x))
1104 {
1105 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::set_comprehension>(x));
1106 }
1107 else if (data::is_bag_comprehension(x))
1108 {
1109 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::bag_comprehension>(x));
1110 }
1112 {
1113 static_cast<Derived&>(*this).apply(atermpp::down_cast<data::untyped_set_or_bag_comprehension>(x));
1114 }
1115 static_cast<Derived&>(*this).leave(x);
1116 }
1117
1118};
1119
1121template <typename Derived>
1123{
1124};
1125//--- end generated add_traverser_identifier_strings code ---//
1126
1127} // namespace data
1128
1129} // namespace mcrl2
1130
1131#endif // MCRL2_DATA_TRAVERSER_H
The class alias.
add your file description here.
An abstraction expression.
Definition abstraction.h:26
const variable_list & variables() const
Definition abstraction.h:63
const data_expression & body() const
Definition abstraction.h:68
\brief A sort alias
Definition alias.h:26
const basic_sort & name() const
Definition alias.h:52
const sort_expression & reference() const
Definition alias.h:57
An application of a data expression to a number of arguments.
const data_expression & head() const
Get the function at the head of this expression.
\brief Assignment expression
Definition assignment.h:27
\brief Assignment of a data expression to a variable
Definition assignment.h:91
const data_expression & rhs() const
Definition assignment.h:122
const variable & lhs() const
Definition assignment.h:117
universal quantification.
\brief A basic sort
Definition basic_sort.h:26
const core::identifier_string & name() const
Definition basic_sort.h:57
\brief A container sort
const sort_expression & element_sort() const
\brief A data equation
const data_expression & lhs() const
const data_expression & condition() const
const data_expression & rhs() const
const variable_list & variables() const
existential quantification.
Definition exists.h:26
universal quantification.
Definition forall.h:26
\brief A function sort
const sort_expression & codomain() const
const sort_expression_list & domain() const
\brief A function symbol
const core::identifier_string & name() const
const sort_expression & sort() const
function symbol.
Definition lambda.h:27
\brief A machine number
universal quantification.
\brief A sort expression
\brief An argument of a constructor of a structured sort
\brief A constructor for a structured sort
const core::identifier_string & name() const
const core::identifier_string & recogniser() const
const structured_sort_constructor_argument_list & arguments() const
const structured_sort_constructor_list & constructors() const
const core::identifier_string & name() const
const data_expression_list & arguments() const
\brief Assignment of a data expression to a string
Definition assignment.h:182
const core::identifier_string & lhs() const
Definition assignment.h:213
const data_expression & rhs() const
Definition assignment.h:218
\brief An untyped identifier
const core::identifier_string & name() const
const sort_expression_list & sorts() const
\brief Unknown sort expression
\brief A data variable
Definition variable.h:28
const core::identifier_string & name() const
Definition variable.h:38
const sort_expression & sort() const
Definition variable.h:43
\brief A where expression
const data_expression & body() const
const assignment_expression_list & declarations() const
add your file description here.
The class exists.
The class forall.
The class lambda.
The class machine_number, which is a subclass of data_expression.
bool is_structured_sort(const atermpp::aterm &x)
Returns true if the term t is a structured sort.
bool is_where_clause(const atermpp::aterm &x)
Returns true if the term t is a where clause.
bool is_untyped_possible_sorts(const atermpp::aterm &x)
Returns true if the term t is an expression for multiple possible sorts.
bool is_untyped_sort(const atermpp::aterm &x)
Returns true if the term t is the unknown sort.
bool is_abstraction(const atermpp::aterm &x)
Returns true if the term t is an abstraction.
bool is_untyped_identifier(const atermpp::aterm &x)
Returns true if the term t is an identifier.
bool is_container_sort(const atermpp::aterm &x)
Returns true if the term t is a container sort.
bool is_forall(const atermpp::aterm &x)
Returns true if the term t is a universal quantification.
bool is_function_symbol(const atermpp::aterm &x)
Returns true if the term t is a function symbol.
bool is_basic_sort(const atermpp::aterm &x)
Returns true if the term t is a basic sort.
bool is_untyped_sort_variable(const atermpp::aterm &x)
bool is_untyped_set_or_bag_comprehension(const atermpp::aterm &x)
Returns true if the term t is a set/bag comprehension.
bool is_assignment(const atermpp::aterm &x)
Definition assignment.h:155
bool is_exists(const atermpp::aterm &x)
Returns true if the term t is an existential quantification.
bool is_function_sort(const atermpp::aterm &x)
Returns true if the term t is a function sort.
bool is_bag_comprehension(const atermpp::aterm &x)
Returns true if the term t is a bag comprehension.
bool is_set_comprehension(const atermpp::aterm &x)
Returns true if the term t is a set comprehension.
bool is_machine_number(const atermpp::aterm &x)
Returns true if the term t is a machine_number.
bool is_lambda(const atermpp::aterm &x)
Returns true if the term t is a lambda abstraction.
bool is_untyped_identifier_assignment(const atermpp::aterm &x)
Definition assignment.h:251
bool is_application(const atermpp::aterm &x)
Returns true if the term t is an application.
bool is_variable(const atermpp::aterm &x)
Returns true if the term t is a variable.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
add your file description here.
void apply(const data::function_symbol &x)
Definition traverser.h:378
void apply(const data::set_comprehension &x)
Definition traverser.h:450
void apply(const data::untyped_identifier &x)
Definition traverser.h:408
void apply(const data::untyped_set_or_bag_comprehension &x)
Definition traverser.h:464
void apply(const data::application &x)
Definition traverser.h:385
void apply(const data::forall &x)
Definition traverser.h:429
void apply(const data::data_equation &x)
Definition traverser.h:471
void apply(const data::exists &x)
Definition traverser.h:436
void apply(const data::lambda &x)
Definition traverser.h:443
void apply(const data::machine_number &x)
Definition traverser.h:401
void apply(const data::untyped_identifier_assignment &x)
Definition traverser.h:422
void apply(const data::data_expression &x)
Definition traverser.h:487
void apply(const data::where_clause &x)
Definition traverser.h:393
void apply(const data::bag_comprehension &x)
Definition traverser.h:457
void apply(const data::abstraction &x)
Definition traverser.h:535
void apply(const data::assignment_expression &x)
Definition traverser.h:521
void apply(const data::variable &x)
Definition traverser.h:371
void apply(const data::assignment &x)
Definition traverser.h:415
void apply(const data::untyped_data_parameter &x)
Definition traverser.h:480
void apply(const data::untyped_possible_sorts &x)
Definition traverser.h:901
void apply(const data::structured_sort_constructor_argument &x)
Definition traverser.h:963
void apply(const data::application &x)
Definition traverser.h:819
void apply(const data::untyped_sort_variable &x)
Definition traverser.h:908
void apply(const data::basic_sort &x)
Definition traverser.h:865
void apply(const data::bag_comprehension &x)
Definition traverser.h:947
void apply(const data::assignment_expression &x)
Definition traverser.h:1040
void apply(const data::untyped_sort &x)
Definition traverser.h:894
void apply(const data::assignment &x)
Definition traverser.h:849
void apply(const data::untyped_set_or_bag_comprehension &x)
Definition traverser.h:955
void apply(const data::untyped_data_parameter &x)
Definition traverser.h:998
void apply(const data::structured_sort &x)
Definition traverser.h:879
void apply(const data::function_sort &x)
Definition traverser.h:886
void apply(const data::data_equation &x)
Definition traverser.h:988
void apply(const data::container_sort &x)
Definition traverser.h:872
void apply(const data::machine_number &x)
Definition traverser.h:835
void apply(const data::abstraction &x)
Definition traverser.h:1088
void apply(const data::structured_sort_constructor &x)
Definition traverser.h:971
void apply(const data::variable &x)
Definition traverser.h:803
void apply(const data::function_symbol &x)
Definition traverser.h:811
void apply(const data::untyped_identifier &x)
Definition traverser.h:842
void apply(const data::data_expression &x)
Definition traverser.h:1006
void apply(const data::set_comprehension &x)
Definition traverser.h:939
void apply(const data::untyped_identifier_assignment &x)
Definition traverser.h:857
void apply(const data::sort_expression &x)
Definition traverser.h:1054
void apply(const data::where_clause &x)
Definition traverser.h:827
void apply(const data::untyped_identifier_assignment &x)
Definition traverser.h:98
void apply(const data::assignment &x)
Definition traverser.h:90
void apply(const data::sort_expression &x)
Definition traverser.h:289
void apply(const data::where_clause &x)
Definition traverser.h:68
void apply(const data::data_expression &x)
Definition traverser.h:241
void apply(const data::lambda &x)
Definition traverser.h:171
void apply(const data::basic_sort &x)
Definition traverser.h:105
void apply(const data::variable &x)
Definition traverser.h:46
void apply(const data::untyped_possible_sorts &x)
Definition traverser.h:141
void apply(const data::untyped_identifier &x)
Definition traverser.h:83
void apply(const data::untyped_sort_variable &x)
Definition traverser.h:148
void apply(const data::untyped_set_or_bag_comprehension &x)
Definition traverser.h:195
void apply(const data::forall &x)
Definition traverser.h:155
void apply(const data::application &x)
Definition traverser.h:60
void apply(const data::structured_sort_constructor_argument &x)
Definition traverser.h:203
void apply(const data::structured_sort_constructor &x)
Definition traverser.h:210
void apply(const data::untyped_sort &x)
Definition traverser.h:134
void apply(const data::machine_number &x)
Definition traverser.h:76
void apply(const data::function_sort &x)
Definition traverser.h:126
void apply(const data::container_sort &x)
Definition traverser.h:112
void apply(const data::set_comprehension &x)
Definition traverser.h:179
void apply(const data::data_equation &x)
Definition traverser.h:224
void apply(const data::structured_sort &x)
Definition traverser.h:119
void apply(const data::assignment_expression &x)
Definition traverser.h:275
void apply(const data::bag_comprehension &x)
Definition traverser.h:187
void apply(const data::exists &x)
Definition traverser.h:163
void apply(const data::abstraction &x)
Definition traverser.h:323
void apply(const data::untyped_data_parameter &x)
Definition traverser.h:234
void apply(const data::function_symbol &x)
Definition traverser.h:53
void apply(const data::untyped_set_or_bag_comprehension &x)
Definition traverser.h:682
void apply(const data::untyped_identifier_assignment &x)
Definition traverser.h:635
void apply(const data::untyped_data_parameter &x)
Definition traverser.h:700
void apply(const data::data_expression &x)
Definition traverser.h:707
void apply(const data::bag_comprehension &x)
Definition traverser.h:674
void apply(const data::data_equation &x)
Definition traverser.h:690
void apply(const data::where_clause &x)
Definition traverser.h:605
void apply(const data::set_comprehension &x)
Definition traverser.h:666
void apply(const data::exists &x)
Definition traverser.h:650
void apply(const data::untyped_identifier &x)
Definition traverser.h:620
void apply(const data::variable &x)
Definition traverser.h:583
void apply(const data::abstraction &x)
Definition traverser.h:755
void apply(const data::forall &x)
Definition traverser.h:642
void apply(const data::assignment_expression &x)
Definition traverser.h:741
void apply(const data::assignment &x)
Definition traverser.h:627
void apply(const data::application &x)
Definition traverser.h:597
void apply(const data::function_symbol &x)
Definition traverser.h:590
void apply(const data::lambda &x)
Definition traverser.h:658
void apply(const data::machine_number &x)
Definition traverser.h:613
\brief Traverser class
Definition traverser.h:790
The class structured_sort.
add your file description here.
add your file description here.
add your file description here.
add your file description here.
The class where_clause.