mCRL2
Loading...
Searching...
No Matches
fbag64.h
Go to the documentation of this file.
1// Author(s): Jeroen Keiren
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/data/fbag.h
10/// \brief The standard sort fbag.
11///
12/// This file was generated from the data sort specification
13/// mcrl2/data/build/fbag.spec.
14
15#ifndef MCRL2_DATA_FBAG64_H
16#define MCRL2_DATA_FBAG64_H
17
18#include "functional" // std::function
19#include "mcrl2/utilities/exception.h"
20#include "mcrl2/data/basic_sort.h"
21#include "mcrl2/data/function_sort.h"
22#include "mcrl2/data/function_symbol.h"
23#include "mcrl2/data/application.h"
24#include "mcrl2/data/data_equation.h"
25#include "mcrl2/data/standard.h"
26#include "mcrl2/data/container_sort.h"
27#include "mcrl2/data/bool.h"
28#include "mcrl2/data/pos64.h"
29#include "mcrl2/data/nat64.h"
30#include "mcrl2/data/fset64.h"
31
32/// \brief Namespace for system defined sort fbag.
33namespace mcrl2::data::sort_fbag
34{
35
36 /// \brief Constructor for sort expression FBag(S)
37 /// \param s A sort expression
38 /// \return Sort expression fbag(s)
39 inline
41 {
43 return fbag;
44 }
45
46 /// \brief Recogniser for sort expression FBag(s)
47 /// \param e A sort expression
48 /// \return true iff e is a container sort of which the name matches
49 /// fbag
50 inline
51 bool is_fbag(const sort_expression& e)
52 {
54 {
56 }
57 return false;
58 }
59
60
61 /// \brief Generate identifier {:}.
62 /// \return Identifier {:}.
63 inline
64 const core::identifier_string& empty_name()
65 {
66 static core::identifier_string empty_name = core::identifier_string("{:}");
67 return empty_name;
68 }
69
70 /// \brief Constructor for function symbol {:}.
71 /// \param s A sort expression.
72 /// \return Function symbol empty.
73 inline
75 {
77 return empty;
78 }
79
80 /// \brief Recogniser for function {:}.
81 /// \param e A data expression.
82 /// \return true iff e is the function symbol matching {:}.
83 inline
85 {
87 {
88 return atermpp::down_cast<function_symbol>(e).name() == empty_name();
89 }
90 return false;
91 }
92
93 /// \brief Generate identifier \@fbag_insert.
94 /// \return Identifier \@fbag_insert.
95 inline
96 const core::identifier_string& insert_name()
97 {
98 static core::identifier_string insert_name = core::identifier_string("@fbag_insert");
99 return insert_name;
100 }
101
102 /// \brief Constructor for function symbol \@fbag_insert.
103 /// \param s A sort expression.
104 /// \return Function symbol insert.
105 inline
107 {
109 return insert;
110 }
111
112 /// \brief Recogniser for function \@fbag_insert.
113 /// \param e A data expression.
114 /// \return true iff e is the function symbol matching \@fbag_insert.
115 inline
117 {
119 {
120 return atermpp::down_cast<function_symbol>(e).name() == insert_name();
121 }
122 return false;
123 }
124
125 /// \brief Application of function symbol \@fbag_insert.
126 /// \param[in] s A sort expression.
127 /// \param[in] arg0 A data expression.
128 /// \param[in] arg1 A data expression.
129 /// \param[in] arg2 A data expression.
130 /// \return Application of \@fbag_insert to a number of arguments.
131 inline
132 application insert(const sort_expression& s, const data_expression& arg0, const data_expression& arg1, const data_expression& arg2)
133 {
134 return sort_fbag::insert(s)(arg0, arg1, arg2);
135 }
136
137 /// \brief Make an application of function symbol \@fbag_insert.
138 /// \param[out] result The data expression where the \@fbag_insert expression is put.
139 /// \param[in] s A sort expression.
140 /// \param[in] arg0 A data expression.
141 /// \param[in] arg1 A data expression.
142 /// \param[in] arg2 A data expression.
143 inline
144 void make_insert(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1, const data_expression& arg2)
145 {
146 make_application(result, sort_fbag::insert(s),arg0, arg1, arg2);
147 }
148
149 /// \brief Recogniser for application of \@fbag_insert.
150 /// \param e A data expression.
151 /// \return true iff e is an application of function symbol insert to a
152 /// number of arguments.
153 inline
154 bool is_insert_application(const atermpp::aterm& e)
155 {
156 return is_application(e) && is_insert_function_symbol(atermpp::down_cast<application>(e).head());
157 }
158 /// \brief Give all system defined constructors for fbag.
159 /// \param s A sort expression.
160 /// \return All system defined constructors for fbag.
161 inline
163 {
164 function_symbol_vector result;
165 result.push_back(sort_fbag::empty(s));
166 result.push_back(sort_fbag::insert(s));
167
168 return result;
169 }
170 /// \brief Give all defined constructors which can be used in mCRL2 specs for fbag.
171 /// \param s A sort expression.
172 /// \return All system defined constructors that can be used in an mCRL2 specification for fbag.
173 inline
175 {
176 function_symbol_vector result;
177 result.push_back(sort_fbag::empty(s));
178 result.push_back(sort_fbag::insert(s));
179
180 return result;
181 }
182 // The typedef is the sort that maps a function symbol to an function that rewrites it as well as a string of a function that can be used to implement it
184 /// \brief Give all system defined constructors which have an implementation in C++ and not in rewrite rules for fbag.
185 /// \param s A sort expression.
186 /// \return All system defined constructors that are to be implemented in C++ for fbag.
187 inline
189 {
190 implementation_map result;
191 return result;
192 }
193
194 /// \brief Generate identifier \@fbag_cons.
195 /// \return Identifier \@fbag_cons.
196 inline
197 const core::identifier_string& cons_name()
198 {
199 static core::identifier_string cons_name = core::identifier_string("@fbag_cons");
200 return cons_name;
201 }
202
203 /// \brief Constructor for function symbol \@fbag_cons.
204 /// \param s A sort expression.
205 /// \return Function symbol cons_.
206 inline
208 {
210 return cons_;
211 }
212
213 /// \brief Recogniser for function \@fbag_cons.
214 /// \param e A data expression.
215 /// \return true iff e is the function symbol matching \@fbag_cons.
216 inline
218 {
220 {
221 return atermpp::down_cast<function_symbol>(e).name() == cons_name();
222 }
223 return false;
224 }
225
226 /// \brief Application of function symbol \@fbag_cons.
227 /// \param[in] s A sort expression.
228 /// \param[in] arg0 A data expression.
229 /// \param[in] arg1 A data expression.
230 /// \param[in] arg2 A data expression.
231 /// \return Application of \@fbag_cons to a number of arguments.
232 inline
233 application cons_(const sort_expression& s, const data_expression& arg0, const data_expression& arg1, const data_expression& arg2)
234 {
235 return sort_fbag::cons_(s)(arg0, arg1, arg2);
236 }
237
238 /// \brief Make an application of function symbol \@fbag_cons.
239 /// \param[out] result The data expression where the \@fbag_cons expression is put.
240 /// \param[in] s A sort expression.
241 /// \param[in] arg0 A data expression.
242 /// \param[in] arg1 A data expression.
243 /// \param[in] arg2 A data expression.
244 inline
245 void make_cons(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1, const data_expression& arg2)
246 {
247 make_application(result, sort_fbag::cons_(s),arg0, arg1, arg2);
248 }
249
250 /// \brief Recogniser for application of \@fbag_cons.
251 /// \param e A data expression.
252 /// \return true iff e is an application of function symbol cons_ to a
253 /// number of arguments.
254 inline
255 bool is_cons_application(const atermpp::aterm& e)
256 {
257 return is_application(e) && is_cons_function_symbol(atermpp::down_cast<application>(e).head());
258 }
259
260 /// \brief Generate identifier \@fbag_cinsert.
261 /// \return Identifier \@fbag_cinsert.
262 inline
263 const core::identifier_string& cinsert_name()
264 {
265 static core::identifier_string cinsert_name = core::identifier_string("@fbag_cinsert");
266 return cinsert_name;
267 }
268
269 /// \brief Constructor for function symbol \@fbag_cinsert.
270 /// \param s A sort expression.
271 /// \return Function symbol cinsert.
272 inline
274 {
276 return cinsert;
277 }
278
279 /// \brief Recogniser for function \@fbag_cinsert.
280 /// \param e A data expression.
281 /// \return true iff e is the function symbol matching \@fbag_cinsert.
282 inline
284 {
286 {
287 return atermpp::down_cast<function_symbol>(e).name() == cinsert_name();
288 }
289 return false;
290 }
291
292 /// \brief Application of function symbol \@fbag_cinsert.
293 /// \param[in] s A sort expression.
294 /// \param[in] arg0 A data expression.
295 /// \param[in] arg1 A data expression.
296 /// \param[in] arg2 A data expression.
297 /// \return Application of \@fbag_cinsert to a number of arguments.
298 inline
299 application cinsert(const sort_expression& s, const data_expression& arg0, const data_expression& arg1, const data_expression& arg2)
300 {
301 return sort_fbag::cinsert(s)(arg0, arg1, arg2);
302 }
303
304 /// \brief Make an application of function symbol \@fbag_cinsert.
305 /// \param[out] result The data expression where the \@fbag_cinsert expression is put.
306 /// \param[in] s A sort expression.
307 /// \param[in] arg0 A data expression.
308 /// \param[in] arg1 A data expression.
309 /// \param[in] arg2 A data expression.
310 inline
311 void make_cinsert(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1, const data_expression& arg2)
312 {
313 make_application(result, sort_fbag::cinsert(s),arg0, arg1, arg2);
314 }
315
316 /// \brief Recogniser for application of \@fbag_cinsert.
317 /// \param e A data expression.
318 /// \return true iff e is an application of function symbol cinsert to a
319 /// number of arguments.
320 inline
321 bool is_cinsert_application(const atermpp::aterm& e)
322 {
323 return is_application(e) && is_cinsert_function_symbol(atermpp::down_cast<application>(e).head());
324 }
325
326 /// \brief Generate identifier count.
327 /// \return Identifier count.
328 inline
329 const core::identifier_string& count_name()
330 {
331 static core::identifier_string count_name = core::identifier_string("count");
332 return count_name;
333 }
334
335 /// \brief Constructor for function symbol count.
336 /// \param s A sort expression.
337 /// \return Function symbol count.
338 inline
340 {
342 return count;
343 }
344
345 /// \brief Recogniser for function count.
346 /// \param e A data expression.
347 /// \return true iff e is the function symbol matching count.
348 inline
350 {
352 {
353 return atermpp::down_cast<function_symbol>(e).name() == count_name();
354 }
355 return false;
356 }
357
358 /// \brief Application of function symbol count.
359 /// \param[in] s A sort expression.
360 /// \param[in] arg0 A data expression.
361 /// \param[in] arg1 A data expression.
362 /// \return Application of count to a number of arguments.
363 inline
364 application count(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
365 {
366 return sort_fbag::count(s)(arg0, arg1);
367 }
368
369 /// \brief Make an application of function symbol count.
370 /// \param[out] result The data expression where the count expression is put.
371 /// \param[in] s A sort expression.
372 /// \param[in] arg0 A data expression.
373 /// \param[in] arg1 A data expression.
374 inline
375 void make_count(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
376 {
377 make_application(result, sort_fbag::count(s),arg0, arg1);
378 }
379
380 /// \brief Recogniser for application of count.
381 /// \param e A data expression.
382 /// \return true iff e is an application of function symbol count to a
383 /// number of arguments.
384 inline
385 bool is_count_application(const atermpp::aterm& e)
386 {
387 return is_application(e) && is_count_function_symbol(atermpp::down_cast<application>(e).head());
388 }
389
390 /// \brief Generate identifier in.
391 /// \return Identifier in.
392 inline
393 const core::identifier_string& in_name()
394 {
395 static core::identifier_string in_name = core::identifier_string("in");
396 return in_name;
397 }
398
399 /// \brief Constructor for function symbol in.
400 /// \param s A sort expression.
401 /// \return Function symbol in.
402 inline
404 {
406 return in;
407 }
408
409 /// \brief Recogniser for function in.
410 /// \param e A data expression.
411 /// \return true iff e is the function symbol matching in.
412 inline
413 bool is_in_function_symbol(const atermpp::aterm& e)
414 {
416 {
417 return atermpp::down_cast<function_symbol>(e).name() == in_name();
418 }
419 return false;
420 }
421
422 /// \brief Application of function symbol in.
423 /// \param[in] s A sort expression.
424 /// \param[in] arg0 A data expression.
425 /// \param[in] arg1 A data expression.
426 /// \return Application of in to a number of arguments.
427 inline
428 application in(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
429 {
430 return sort_fbag::in(s)(arg0, arg1);
431 }
432
433 /// \brief Make an application of function symbol in.
434 /// \param[out] result The data expression where the in expression is put.
435 /// \param[in] s A sort expression.
436 /// \param[in] arg0 A data expression.
437 /// \param[in] arg1 A data expression.
438 inline
439 void make_in(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
440 {
441 make_application(result, sort_fbag::in(s),arg0, arg1);
442 }
443
444 /// \brief Recogniser for application of in.
445 /// \param e A data expression.
446 /// \return true iff e is an application of function symbol in to a
447 /// number of arguments.
448 inline
449 bool is_in_application(const atermpp::aterm& e)
450 {
451 return is_application(e) && is_in_function_symbol(atermpp::down_cast<application>(e).head());
452 }
453
454 /// \brief Generate identifier +.
455 /// \return Identifier +.
456 inline
457 const core::identifier_string& union_name()
458 {
459 static core::identifier_string union_name = core::identifier_string("+");
460 return union_name;
461 }
462
463 /// \brief Constructor for function symbol +.
464 /// \param s A sort expression.
465 /// \return Function symbol union_.
466 inline
468 {
470 return union_;
471 }
472
473 /// \brief Recogniser for function +.
474 /// \param e A data expression.
475 /// \return true iff e is the function symbol matching +.
476 inline
478 {
480 {
481 return atermpp::down_cast<function_symbol>(e).name() == union_name();
482 }
483 return false;
484 }
485
486 /// \brief Application of function symbol +.
487 /// \param[in] s A sort expression.
488 /// \param[in] arg0 A data expression.
489 /// \param[in] arg1 A data expression.
490 /// \return Application of + to a number of arguments.
491 inline
492 application union_(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
493 {
494 return sort_fbag::union_(s)(arg0, arg1);
495 }
496
497 /// \brief Make an application of function symbol +.
498 /// \param[out] result The data expression where the + expression is put.
499 /// \param[in] s A sort expression.
500 /// \param[in] arg0 A data expression.
501 /// \param[in] arg1 A data expression.
502 inline
503 void make_union(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
504 {
505 make_application(result, sort_fbag::union_(s),arg0, arg1);
506 }
507
508 /// \brief Recogniser for application of +.
509 /// \param e A data expression.
510 /// \return true iff e is an application of function symbol union_ to a
511 /// number of arguments.
512 inline
513 bool is_union_application(const atermpp::aterm& e)
514 {
515 return is_application(e) && is_union_function_symbol(atermpp::down_cast<application>(e).head());
516 }
517
518 /// \brief Generate identifier *.
519 /// \return Identifier *.
520 inline
521 const core::identifier_string& intersection_name()
522 {
523 static core::identifier_string intersection_name = core::identifier_string("*");
524 return intersection_name;
525 }
526
527 /// \brief Constructor for function symbol *.
528 /// \param s A sort expression.
529 /// \return Function symbol intersection.
530 inline
532 {
534 return intersection;
535 }
536
537 /// \brief Recogniser for function *.
538 /// \param e A data expression.
539 /// \return true iff e is the function symbol matching *.
540 inline
542 {
544 {
545 return atermpp::down_cast<function_symbol>(e).name() == intersection_name();
546 }
547 return false;
548 }
549
550 /// \brief Application of function symbol *.
551 /// \param[in] s A sort expression.
552 /// \param[in] arg0 A data expression.
553 /// \param[in] arg1 A data expression.
554 /// \return Application of * to a number of arguments.
555 inline
556 application intersection(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
557 {
558 return sort_fbag::intersection(s)(arg0, arg1);
559 }
560
561 /// \brief Make an application of function symbol *.
562 /// \param[out] result The data expression where the * expression is put.
563 /// \param[in] s A sort expression.
564 /// \param[in] arg0 A data expression.
565 /// \param[in] arg1 A data expression.
566 inline
567 void make_intersection(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
568 {
569 make_application(result, sort_fbag::intersection(s),arg0, arg1);
570 }
571
572 /// \brief Recogniser for application of *.
573 /// \param e A data expression.
574 /// \return true iff e is an application of function symbol intersection to a
575 /// number of arguments.
576 inline
578 {
579 return is_application(e) && is_intersection_function_symbol(atermpp::down_cast<application>(e).head());
580 }
581
582 /// \brief Generate identifier -.
583 /// \return Identifier -.
584 inline
585 const core::identifier_string& difference_name()
586 {
587 static core::identifier_string difference_name = core::identifier_string("-");
588 return difference_name;
589 }
590
591 /// \brief Constructor for function symbol -.
592 /// \param s A sort expression.
593 /// \return Function symbol difference.
594 inline
596 {
598 return difference;
599 }
600
601 /// \brief Recogniser for function -.
602 /// \param e A data expression.
603 /// \return true iff e is the function symbol matching -.
604 inline
606 {
608 {
609 return atermpp::down_cast<function_symbol>(e).name() == difference_name();
610 }
611 return false;
612 }
613
614 /// \brief Application of function symbol -.
615 /// \param[in] s A sort expression.
616 /// \param[in] arg0 A data expression.
617 /// \param[in] arg1 A data expression.
618 /// \return Application of - to a number of arguments.
619 inline
620 application difference(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
621 {
622 return sort_fbag::difference(s)(arg0, arg1);
623 }
624
625 /// \brief Make an application of function symbol -.
626 /// \param[out] result The data expression where the - expression is put.
627 /// \param[in] s A sort expression.
628 /// \param[in] arg0 A data expression.
629 /// \param[in] arg1 A data expression.
630 inline
631 void make_difference(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
632 {
633 make_application(result, sort_fbag::difference(s),arg0, arg1);
634 }
635
636 /// \brief Recogniser for application of -.
637 /// \param e A data expression.
638 /// \return true iff e is an application of function symbol difference to a
639 /// number of arguments.
640 inline
642 {
643 return is_application(e) && is_difference_function_symbol(atermpp::down_cast<application>(e).head());
644 }
645
646 /// \brief Generate identifier #.
647 /// \return Identifier #.
648 inline
649 const core::identifier_string& count_all_name()
650 {
651 static core::identifier_string count_all_name = core::identifier_string("#");
652 return count_all_name;
653 }
654
655 /// \brief Constructor for function symbol #.
656 /// \param s A sort expression.
657 /// \return Function symbol count_all.
658 inline
660 {
662 return count_all;
663 }
664
665 /// \brief Recogniser for function #.
666 /// \param e A data expression.
667 /// \return true iff e is the function symbol matching #.
668 inline
670 {
672 {
673 return atermpp::down_cast<function_symbol>(e).name() == count_all_name();
674 }
675 return false;
676 }
677
678 /// \brief Application of function symbol #.
679 /// \param[in] s A sort expression.
680 /// \param[in] arg0 A data expression.
681 /// \return Application of # to a number of arguments.
682 inline
683 application count_all(const sort_expression& s, const data_expression& arg0)
684 {
685 return sort_fbag::count_all(s)(arg0);
686 }
687
688 /// \brief Make an application of function symbol #.
689 /// \param[out] result The data expression where the # expression is put.
690 /// \param[in] s A sort expression.
691 /// \param[in] arg0 A data expression.
692 inline
693 void make_count_all(data_expression& result, const sort_expression& s, const data_expression& arg0)
694 {
695 make_application(result, sort_fbag::count_all(s),arg0);
696 }
697
698 /// \brief Recogniser for application of #.
699 /// \param e A data expression.
700 /// \return true iff e is an application of function symbol count_all to a
701 /// number of arguments.
702 inline
704 {
705 return is_application(e) && is_count_all_function_symbol(atermpp::down_cast<application>(e).head());
706 }
707
708 /// \brief Generate identifier pick.
709 /// \return Identifier pick.
710 inline
711 const core::identifier_string& pick_name()
712 {
713 static core::identifier_string pick_name = core::identifier_string("pick");
714 return pick_name;
715 }
716
717 /// \brief Constructor for function symbol pick.
718 /// \param s A sort expression.
719 /// \return Function symbol pick.
720 inline
722 {
724 return pick;
725 }
726
727 /// \brief Recogniser for function pick.
728 /// \param e A data expression.
729 /// \return true iff e is the function symbol matching pick.
730 inline
732 {
734 {
735 return atermpp::down_cast<function_symbol>(e).name() == pick_name();
736 }
737 return false;
738 }
739
740 /// \brief Application of function symbol pick.
741 /// \param[in] s A sort expression.
742 /// \param[in] arg0 A data expression.
743 /// \return Application of pick to a number of arguments.
744 inline
745 application pick(const sort_expression& s, const data_expression& arg0)
746 {
747 return sort_fbag::pick(s)(arg0);
748 }
749
750 /// \brief Make an application of function symbol pick.
751 /// \param[out] result The data expression where the pick expression is put.
752 /// \param[in] s A sort expression.
753 /// \param[in] arg0 A data expression.
754 inline
755 void make_pick(data_expression& result, const sort_expression& s, const data_expression& arg0)
756 {
757 make_application(result, sort_fbag::pick(s),arg0);
758 }
759
760 /// \brief Recogniser for application of pick.
761 /// \param e A data expression.
762 /// \return true iff e is an application of function symbol pick to a
763 /// number of arguments.
764 inline
765 bool is_pick_application(const atermpp::aterm& e)
766 {
767 return is_application(e) && is_pick_function_symbol(atermpp::down_cast<application>(e).head());
768 }
769 /// \brief Give all system defined mappings for fbag
770 /// \param s A sort expression
771 /// \return All system defined mappings for fbag
772 inline
774 {
775 function_symbol_vector result;
776 result.push_back(sort_fbag::cons_(s));
777 result.push_back(sort_fbag::cinsert(s));
778 result.push_back(sort_fbag::count(s));
779 result.push_back(sort_fbag::in(s));
780 result.push_back(sort_fbag::union_(s));
781 result.push_back(sort_fbag::intersection(s));
782 result.push_back(sort_fbag::difference(s));
783 result.push_back(sort_fbag::count_all(s));
784 result.push_back(sort_fbag::pick(s));
785 return result;
786 }
787
788 /// \brief Give all system defined mappings and constructors for fbag
789 /// \param s A sort expression
790 /// \return All system defined mappings for fbag
791 inline
793 {
794 function_symbol_vector result=fbag_generate_functions_code(s);
795 for(const function_symbol& f: fbag_generate_constructors_code(s))
796 {
797 result.push_back(f);
798 }
799 return result;
800 }
801
802 /// \brief Give all system defined mappings that can be used in mCRL2 specs for fbag
803 /// \param s A sort expression
804 /// \return All system defined mappings for that can be used in mCRL2 specificationis fbag
805 inline
807 {
808 function_symbol_vector result;
809 result.push_back(sort_fbag::cons_(s));
810 result.push_back(sort_fbag::cinsert(s));
811 result.push_back(sort_fbag::count(s));
812 result.push_back(sort_fbag::in(s));
813 result.push_back(sort_fbag::union_(s));
814 result.push_back(sort_fbag::intersection(s));
815 result.push_back(sort_fbag::difference(s));
816 result.push_back(sort_fbag::count_all(s));
817 result.push_back(sort_fbag::pick(s));
818 return result;
819 }
820
821
822 // The typedef is the sort that maps a function symbol to an function that rewrites it as well as a string of a function that can be used to implement it
824 /// \brief Give all system defined mappings that are to be implemented in C++ code for fbag
825 /// \param s A sort expression
826 /// \return A mapping from C++ implementable function symbols to system defined mappings implemented in C++ code for fbag
827 inline
829 {
830 implementation_map result;
831 return result;
832 }
833 ///\brief Function for projecting out argument.
834 /// arg1 from an application.
835 /// \param e A data expression.
836 /// \pre arg1 is defined for e.
837 /// \return The argument of e that corresponds to arg1.
838 inline
839 const data_expression& arg1(const data_expression& e)
840 {
842 return atermpp::down_cast<application>(e)[0];
843 }
844
845 ///\brief Function for projecting out argument.
846 /// arg2 from an application.
847 /// \param e A data expression.
848 /// \pre arg2 is defined for e.
849 /// \return The argument of e that corresponds to arg2.
850 inline
851 const data_expression& arg2(const data_expression& e)
852 {
854 return atermpp::down_cast<application>(e)[1];
855 }
856
857 ///\brief Function for projecting out argument.
858 /// arg3 from an application.
859 /// \param e A data expression.
860 /// \pre arg3 is defined for e.
861 /// \return The argument of e that corresponds to arg3.
862 inline
863 const data_expression& arg3(const data_expression& e)
864 {
866 return atermpp::down_cast<application>(e)[2];
867 }
868
869 ///\brief Function for projecting out argument.
870 /// left from an application.
871 /// \param e A data expression.
872 /// \pre left is defined for e.
873 /// \return The argument of e that corresponds to left.
874 inline
875 const data_expression& left(const data_expression& e)
876 {
878 return atermpp::down_cast<application>(e)[0];
879 }
880
881 ///\brief Function for projecting out argument.
882 /// right from an application.
883 /// \param e A data expression.
884 /// \pre right is defined for e.
885 /// \return The argument of e that corresponds to right.
886 inline
887 const data_expression& right(const data_expression& e)
888 {
890 return atermpp::down_cast<application>(e)[1];
891 }
892
893 ///\brief Function for projecting out argument.
894 /// arg from an application.
895 /// \param e A data expression.
896 /// \pre arg is defined for e.
897 /// \return The argument of e that corresponds to arg.
898 inline
899 const data_expression& arg(const data_expression& e)
900 {
902 return atermpp::down_cast<application>(e)[0];
903 }
904
905 /// \brief Give all system defined equations for fbag
906 /// \param s A sort expression
907 /// \return All system defined equations for sort fbag
908 inline
910 {
911 variable vd("d",s);
912 variable ve("e",s);
916 variable vb("b",fbag(s));
917 variable vc("c",fbag(s));
920
921 data_equation_vector result;
922 result.emplace_back(variable_list({vb, vd, vp}), equal_to(cons_(s, vd, vp, vb), empty(s)), sort_bool::false_());
923 result.emplace_back(variable_list({vb, vd, vp}), equal_to(empty(s), cons_(s, vd, vp, vb)), sort_bool::false_());
924 result.emplace_back(variable_list({vb, vc, vd, ve, vp, vq}), equal_to(cons_(s, vd, vp, vb), cons_(s, ve, vq, vc)), sort_bool::and_(equal_to(vp, vq), sort_bool::and_(equal_to(vd, ve), equal_to(vb, vc))));
925 result.emplace_back(variable_list({vb, vd, vp}), less_equal(cons_(s, vd, vp, vb), empty(s)), sort_bool::false_());
926 result.emplace_back(variable_list({vb, vd, vp}), less_equal(empty(s), cons_(s, vd, vp, vb)), sort_bool::true_());
927 result.emplace_back(variable_list({vb, vc, vd, ve, vp, vq}), less_equal(cons_(s, vd, vp, vb), cons_(s, ve, vq, vc)), if_(less(vd, ve), sort_bool::false_(), if_(equal_to(vd, ve), sort_bool::and_(less_equal(vp, vq), less_equal(vb, vc)), less_equal(cons_(s, vd, vp, vb), vc))));
928 result.emplace_back(variable_list({vb, vd, vp}), less(cons_(s, vd, vp, vb), empty(s)), sort_bool::false_());
929 result.emplace_back(variable_list({vb, vd, vp}), less(empty(s), cons_(s, vd, vp, vb)), sort_bool::true_());
930 result.emplace_back(variable_list({vb, vc, vd, ve, vp, vq}), less(cons_(s, vd, vp, vb), cons_(s, ve, vq, vc)), if_(less(vd, ve), sort_bool::false_(), if_(equal_to(vd, ve), sort_bool::or_(sort_bool::and_(equal_to(vp, vq), less(vb, vc)), sort_bool::and_(less(vp, vq), less_equal(vb, vc))), less_equal(cons_(s, vd, vp, vb), vc))));
931 result.emplace_back(variable_list(), less_total(empty(s), empty(s)), sort_bool::false_());
932 result.emplace_back(variable_list({vb, vd, vp}), less_total(empty(s), cons_(s, vd, vp, vb)), sort_bool::true_());
933 result.emplace_back(variable_list({vb, vd, vp}), less_total(cons_(s, vd, vp, vb), empty(s)), sort_bool::false_());
934 result.emplace_back(variable_list({vb, vc, vd, ve, vp, vq}), less_total(cons_(s, vd, vp, vb), cons_(s, ve, vq, vc)), sort_bool::or_(less_total(vd, ve), sort_bool::or_(sort_bool::and_(equal_to(vd, ve), less_total(vp, vq)), sort_bool::and_(equal_to(vd, ve), sort_bool::and_(equal_to(vp, vq), less_total(vb, vc))))));
935 result.emplace_back(variable_list({vd, vp}), insert(s, vd, vp, empty(s)), cons_(s, vd, vp, empty(s)));
936 result.emplace_back(variable_list({vb, vd, vp, vq}), insert(s, vd, vp, cons_(s, vd, vq, vb)), cons_(s, vd, sort_pos::auxiliary_plus_pos(vp, vq), vb));
937 result.emplace_back(variable_list({vb, vd, ve, vp, vq}), less_total(vd, ve), insert(s, vd, vp, cons_(s, ve, vq, vb)), cons_(s, vd, vp, cons_(s, ve, vq, vb)));
938 result.emplace_back(variable_list({vb, vd, ve, vp, vq}), less_total(ve, vd), insert(s, vd, vp, cons_(s, ve, vq, vb)), cons_(s, ve, vq, insert(s, vd, vp, vb)));
939 result.emplace_back(variable_list({vb, vd, vn}), cinsert(s, vd, vn, vb), if_(equal_to(vn, sort_nat::most_significant_digit_nat(sort_machine_word::zero_word())), vb, insert(s, vd, sort_nat::nat2pos(vn), vb)));
940 result.emplace_back(variable_list({vd}), count(s, vd, empty(s)), sort_nat::c0());
941 result.emplace_back(variable_list({vb, vd, vp}), count(s, vd, cons_(s, vd, vp, vb)), sort_nat::pos2nat(vp));
942 result.emplace_back(variable_list({vb, vd, ve, vp}), less_total(vd, ve), count(s, vd, cons_(s, ve, vp, vb)), sort_nat::c0());
943 result.emplace_back(variable_list({vb, vd, ve, vp}), less_total(ve, vd), count(s, vd, cons_(s, ve, vp, vb)), count(s, vd, vb));
944 result.emplace_back(variable_list({vb, vd}), in(s, vd, vb), greater(count(s, vd, vb), sort_nat::c0()));
945 result.emplace_back(variable_list({vb}), difference(s, vb, empty(s)), vb);
946 result.emplace_back(variable_list({vc}), difference(s, empty(s), vc), empty(s));
947 result.emplace_back(variable_list({vb, vc, vd, vp}), difference(s, cons_(s, vd, vp, vb), cons_(s, vd, vp, vc)), difference(s, vb, vc));
948 result.emplace_back(variable_list({vb, vc, vd, vp, vq}), less_total(vp, vq), difference(s, cons_(s, vd, vp, vb), cons_(s, vd, vq, vc)), difference(s, vb, vc));
949 result.emplace_back(variable_list({vb, vc, vd, vp, vq}), less_total(vq, vp), difference(s, cons_(s, vd, vp, vb), cons_(s, vd, vq, vc)), cons_(s, vd, sort_nat::nat2pos(sort_nat::monus(sort_nat::pos2nat(vp), sort_nat::pos2nat(vq))), difference(s, vb, vc)));
950 result.emplace_back(variable_list({vb, vc, vd, ve, vp, vq}), less_total(vd, ve), difference(s, cons_(s, vd, vp, vb), cons_(s, ve, vq, vc)), cons_(s, vd, vp, difference(s, vb, cons_(s, ve, vq, vc))));
951 result.emplace_back(variable_list({vb, vc, vd, ve, vp, vq}), less_total(ve, vd), difference(s, cons_(s, vd, vp, vb), cons_(s, ve, vq, vc)), difference(s, cons_(s, vd, vp, vb), vc));
952 result.emplace_back(variable_list({vb}), union_(s, vb, empty(s)), vb);
953 result.emplace_back(variable_list({vc}), union_(s, empty(s), vc), vc);
954 result.emplace_back(variable_list({vb, vc, vd, vp, vq}), union_(s, cons_(s, vd, vp, vb), cons_(s, vd, vq, vc)), cons_(s, vd, sort_pos::auxiliary_plus_pos(vp, vq), union_(s, vb, vc)));
955 result.emplace_back(variable_list({vb, vc, vd, ve, vp, vq}), less_total(vd, ve), union_(s, cons_(s, vd, vp, vb), cons_(s, ve, vq, vc)), cons_(s, vd, vp, union_(s, vb, cons_(s, ve, vq, vc))));
956 result.emplace_back(variable_list({vb, vc, vd, ve, vp, vq}), less_total(ve, vd), union_(s, cons_(s, vd, vp, vb), cons_(s, ve, vq, vc)), cons_(s, ve, vq, union_(s, cons_(s, vd, vp, vb), vc)));
957 result.emplace_back(variable_list({vb}), intersection(s, vb, empty(s)), empty(s));
958 result.emplace_back(variable_list({vc}), intersection(s, empty(s), vc), empty(s));
959 result.emplace_back(variable_list({vb, vc, vd, vp, vq}), intersection(s, cons_(s, vd, vp, vb), cons_(s, vd, vq, vc)), cons_(s, vd, sort_nat::minimum(vp, vq), intersection(s, vb, vc)));
960 result.emplace_back(variable_list({vb, vc, vd, ve, vp, vq}), less_total(vd, ve), intersection(s, cons_(s, vd, vp, vb), cons_(s, ve, vq, vc)), intersection(s, vb, cons_(s, ve, vq, vc)));
961 result.emplace_back(variable_list({vb, vc, vd, ve, vp, vq}), less_total(ve, vd), intersection(s, cons_(s, vd, vp, vb), cons_(s, ve, vq, vc)), intersection(s, cons_(s, vd, vp, vb), vc));
962 result.emplace_back(variable_list(), count_all(s, empty(s)), sort_nat::c0());
963 result.emplace_back(variable_list({vd, vp}), count_all(s, cons_(s, vd, vp, empty(s))), sort_nat::pos2nat(vp));
964 result.emplace_back(variable_list({vb, vd, ve, vp, vq}), count_all(s, cons_(s, vd, vp, cons_(s, ve, vq, vb))), sort_nat::pos2nat(sort_pos::auxiliary_plus_pos(vp, sort_nat::nat2pos(count_all(s, cons_(s, ve, vq, vb))))));
965 result.emplace_back(variable_list({vb, vd, vp}), pick(s, cons_(s, vd, vp, vb)), vd);
966 return result;
967 }
968
969} // namespace mcrl2::data::sort_fbag
970
971#endif // MCRL2_DATA_FBAG64_H
A unordered_map class in which aterms can be stored.
\brief A container sort
container_sort(const container_type &container_name, const sort_expression &element_sort)
\brief Constructor Z14.
const container_type & container_name() const
container_sort(const atermpp::aterm &term)
application operator()(const data_expression &e1, const data_expression &e2, const data_expression &e3) const
Apply a data expression to three data expressions.
application operator()(const data_expression &e1, const data_expression &e2) const
Apply a data expression to two data expressions.
application operator()(const data_expression &e) const
Apply a data expression to a data expression.
\brief Container type for finite bags
fbag_container()
\brief Default constructor X3.
\brief A function symbol
function_symbol(const core::identifier_string &name, const sort_expression &sort)
Constructor.
\brief A sort expression
\brief A data variable
Definition variable.h:25
Namespace for system defined sort bool_.
Definition bool.h:29
const basic_sort & bool_()
Constructor for sort expression Bool.
Definition bool.h:41
Namespace for system defined sort fbag.
Definition fbag1.h:34
bool is_empty_function_symbol(const atermpp::aterm &e)
Recogniser for function {:}.
Definition fbag1.h:84
void make_count(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol count.
Definition fbag1.h:375
const core::identifier_string & count_all_name()
Generate identifier #.
Definition fbag1.h:711
function_symbol_vector fbag_generate_constructors_and_functions_code(const sort_expression &s)
Give all system defined mappings and constructors for fbag.
Definition fbag1.h:855
implementation_map fbag_cpp_implementable_constructors(const sort_expression &)
Give all system defined constructors which have an implementation in C++ and not in rewrite rules for...
Definition fbag1.h:188
container_sort fbag(const sort_expression &s)
Constructor for sort expression FBag(S)
Definition fbag1.h:40
application pick(const sort_expression &s, const data_expression &arg0)
Application of function symbol pick.
Definition fbag1.h:807
application union_(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol +.
Definition fbag1.h:554
bool is_in_function_symbol(const atermpp::aterm &e)
Recogniser for function in.
Definition fbag1.h:413
bool is_difference_function_symbol(const atermpp::aterm &e)
Recogniser for function -.
Definition fbag1.h:667
application intersection(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol *.
Definition fbag1.h:618
function_symbol pick(const sort_expression &s)
Constructor for function symbol pick.
Definition fbag1.h:783
const core::identifier_string & count_name()
Generate identifier count.
Definition fbag1.h:329
const core::identifier_string & cinsert_name()
Generate identifier @fbag_cinsert.
Definition fbag1.h:263
bool is_union_application(const atermpp::aterm &e)
Recogniser for application of +.
Definition fbag1.h:575
function_symbol intersection(const sort_expression &s)
Constructor for function symbol *.
Definition fbag1.h:593
const data_expression & arg3(const data_expression &e)
Function for projecting out argument. arg3 from an application.
Definition fbag1.h:927
function_symbol union_(const sort_expression &s)
Constructor for function symbol +.
Definition fbag1.h:529
const data_expression & arg(const data_expression &e)
Function for projecting out argument. arg from an application.
Definition fbag1.h:963
bool is_cinsert_function_symbol(const atermpp::aterm &e)
Recogniser for function @fbag_cinsert.
Definition fbag1.h:283
function_symbol cons_(const sort_expression &s)
Constructor for function symbol @fbag_cons.
Definition fbag1.h:207
bool is_insert_function_symbol(const atermpp::aterm &e)
Recogniser for function @fbag_insert.
Definition fbag1.h:116
implementation_map fbag_cpp_implementable_mappings(const sort_expression &)
Give all system defined mappings that are to be implemented in C++ code for fbag.
Definition fbag1.h:892
bool is_intersection_application(const atermpp::aterm &e)
Recogniser for application of *.
Definition fbag1.h:639
function_symbol count_all(const sort_expression &s)
Constructor for function symbol #.
Definition fbag1.h:721
void make_intersection(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol *.
Definition fbag1.h:629
bool is_cons_function_symbol(const atermpp::aterm &e)
Recogniser for function @fbag_cons.
Definition fbag1.h:217
application in(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol in.
Definition fbag1.h:428
function_symbol insert(const sort_expression &s)
Constructor for function symbol @fbag_insert.
Definition fbag1.h:106
application insert(const sort_expression &s, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2)
Application of function symbol @fbag_insert.
Definition fbag1.h:132
void make_union(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol +.
Definition fbag1.h:565
const core::identifier_string & cons_name()
Generate identifier @fbag_cons.
Definition fbag1.h:197
application cinsert(const sort_expression &s, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2)
Application of function symbol @fbag_cinsert.
Definition fbag1.h:299
bool is_in_application(const atermpp::aterm &e)
Recogniser for application of in.
Definition fbag1.h:449
const core::identifier_string & empty_name()
Generate identifier {:}.
Definition fbag1.h:64
const core::identifier_string & difference_name()
Generate identifier -.
Definition fbag1.h:647
bool is_difference_application(const atermpp::aterm &e)
Recogniser for application of -.
Definition fbag1.h:703
bool is_count_application(const atermpp::aterm &e)
Recogniser for application of count.
Definition fbag1.h:385
bool is_cons_application(const atermpp::aterm &e)
Recogniser for application of @fbag_cons.
Definition fbag1.h:255
void make_in(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol in.
Definition fbag1.h:439
const data_expression & left(const data_expression &e)
Function for projecting out argument. left from an application.
Definition fbag1.h:939
const data_expression & arg2(const data_expression &e)
Function for projecting out argument. arg2 from an application.
Definition fbag1.h:915
void make_count_all(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol #.
Definition fbag1.h:755
bool is_pick_function_symbol(const atermpp::aterm &e)
Recogniser for function pick.
Definition fbag1.h:793
bool is_count_function_symbol(const atermpp::aterm &e)
Recogniser for function count.
Definition fbag1.h:349
application count_all(const sort_expression &s, const data_expression &arg0)
Application of function symbol #.
Definition fbag1.h:745
bool is_intersection_function_symbol(const atermpp::aterm &e)
Recogniser for function *.
Definition fbag1.h:603
application cons_(const sort_expression &s, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2)
Application of function symbol @fbag_cons.
Definition fbag1.h:233
const core::identifier_string & intersection_name()
Generate identifier *.
Definition fbag1.h:583
const data_expression & right(const data_expression &e)
Function for projecting out argument. right from an application.
Definition fbag1.h:951
bool is_pick_application(const atermpp::aterm &e)
Recogniser for application of pick.
Definition fbag1.h:827
function_symbol in(const sort_expression &s)
Constructor for function symbol in.
Definition fbag1.h:403
function_symbol_vector fbag_generate_constructors_code(const sort_expression &s)
Give all system defined constructors for fbag.
Definition fbag1.h:162
bool is_count_all_application(const atermpp::aterm &e)
Recogniser for application of #.
Definition fbag1.h:765
function_symbol count(const sort_expression &s)
Constructor for function symbol count.
Definition fbag1.h:339
bool is_fbag(const sort_expression &e)
Recogniser for sort expression FBag(s)
Definition fbag1.h:51
void make_cinsert(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2)
Make an application of function symbol @fbag_cinsert.
Definition fbag1.h:311
application difference(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol -.
Definition fbag1.h:682
function_symbol empty(const sort_expression &s)
Constructor for function symbol {:}.
Definition fbag1.h:74
void make_difference(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol -.
Definition fbag1.h:693
function_symbol cinsert(const sort_expression &s)
Constructor for function symbol @fbag_cinsert.
Definition fbag1.h:273
bool is_cinsert_application(const atermpp::aterm &e)
Recogniser for application of @fbag_cinsert.
Definition fbag1.h:321
void make_insert(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2)
Make an application of function symbol @fbag_insert.
Definition fbag1.h:144
bool is_count_all_function_symbol(const atermpp::aterm &e)
Recogniser for function #.
Definition fbag1.h:731
function_symbol_vector fbag_mCRL2_usable_mappings(const sort_expression &s)
Give all system defined mappings that can be used in mCRL2 specs for fbag.
Definition fbag1.h:869
void make_cons(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2)
Make an application of function symbol @fbag_cons.
Definition fbag1.h:245
const core::identifier_string & pick_name()
Generate identifier pick.
Definition fbag1.h:773
const core::identifier_string & union_name()
Generate identifier +.
Definition fbag1.h:519
application count(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol count.
Definition fbag1.h:364
function_symbol difference(const sort_expression &s)
Constructor for function symbol -.
Definition fbag1.h:657
function_symbol_vector fbag_generate_functions_code(const sort_expression &s)
Give all system defined mappings for fbag.
Definition fbag1.h:835
bool is_insert_application(const atermpp::aterm &e)
Recogniser for application of @fbag_insert.
Definition fbag1.h:154
const core::identifier_string & insert_name()
Generate identifier @fbag_insert.
Definition fbag1.h:96
data_equation_vector fbag_generate_equations_code(const sort_expression &s)
Give all system defined equations for fbag.
Definition fbag1.h:973
bool is_union_function_symbol(const atermpp::aterm &e)
Recogniser for function +.
Definition fbag1.h:539
void make_pick(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol pick.
Definition fbag1.h:817
const data_expression & arg1(const data_expression &e)
Function for projecting out argument. arg1 from an application.
Definition fbag1.h:903
function_symbol_vector fbag_mCRL2_usable_constructors(const sort_expression &s)
Give all defined constructors which can be used in mCRL2 specs for fbag.
Definition fbag1.h:174
const core::identifier_string & in_name()
Generate identifier in.
Definition fbag1.h:393
Namespace for system defined sort nat.
const basic_sort & nat()
Constructor for sort expression Nat.
Definition nat1.h:43
Namespace for system defined sort pos.
const basic_sort & pos()
Constructor for sort expression Pos.
Definition pos1.h:42
function_sort make_function_sort_(const sort_expression &dom1, const sort_expression &codomain)
Convenience constructor for function sort with domain size 1.
bool is_container_sort(const atermpp::aterm &x)
Returns true if the term t is a container sort.
bool is_function_symbol(const atermpp::aterm &x)
Returns true if the term t is a function symbol.
function_sort make_function_sort_(const sort_expression &dom1, const sort_expression &dom2, const sort_expression &dom3, const sort_expression &codomain)
Convenience constructor for function sort with domain size 3.
function_sort make_function_sort_(const sort_expression &dom1, const sort_expression &dom2, const sort_expression &codomain)
Convenience constructor for function sort with domain size 2.