mCRL2
Loading...
Searching...
No Matches
bag64.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//
14
15#ifndef MCRL2_DATA_BAG64_H
16#define MCRL2_DATA_BAG64_H
17
18#include "functional" // std::function
25#include "mcrl2/data/standard.h"
26#include "mcrl2/data/forall.h"
28#include "mcrl2/data/nat64.h"
29#include "mcrl2/data/fbag64.h"
30#include "mcrl2/data/fset64.h"
31#include "mcrl2/data/set64.h"
32
33namespace mcrl2 {
34
35 namespace data {
36
38 namespace sort_bag {
39
43 inline
44 container_sort bag(const sort_expression& s)
45 {
46 container_sort bag(bag_container(), s);
47 return bag;
48 }
49
54 inline
55 bool is_bag(const sort_expression& e)
56 {
57 if (is_container_sort(e))
58 {
59 return container_sort(e).container_name() == bag_container();
60 }
61 return false;
62 }
63
64
67 inline
69 {
71 return constructor_name;
72 }
73
77 inline
78 function_symbol constructor(const sort_expression& s)
79 {
81 return constructor;
82 }
83
87 inline
89 {
90 if (is_function_symbol(e))
91 {
92 return atermpp::down_cast<function_symbol>(e).name() == constructor_name();
93 }
94 return false;
95 }
96
102 inline
103 application constructor(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
104 {
105 return sort_bag::constructor(s)(arg0, arg1);
106 }
107
113 inline
114 void make_constructor(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
115 {
117 }
118
123 inline
125 {
126 return is_application(e) && is_constructor_function_symbol(atermpp::down_cast<application>(e).head());
127 }
131 inline
133 {
135 result.push_back(sort_bag::constructor(s));
136
137 return result;
138 }
142 inline
144 {
146 result.push_back(sort_bag::constructor(s));
147
148 return result;
149 }
150 // 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
151 typedef std::map<function_symbol,std::pair<std::function<void(data_expression&, const data_expression&)>, std::string> > implementation_map;
155 inline
157 {
158 implementation_map result;
159 static_cast< void >(s); // suppress unused variable warnings
160 return result;
161 }
162
165 inline
167 {
169 return bag_fbag_name;
170 }
171
175 inline
176 function_symbol bag_fbag(const sort_expression& s)
177 {
179 return bag_fbag;
180 }
181
185 inline
187 {
188 if (is_function_symbol(e))
189 {
190 return atermpp::down_cast<function_symbol>(e).name() == bag_fbag_name();
191 }
192 return false;
193 }
194
199 inline
200 application bag_fbag(const sort_expression& s, const data_expression& arg0)
201 {
202 return sort_bag::bag_fbag(s)(arg0);
203 }
204
209 inline
210 void make_bag_fbag(data_expression& result, const sort_expression& s, const data_expression& arg0)
211 {
212 make_application(result, sort_bag::bag_fbag(s),arg0);
213 }
214
219 inline
221 {
222 return is_application(e) && is_bag_fbag_function_symbol(atermpp::down_cast<application>(e).head());
223 }
224
227 inline
229 {
232 }
233
237 inline
238 function_symbol bag_comprehension(const sort_expression& s)
239 {
241 return bag_comprehension;
242 }
243
247 inline
249 {
250 if (is_function_symbol(e))
251 {
252 return atermpp::down_cast<function_symbol>(e).name() == bag_comprehension_name();
253 }
254 return false;
255 }
256
261 inline
262 application bag_comprehension(const sort_expression& s, const data_expression& arg0)
263 {
264 return sort_bag::bag_comprehension(s)(arg0);
265 }
266
271 inline
272 void make_bag_comprehension(data_expression& result, const sort_expression& s, const data_expression& arg0)
273 {
275 }
276
281 inline
283 {
284 return is_application(e) && is_bag_comprehension_function_symbol(atermpp::down_cast<application>(e).head());
285 }
286
289 inline
291 {
293 return count_name;
294 }
295
296 // This function is not intended for public use and therefore not documented in Doxygen.
297 inline
298 function_symbol count(const sort_expression& , const sort_expression& s0, const sort_expression& s1)
299 {
300 sort_expression target_sort(sort_nat::nat());
301 function_symbol count(count_name(), make_function_sort_(s0, s1, target_sort));
302 return count;
303 }
304
308 inline
310 {
311 if (is_function_symbol(e))
312 {
313 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
314 return f.name() == count_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 2;
315 }
316 return false;
317 }
318
324 inline
325 application count(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
326 {
327 return sort_bag::count(s, arg0.sort(), arg1.sort())(arg0, arg1);
328 }
329
335 inline
336 void make_count(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
337 {
338 make_application(result, sort_bag::count(s, arg0.sort(), arg1.sort()),arg0, arg1);
339 }
340
345 inline
347 {
348 return is_application(e) && is_count_function_symbol(atermpp::down_cast<application>(e).head());
349 }
350
353 inline
355 {
357 return in_name;
358 }
359
360 // This function is not intended for public use and therefore not documented in Doxygen.
361 inline
362 function_symbol in(const sort_expression& , const sort_expression& s0, const sort_expression& s1)
363 {
364 sort_expression target_sort(sort_bool::bool_());
365 function_symbol in(in_name(), make_function_sort_(s0, s1, target_sort));
366 return in;
367 }
368
372 inline
374 {
375 if (is_function_symbol(e))
376 {
377 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
378 return f.name() == in_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 2;
379 }
380 return false;
381 }
382
388 inline
389 application in(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
390 {
391 return sort_bag::in(s, arg0.sort(), arg1.sort())(arg0, arg1);
392 }
393
399 inline
400 void make_in(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
401 {
402 make_application(result, sort_bag::in(s, arg0.sort(), arg1.sort()),arg0, arg1);
403 }
404
409 inline
410 bool is_in_application(const atermpp::aterm& e)
411 {
412 return is_application(e) && is_in_function_symbol(atermpp::down_cast<application>(e).head());
413 }
414
417 inline
419 {
421 return union_name;
422 }
423
424 // This function is not intended for public use and therefore not documented in Doxygen.
425 inline
426 function_symbol union_(const sort_expression& s, const sort_expression& s0, const sort_expression& s1)
427 {
428 sort_expression target_sort;
429 if (s0 == bag(s) && s1 == bag(s))
430 {
431 target_sort = bag(s);
432 }
433 else if (s0 == sort_set::set_(s) && s1 == sort_set::set_(s))
434 {
436 }
437 else if (s0 == sort_fset::fset(s) && s1 == sort_fset::fset(s))
438 {
440 }
441 else if (s0 == sort_fbag::fbag(s) && s1 == sort_fbag::fbag(s))
442 {
444 }
445 else
446 {
447 throw mcrl2::runtime_error("Cannot compute target sort for union_ with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
448 }
449
450 function_symbol union_(union_name(), make_function_sort_(s0, s1, target_sort));
451 return union_;
452 }
453
457 inline
459 {
460 if (is_function_symbol(e))
461 {
462 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
463 return f.name() == union_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 2;
464 }
465 return false;
466 }
467
473 inline
474 application union_(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
475 {
476 return sort_bag::union_(s, arg0.sort(), arg1.sort())(arg0, arg1);
477 }
478
484 inline
485 void make_union_(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
486 {
487 make_application(result, sort_bag::union_(s, arg0.sort(), arg1.sort()),arg0, arg1);
488 }
489
494 inline
496 {
497 return is_application(e) && is_union_function_symbol(atermpp::down_cast<application>(e).head());
498 }
499
502 inline
504 {
506 return intersection_name;
507 }
508
509 // This function is not intended for public use and therefore not documented in Doxygen.
510 inline
511 function_symbol intersection(const sort_expression& s, const sort_expression& s0, const sort_expression& s1)
512 {
513 sort_expression target_sort;
514 if (s0 == bag(s) && s1 == bag(s))
515 {
516 target_sort = bag(s);
517 }
518 else if (s0 == sort_fbag::fbag(s) && s1 == bag(s))
519 {
521 }
522 else if (s0 == bag(s) && s1 == sort_fbag::fbag(s))
523 {
525 }
526 else if (s0 == sort_set::set_(s) && s1 == sort_set::set_(s))
527 {
529 }
530 else if (s0 == sort_fset::fset(s) && s1 == sort_set::set_(s))
531 {
533 }
534 else if (s0 == sort_set::set_(s) && s1 == sort_fset::fset(s))
535 {
537 }
538 else if (s0 == sort_fset::fset(s) && s1 == sort_fset::fset(s))
539 {
541 }
542 else if (s0 == sort_fbag::fbag(s) && s1 == sort_fbag::fbag(s))
543 {
545 }
546 else
547 {
548 throw mcrl2::runtime_error("Cannot compute target sort for intersection with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
549 }
550
552 return intersection;
553 }
554
558 inline
560 {
561 if (is_function_symbol(e))
562 {
563 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
564 return f.name() == intersection_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 2;
565 }
566 return false;
567 }
568
574 inline
575 application intersection(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
576 {
577 return sort_bag::intersection(s, arg0.sort(), arg1.sort())(arg0, arg1);
578 }
579
585 inline
586 void make_intersection(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
587 {
588 make_application(result, sort_bag::intersection(s, arg0.sort(), arg1.sort()),arg0, arg1);
589 }
590
595 inline
597 {
598 return is_application(e) && is_intersection_function_symbol(atermpp::down_cast<application>(e).head());
599 }
600
603 inline
605 {
607 return difference_name;
608 }
609
610 // This function is not intended for public use and therefore not documented in Doxygen.
611 inline
612 function_symbol difference(const sort_expression& s, const sort_expression& s0, const sort_expression& s1)
613 {
614 sort_expression target_sort;
615 if (s0 == bag(s) && s1 == bag(s))
616 {
617 target_sort = bag(s);
618 }
619 else if (s0 == sort_fbag::fbag(s) && s1 == bag(s))
620 {
622 }
623 else if (s0 == sort_set::set_(s) && s1 == sort_set::set_(s))
624 {
626 }
627 else if (s0 == sort_fset::fset(s) && s1 == sort_set::set_(s))
628 {
630 }
631 else if (s0 == sort_fset::fset(s) && s1 == sort_fset::fset(s))
632 {
634 }
635 else if (s0 == sort_fbag::fbag(s) && s1 == sort_fbag::fbag(s))
636 {
638 }
639 else
640 {
641 throw mcrl2::runtime_error("Cannot compute target sort for difference with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
642 }
643
645 return difference;
646 }
647
651 inline
653 {
654 if (is_function_symbol(e))
655 {
656 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
657 return f.name() == difference_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 2;
658 }
659 return false;
660 }
661
667 inline
668 application difference(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
669 {
670 return sort_bag::difference(s, arg0.sort(), arg1.sort())(arg0, arg1);
671 }
672
678 inline
679 void make_difference(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
680 {
681 make_application(result, sort_bag::difference(s, arg0.sort(), arg1.sort()),arg0, arg1);
682 }
683
688 inline
690 {
691 return is_application(e) && is_difference_function_symbol(atermpp::down_cast<application>(e).head());
692 }
693
696 inline
698 {
700 return bag2set_name;
701 }
702
706 inline
707 function_symbol bag2set(const sort_expression& s)
708 {
710 return bag2set;
711 }
712
716 inline
718 {
719 if (is_function_symbol(e))
720 {
721 return atermpp::down_cast<function_symbol>(e).name() == bag2set_name();
722 }
723 return false;
724 }
725
730 inline
731 application bag2set(const sort_expression& s, const data_expression& arg0)
732 {
733 return sort_bag::bag2set(s)(arg0);
734 }
735
740 inline
741 void make_bag2set(data_expression& result, const sort_expression& s, const data_expression& arg0)
742 {
743 make_application(result, sort_bag::bag2set(s),arg0);
744 }
745
750 inline
752 {
753 return is_application(e) && is_bag2set_function_symbol(atermpp::down_cast<application>(e).head());
754 }
755
758 inline
760 {
762 return set2bag_name;
763 }
764
768 inline
769 function_symbol set2bag(const sort_expression& s)
770 {
772 return set2bag;
773 }
774
778 inline
780 {
781 if (is_function_symbol(e))
782 {
783 return atermpp::down_cast<function_symbol>(e).name() == set2bag_name();
784 }
785 return false;
786 }
787
792 inline
793 application set2bag(const sort_expression& s, const data_expression& arg0)
794 {
795 return sort_bag::set2bag(s)(arg0);
796 }
797
802 inline
803 void make_set2bag(data_expression& result, const sort_expression& s, const data_expression& arg0)
804 {
805 make_application(result, sort_bag::set2bag(s),arg0);
806 }
807
812 inline
814 {
815 return is_application(e) && is_set2bag_function_symbol(atermpp::down_cast<application>(e).head());
816 }
817
820 inline
822 {
824 return zero_function_name;
825 }
826
830 inline
831 function_symbol zero_function(const sort_expression& s)
832 {
834 return zero_function;
835 }
836
840 inline
842 {
843 if (is_function_symbol(e))
844 {
845 return atermpp::down_cast<function_symbol>(e).name() == zero_function_name();
846 }
847 return false;
848 }
849
854 inline
855 application zero_function(const sort_expression& s, const data_expression& arg0)
856 {
857 return sort_bag::zero_function(s)(arg0);
858 }
859
864 inline
865 void make_zero_function(data_expression& result, const sort_expression& s, const data_expression& arg0)
866 {
868 }
869
874 inline
876 {
877 return is_application(e) && is_zero_function_function_symbol(atermpp::down_cast<application>(e).head());
878 }
879
882 inline
884 {
886 return one_function_name;
887 }
888
892 inline
893 function_symbol one_function(const sort_expression& s)
894 {
896 return one_function;
897 }
898
902 inline
904 {
905 if (is_function_symbol(e))
906 {
907 return atermpp::down_cast<function_symbol>(e).name() == one_function_name();
908 }
909 return false;
910 }
911
916 inline
917 application one_function(const sort_expression& s, const data_expression& arg0)
918 {
919 return sort_bag::one_function(s)(arg0);
920 }
921
926 inline
927 void make_one_function(data_expression& result, const sort_expression& s, const data_expression& arg0)
928 {
930 }
931
936 inline
938 {
939 return is_application(e) && is_one_function_function_symbol(atermpp::down_cast<application>(e).head());
940 }
941
944 inline
946 {
948 return add_function_name;
949 }
950
954 inline
955 function_symbol add_function(const sort_expression& s)
956 {
958 return add_function;
959 }
960
964 inline
966 {
967 if (is_function_symbol(e))
968 {
969 return atermpp::down_cast<function_symbol>(e).name() == add_function_name();
970 }
971 return false;
972 }
973
979 inline
980 application add_function(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
981 {
982 return sort_bag::add_function(s)(arg0, arg1);
983 }
984
990 inline
991 void make_add_function(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
992 {
994 }
995
1000 inline
1002 {
1003 return is_application(e) && is_add_function_function_symbol(atermpp::down_cast<application>(e).head());
1004 }
1005
1008 inline
1010 {
1012 return min_function_name;
1013 }
1014
1018 inline
1019 function_symbol min_function(const sort_expression& s)
1020 {
1022 return min_function;
1023 }
1024
1028 inline
1030 {
1031 if (is_function_symbol(e))
1032 {
1033 return atermpp::down_cast<function_symbol>(e).name() == min_function_name();
1034 }
1035 return false;
1036 }
1037
1043 inline
1044 application min_function(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
1045 {
1046 return sort_bag::min_function(s)(arg0, arg1);
1047 }
1048
1054 inline
1055 void make_min_function(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
1056 {
1058 }
1059
1064 inline
1066 {
1067 return is_application(e) && is_min_function_function_symbol(atermpp::down_cast<application>(e).head());
1068 }
1069
1072 inline
1074 {
1076 return monus_function_name;
1077 }
1078
1082 inline
1083 function_symbol monus_function(const sort_expression& s)
1084 {
1086 return monus_function;
1087 }
1088
1092 inline
1094 {
1095 if (is_function_symbol(e))
1096 {
1097 return atermpp::down_cast<function_symbol>(e).name() == monus_function_name();
1098 }
1099 return false;
1100 }
1101
1107 inline
1108 application monus_function(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
1109 {
1110 return sort_bag::monus_function(s)(arg0, arg1);
1111 }
1112
1118 inline
1119 void make_monus_function(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
1120 {
1122 }
1123
1128 inline
1130 {
1131 return is_application(e) && is_monus_function_function_symbol(atermpp::down_cast<application>(e).head());
1132 }
1133
1136 inline
1138 {
1141 }
1142
1146 inline
1147 function_symbol nat2bool_function(const sort_expression& s)
1148 {
1150 return nat2bool_function;
1151 }
1152
1156 inline
1158 {
1159 if (is_function_symbol(e))
1160 {
1161 return atermpp::down_cast<function_symbol>(e).name() == nat2bool_function_name();
1162 }
1163 return false;
1164 }
1165
1170 inline
1171 application nat2bool_function(const sort_expression& s, const data_expression& arg0)
1172 {
1173 return sort_bag::nat2bool_function(s)(arg0);
1174 }
1175
1180 inline
1181 void make_nat2bool_function(data_expression& result, const sort_expression& s, const data_expression& arg0)
1182 {
1184 }
1185
1190 inline
1192 {
1193 return is_application(e) && is_nat2bool_function_function_symbol(atermpp::down_cast<application>(e).head());
1194 }
1195
1198 inline
1200 {
1203 }
1204
1208 inline
1209 function_symbol bool2nat_function(const sort_expression& s)
1210 {
1212 return bool2nat_function;
1213 }
1214
1218 inline
1220 {
1221 if (is_function_symbol(e))
1222 {
1223 return atermpp::down_cast<function_symbol>(e).name() == bool2nat_function_name();
1224 }
1225 return false;
1226 }
1227
1232 inline
1233 application bool2nat_function(const sort_expression& s, const data_expression& arg0)
1234 {
1235 return sort_bag::bool2nat_function(s)(arg0);
1236 }
1237
1242 inline
1243 void make_bool2nat_function(data_expression& result, const sort_expression& s, const data_expression& arg0)
1244 {
1246 }
1247
1252 inline
1254 {
1255 return is_application(e) && is_bool2nat_function_function_symbol(atermpp::down_cast<application>(e).head());
1256 }
1257
1260 inline
1262 {
1264 return join_name;
1265 }
1266
1270 inline
1272 {
1274 return join;
1275 }
1276
1280 inline
1282 {
1283 if (is_function_symbol(e))
1284 {
1285 return atermpp::down_cast<function_symbol>(e).name() == join_name();
1286 }
1287 return false;
1288 }
1289
1297 inline
1299 {
1300 return sort_bag::join(s)(arg0, arg1, arg2, arg3);
1301 }
1302
1310 inline
1312 {
1313 make_application(result, sort_bag::join(s),arg0, arg1, arg2, arg3);
1314 }
1315
1320 inline
1322 {
1323 return is_application(e) && is_join_function_symbol(atermpp::down_cast<application>(e).head());
1324 }
1325
1328 inline
1330 {
1332 return fbag_intersect_name;
1333 }
1334
1338 inline
1339 function_symbol fbag_intersect(const sort_expression& s)
1340 {
1342 return fbag_intersect;
1343 }
1344
1348 inline
1350 {
1351 if (is_function_symbol(e))
1352 {
1353 return atermpp::down_cast<function_symbol>(e).name() == fbag_intersect_name();
1354 }
1355 return false;
1356 }
1357
1365 inline
1366 application fbag_intersect(const sort_expression& s, const data_expression& arg0, const data_expression& arg1, const data_expression& arg2, const data_expression& arg3)
1367 {
1368 return sort_bag::fbag_intersect(s)(arg0, arg1, arg2, arg3);
1369 }
1370
1378 inline
1379 void make_fbag_intersect(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1, const data_expression& arg2, const data_expression& arg3)
1380 {
1382 }
1383
1388 inline
1390 {
1391 return is_application(e) && is_fbag_intersect_function_symbol(atermpp::down_cast<application>(e).head());
1392 }
1393
1396 inline
1398 {
1400 return fbag_difference_name;
1401 }
1402
1406 inline
1407 function_symbol fbag_difference(const sort_expression& s)
1408 {
1410 return fbag_difference;
1411 }
1412
1416 inline
1418 {
1419 if (is_function_symbol(e))
1420 {
1421 return atermpp::down_cast<function_symbol>(e).name() == fbag_difference_name();
1422 }
1423 return false;
1424 }
1425
1433 inline
1434 application fbag_difference(const sort_expression& s, const data_expression& arg0, const data_expression& arg1, const data_expression& arg2, const data_expression& arg3)
1435 {
1436 return sort_bag::fbag_difference(s)(arg0, arg1, arg2, arg3);
1437 }
1438
1446 inline
1447 void make_fbag_difference(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1, const data_expression& arg2, const data_expression& arg3)
1448 {
1450 }
1451
1456 inline
1458 {
1459 return is_application(e) && is_fbag_difference_function_symbol(atermpp::down_cast<application>(e).head());
1460 }
1461
1464 inline
1466 {
1468 return fbag2fset_name;
1469 }
1470
1474 inline
1475 function_symbol fbag2fset(const sort_expression& s)
1476 {
1478 return fbag2fset;
1479 }
1480
1484 inline
1486 {
1487 if (is_function_symbol(e))
1488 {
1489 return atermpp::down_cast<function_symbol>(e).name() == fbag2fset_name();
1490 }
1491 return false;
1492 }
1493
1499 inline
1500 application fbag2fset(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
1501 {
1502 return sort_bag::fbag2fset(s)(arg0, arg1);
1503 }
1504
1510 inline
1511 void make_fbag2fset(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
1512 {
1513 make_application(result, sort_bag::fbag2fset(s),arg0, arg1);
1514 }
1515
1520 inline
1522 {
1523 return is_application(e) && is_fbag2fset_function_symbol(atermpp::down_cast<application>(e).head());
1524 }
1525
1528 inline
1530 {
1532 return fset2fbag_name;
1533 }
1534
1538 inline
1540 {
1542 return fset2fbag;
1543 }
1544
1548 inline
1550 {
1551 if (is_function_symbol(e))
1552 {
1553 return atermpp::down_cast<function_symbol>(e).name() == fset2fbag_name();
1554 }
1555 return false;
1556 }
1557
1562 inline
1564 {
1565 return sort_bag::fset2fbag(s)(arg0);
1566 }
1567
1572 inline
1574 {
1575 make_application(result, sort_bag::fset2fbag(s),arg0);
1576 }
1577
1582 inline
1584 {
1585 return is_application(e) && is_fset2fbag_function_symbol(atermpp::down_cast<application>(e).head());
1586 }
1590 inline
1592 {
1594 result.push_back(sort_bag::bag_fbag(s));
1595 result.push_back(sort_bag::bag_comprehension(s));
1596 result.push_back(sort_bag::count(s, s, bag(s)));
1597 result.push_back(sort_bag::in(s, s, bag(s)));
1598 result.push_back(sort_bag::union_(s, bag(s), bag(s)));
1599 result.push_back(sort_bag::intersection(s, bag(s), bag(s)));
1600 result.push_back(sort_bag::intersection(s, sort_fbag::fbag(s), bag(s)));
1601 result.push_back(sort_bag::intersection(s, bag(s), sort_fbag::fbag(s)));
1602 result.push_back(sort_bag::difference(s, bag(s), bag(s)));
1603 result.push_back(sort_bag::difference(s, sort_fbag::fbag(s), bag(s)));
1604 result.push_back(sort_bag::bag2set(s));
1605 result.push_back(sort_bag::set2bag(s));
1606 result.push_back(sort_bag::zero_function(s));
1607 result.push_back(sort_bag::one_function(s));
1608 result.push_back(sort_bag::add_function(s));
1609 result.push_back(sort_bag::min_function(s));
1610 result.push_back(sort_bag::monus_function(s));
1611 result.push_back(sort_bag::nat2bool_function(s));
1612 result.push_back(sort_bag::bool2nat_function(s));
1613 result.push_back(sort_bag::join(s));
1614 result.push_back(sort_bag::fbag_intersect(s));
1615 result.push_back(sort_bag::fbag_difference(s));
1616 result.push_back(sort_bag::fbag2fset(s));
1617 result.push_back(sort_bag::fset2fbag(s));
1618 return result;
1619 }
1620
1624 inline
1626 {
1628 for(const function_symbol& f: bag_generate_constructors_code(s))
1629 {
1630 result.push_back(f);
1631 }
1632 return result;
1633 }
1634
1638 inline
1639 function_symbol_vector bag_mCRL2_usable_mappings(const sort_expression& s)
1640 {
1642 result.push_back(sort_bag::bag_fbag(s));
1643 result.push_back(sort_bag::bag_comprehension(s));
1644 result.push_back(sort_bag::count(s, s, bag(s)));
1645 result.push_back(sort_bag::in(s, s, bag(s)));
1646 result.push_back(sort_bag::union_(s, bag(s), bag(s)));
1647 result.push_back(sort_bag::intersection(s, bag(s), bag(s)));
1648 result.push_back(sort_bag::intersection(s, sort_fbag::fbag(s), bag(s)));
1649 result.push_back(sort_bag::intersection(s, bag(s), sort_fbag::fbag(s)));
1650 result.push_back(sort_bag::difference(s, bag(s), bag(s)));
1651 result.push_back(sort_bag::difference(s, sort_fbag::fbag(s), bag(s)));
1652 result.push_back(sort_bag::bag2set(s));
1653 result.push_back(sort_bag::set2bag(s));
1654 result.push_back(sort_bag::zero_function(s));
1655 result.push_back(sort_bag::one_function(s));
1656 result.push_back(sort_bag::add_function(s));
1657 result.push_back(sort_bag::min_function(s));
1658 result.push_back(sort_bag::monus_function(s));
1659 result.push_back(sort_bag::nat2bool_function(s));
1660 result.push_back(sort_bag::bool2nat_function(s));
1661 result.push_back(sort_bag::join(s));
1662 result.push_back(sort_bag::fbag_intersect(s));
1663 result.push_back(sort_bag::fbag_difference(s));
1664 result.push_back(sort_bag::fbag2fset(s));
1665 result.push_back(sort_bag::fset2fbag(s));
1666 return result;
1667 }
1668
1669
1670 // 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
1671 typedef std::map<function_symbol,std::pair<std::function<void(data_expression&, const data_expression&)>, std::string> > implementation_map;
1675 inline
1676 implementation_map bag_cpp_implementable_mappings(const sort_expression& s)
1677 {
1678 implementation_map result;
1679 static_cast< void >(s); // suppress unused variable warnings
1680 return result;
1681 }
1687 inline
1688 const data_expression& left(const data_expression& e)
1689 {
1691 return atermpp::down_cast<application>(e)[0];
1692 }
1693
1699 inline
1700 const data_expression& right(const data_expression& e)
1701 {
1703 return atermpp::down_cast<application>(e)[1];
1704 }
1705
1711 inline
1712 const data_expression& arg(const data_expression& e)
1713 {
1715 return atermpp::down_cast<application>(e)[0];
1716 }
1717
1723 inline
1724 const data_expression& arg1(const data_expression& e)
1725 {
1727 return atermpp::down_cast<application>(e)[0];
1728 }
1729
1735 inline
1736 const data_expression& arg2(const data_expression& e)
1737 {
1739 return atermpp::down_cast<application>(e)[1];
1740 }
1741
1747 inline
1748 const data_expression& arg3(const data_expression& e)
1749 {
1751 return atermpp::down_cast<application>(e)[2];
1752 }
1753
1759 inline
1760 const data_expression& arg4(const data_expression& e)
1761 {
1763 return atermpp::down_cast<application>(e)[3];
1764 }
1765
1769 inline
1770 data_equation_vector bag_generate_equations_code(const sort_expression& s)
1771 {
1772 variable vb("b",sort_fbag::fbag(s));
1773 variable vc("c",sort_fbag::fbag(s));
1774 variable vd("d",s);
1775 variable ve("e",s);
1776 variable vf("f",make_function_sort_(s, sort_nat::nat()));
1777 variable vg("g",make_function_sort_(s, sort_nat::nat()));
1778 variable vh("h",make_function_sort_(s, sort_bool::bool_()));
1779 variable vp("p",sort_pos::pos());
1780 variable vq("q",sort_pos::pos());
1781 variable vs("s",sort_fset::fset(s));
1782 variable vx("x",bag(s));
1783 variable vy("y",bag(s));
1784
1785 data_equation_vector result;
1786 result.push_back(data_equation(variable_list({vb}), bag_fbag(s, vb), constructor(s, zero_function(s), vb)));
1787 result.push_back(data_equation(variable_list({vf}), sort_bag::bag_comprehension(s, vf), constructor(s, vf, sort_fbag::empty(s))));
1788 result.push_back(data_equation(variable_list({vb, ve, vf}), count(s, ve, constructor(s, vf, vb)), sort_nat::swap_zero(vf(ve), count(s, ve, vb))));
1789 result.push_back(data_equation(variable_list({ve, vx}), in(s, ve, vx), greater(count(s, ve, vx), sort_nat::c0())));
1790 result.push_back(data_equation(variable_list({vb, vc, vf, vg}), equal_to(constructor(s, vf, vb), constructor(s, vg, vc)), if_(equal_to(vf, vg), equal_to(vb, vc), forall(variable_list({vd}), equal_to(count(s, vd, constructor(s, vf, vb)), count(s, vd, constructor(s, vg, vc)))))));
1791 result.push_back(data_equation(variable_list({vx, vy}), less(vx, vy), sort_bool::and_(less_equal(vx, vy), not_equal_to(vx, vy))));
1792 result.push_back(data_equation(variable_list({vx, vy}), less_equal(vx, vy), equal_to(intersection(s, vx, vy), vx)));
1793 result.push_back(data_equation(variable_list({vb, vc, vf, vg}), union_(s, constructor(s, vf, vb), constructor(s, vg, vc)), constructor(s, add_function(s, vf, vg), join(s, vf, vg, vb, vc))));
1794 result.push_back(data_equation(variable_list({vx}), intersection(s, vx, vx), vx));
1795 result.push_back(data_equation(variable_list({vx, vy}), intersection(s, vx, intersection(s, vx, vy)), intersection(s, vx, vy)));
1796 result.push_back(data_equation(variable_list({vx, vy}), intersection(s, vx, intersection(s, vy, vx)), intersection(s, vy, vx)));
1797 result.push_back(data_equation(variable_list({vx, vy}), intersection(s, intersection(s, vx, vy), vx), intersection(s, vx, vy)));
1798 result.push_back(data_equation(variable_list({vx, vy}), intersection(s, intersection(s, vy, vx), vx), intersection(s, vy, vx)));
1799 result.push_back(data_equation(variable_list({vb, vc, vf, vg}), intersection(s, constructor(s, vf, vb), constructor(s, vg, vc)), constructor(s, min_function(s, vf, vg), fbag_intersect(s, vf, vg, vb, vc))));
1800 result.push_back(data_equation(variable_list({vx}), intersection(s, sort_fbag::empty(s), vx), sort_fbag::empty(s)));
1801 result.push_back(data_equation(variable_list({vb, vd, vp, vx}), intersection(s, sort_fbag::cons_(s, vd, vp, vb), vx), if_(in(s, vd, vx), sort_fbag::cons_(s, vd, sort_nat::minimum(vp, sort_nat::nat2pos(count(s, vd, vx))), intersection(s, vb, vx)), intersection(s, vb, vx))));
1802 result.push_back(data_equation(variable_list({vb, vx}), intersection(s, vx, vb), intersection(s, vb, vx)));
1803 result.push_back(data_equation(variable_list({vb, vc, vf, vg}), difference(s, constructor(s, vf, vb), constructor(s, vg, vc)), constructor(s, monus_function(s, vf, vg), fbag_difference(s, vf, vg, vb, vc))));
1804 result.push_back(data_equation(variable_list({vx}), difference(s, sort_fbag::empty(s), vx), sort_fbag::empty(s)));
1805 result.push_back(data_equation(variable_list({vb, vd, vp, vx}), difference(s, sort_fbag::cons_(s, vd, vp, vb), vx), if_(greater(sort_nat::pos2nat(vp), count(s, vd, vx)), sort_fbag::cons_(s, vd, sort_nat::nat2pos(sort_nat::monus(sort_nat::pos2nat(vp), count(s, vd, vx))), difference(s, vb, vx)), difference(s, vb, vx))));
1806 result.push_back(data_equation(variable_list({vb, vf}), bag2set(s, constructor(s, vf, vb)), sort_set::constructor(s, nat2bool_function(s, vf), fbag2fset(s, vf, vb))));
1807 result.push_back(data_equation(variable_list({vh, vs}), set2bag(s, sort_set::constructor(s, vh, vs)), constructor(s, bool2nat_function(s, vh), fset2fbag(s, vs))));
1808 result.push_back(data_equation(variable_list({ve}), zero_function(s, ve), sort_nat::c0()));
1809 result.push_back(data_equation(variable_list({ve}), one_function(s, ve), sort_nat::most_significant_digit_nat(sort_machine_word::one_word())));
1810 result.push_back(data_equation(variable_list(), equal_to(zero_function(s), one_function(s)), sort_bool::false_()));
1811 result.push_back(data_equation(variable_list(), equal_to(one_function(s), zero_function(s)), sort_bool::false_()));
1812 result.push_back(data_equation(variable_list({ve, vf, vg}), add_function(s, vf, vg)(ve), sort_nat::auxiliary_plus_nat(vf(ve), vg(ve))));
1813 result.push_back(data_equation(variable_list({vf}), add_function(s, vf, zero_function(s)), vf));
1814 result.push_back(data_equation(variable_list({vf}), add_function(s, zero_function(s), vf), vf));
1815 result.push_back(data_equation(variable_list({ve, vf, vg}), min_function(s, vf, vg)(ve), sort_nat::minimum(vf(ve), vg(ve))));
1816 result.push_back(data_equation(variable_list({vf}), min_function(s, vf, vf), vf));
1817 result.push_back(data_equation(variable_list({vf}), min_function(s, vf, zero_function(s)), zero_function(s)));
1818 result.push_back(data_equation(variable_list({vf}), min_function(s, zero_function(s), vf), zero_function(s)));
1819 result.push_back(data_equation(variable_list({ve, vf, vg}), monus_function(s, vf, vg)(ve), sort_nat::monus(vf(ve), vg(ve))));
1820 result.push_back(data_equation(variable_list({vf}), monus_function(s, vf, vf), zero_function(s)));
1821 result.push_back(data_equation(variable_list({vf}), monus_function(s, vf, zero_function(s)), vf));
1822 result.push_back(data_equation(variable_list({vf}), monus_function(s, zero_function(s), vf), zero_function(s)));
1823 result.push_back(data_equation(variable_list({ve, vf}), nat2bool_function(s, vf)(ve), greater(vf(ve), sort_nat::c0())));
1824 result.push_back(data_equation(variable_list(), nat2bool_function(s, zero_function(s)), sort_set::false_function(s)));
1825 result.push_back(data_equation(variable_list(), nat2bool_function(s, one_function(s)), sort_set::true_function(s)));
1826 result.push_back(data_equation(variable_list({ve, vh}), bool2nat_function(s, vh)(ve), if_(vh(ve), sort_nat::most_significant_digit_nat(sort_machine_word::one_word()), sort_nat::c0())));
1827 result.push_back(data_equation(variable_list(), bool2nat_function(s, sort_set::false_function(s)), zero_function(s)));
1828 result.push_back(data_equation(variable_list(), bool2nat_function(s, sort_set::true_function(s)), one_function(s)));
1829 result.push_back(data_equation(variable_list({vf, vg}), join(s, vf, vg, sort_fbag::empty(s), sort_fbag::empty(s)), sort_fbag::empty(s)));
1830 result.push_back(data_equation(variable_list({vb, vd, vf, vg, vp}), join(s, vf, vg, sort_fbag::cons_(s, vd, vp, vb), sort_fbag::empty(s)), sort_fbag::cinsert(s, vd, sort_nat::swap_zero_add(vf(vd), vg(vd), sort_nat::pos2nat(vp), sort_nat::c0()), join(s, vf, vg, vb, sort_fbag::empty(s)))));
1831 result.push_back(data_equation(variable_list({vc, ve, vf, vg, vq}), join(s, vf, vg, sort_fbag::empty(s), sort_fbag::cons_(s, ve, vq, vc)), sort_fbag::cinsert(s, ve, sort_nat::swap_zero_add(vf(ve), vg(ve), sort_nat::c0(), sort_nat::pos2nat(vq)), join(s, vf, vg, sort_fbag::empty(s), vc))));
1832 result.push_back(data_equation(variable_list({vb, vc, vd, vf, vg, vp, vq}), join(s, vf, vg, sort_fbag::cons_(s, vd, vp, vb), sort_fbag::cons_(s, vd, vq, vc)), sort_fbag::cinsert(s, vd, sort_nat::swap_zero_add(vf(vd), vg(vd), sort_nat::pos2nat(vp), sort_nat::pos2nat(vq)), join(s, vf, vg, vb, vc))));
1833 result.push_back(data_equation(variable_list({vb, vc, vd, ve, vf, vg, vp, vq}), less(vd, ve), join(s, vf, vg, sort_fbag::cons_(s, vd, vp, vb), sort_fbag::cons_(s, ve, vq, vc)), sort_fbag::cinsert(s, vd, sort_nat::swap_zero_add(vf(vd), vg(vd), sort_nat::pos2nat(vp), sort_nat::c0()), join(s, vf, vg, vb, sort_fbag::cons_(s, ve, vq, vc)))));
1834 result.push_back(data_equation(variable_list({vb, vc, vd, ve, vf, vg, vp, vq}), less(ve, vd), join(s, vf, vg, sort_fbag::cons_(s, vd, vp, vb), sort_fbag::cons_(s, ve, vq, vc)), sort_fbag::cinsert(s, ve, sort_nat::swap_zero_add(vf(ve), vg(ve), sort_nat::c0(), sort_nat::pos2nat(vq)), join(s, vf, vg, sort_fbag::cons_(s, vd, vp, vb), vc))));
1835 result.push_back(data_equation(variable_list({vf, vg}), fbag_intersect(s, vf, vg, sort_fbag::empty(s), sort_fbag::empty(s)), sort_fbag::empty(s)));
1836 result.push_back(data_equation(variable_list({vb, vd, vf, vg, vp}), fbag_intersect(s, vf, vg, sort_fbag::cons_(s, vd, vp, vb), sort_fbag::empty(s)), sort_fbag::cinsert(s, vd, sort_nat::swap_zero_min(vf(vd), vg(vd), sort_nat::pos2nat(vp), sort_nat::c0()), fbag_intersect(s, vf, vg, vb, sort_fbag::empty(s)))));
1837 result.push_back(data_equation(variable_list({vc, ve, vf, vg, vq}), fbag_intersect(s, vf, vg, sort_fbag::empty(s), sort_fbag::cons_(s, ve, vq, vc)), sort_fbag::cinsert(s, ve, sort_nat::swap_zero_min(vf(ve), vg(ve), sort_nat::c0(), sort_nat::pos2nat(vq)), fbag_intersect(s, vf, vg, sort_fbag::empty(s), vc))));
1838 result.push_back(data_equation(variable_list({vb, vc, vd, vf, vg, vp, vq}), fbag_intersect(s, vf, vg, sort_fbag::cons_(s, vd, vp, vb), sort_fbag::cons_(s, vd, vq, vc)), sort_fbag::cinsert(s, vd, sort_nat::swap_zero_min(vf(vd), vg(vd), sort_nat::pos2nat(vp), sort_nat::pos2nat(vq)), fbag_intersect(s, vf, vg, vb, vc))));
1839 result.push_back(data_equation(variable_list({vb, vc, vd, ve, vf, vg, vp, vq}), less(vd, ve), fbag_intersect(s, vf, vg, sort_fbag::cons_(s, vd, vp, vb), sort_fbag::cons_(s, ve, vq, vc)), sort_fbag::cinsert(s, vd, sort_nat::swap_zero_min(vf(vd), vg(vd), sort_nat::pos2nat(vp), sort_nat::c0()), fbag_intersect(s, vf, vg, vb, sort_fbag::cons_(s, ve, vq, vc)))));
1840 result.push_back(data_equation(variable_list({vb, vc, vd, ve, vf, vg, vp, vq}), less(ve, vd), fbag_intersect(s, vf, vg, sort_fbag::cons_(s, vd, vp, vb), sort_fbag::cons_(s, ve, vq, vc)), sort_fbag::cinsert(s, ve, sort_nat::swap_zero_min(vf(ve), vg(ve), sort_nat::c0(), sort_nat::pos2nat(vq)), fbag_intersect(s, vf, vg, sort_fbag::cons_(s, vd, vp, vb), vc))));
1841 result.push_back(data_equation(variable_list({vf, vg}), fbag_difference(s, vf, vg, sort_fbag::empty(s), sort_fbag::empty(s)), sort_fbag::empty(s)));
1842 result.push_back(data_equation(variable_list({vb, vd, vf, vg, vp}), fbag_difference(s, vf, vg, sort_fbag::cons_(s, vd, vp, vb), sort_fbag::empty(s)), sort_fbag::cinsert(s, vd, sort_nat::swap_zero_monus(vf(vd), vg(vd), sort_nat::pos2nat(vp), sort_nat::c0()), fbag_difference(s, vf, vg, vb, sort_fbag::empty(s)))));
1843 result.push_back(data_equation(variable_list({vc, ve, vf, vg, vq}), fbag_difference(s, vf, vg, sort_fbag::empty(s), sort_fbag::cons_(s, ve, vq, vc)), sort_fbag::cinsert(s, ve, sort_nat::swap_zero_monus(vf(ve), vg(ve), sort_nat::c0(), sort_nat::pos2nat(vq)), fbag_difference(s, vf, vg, sort_fbag::empty(s), vc))));
1844 result.push_back(data_equation(variable_list({vb, vc, vd, vf, vg, vp, vq}), fbag_difference(s, vf, vg, sort_fbag::cons_(s, vd, vp, vb), sort_fbag::cons_(s, vd, vq, vc)), sort_fbag::cinsert(s, vd, sort_nat::swap_zero_monus(vf(vd), vg(vd), sort_nat::pos2nat(vp), sort_nat::pos2nat(vq)), fbag_difference(s, vf, vg, vb, vc))));
1845 result.push_back(data_equation(variable_list({vb, vc, vd, ve, vf, vg, vp, vq}), less(vd, ve), fbag_difference(s, vf, vg, sort_fbag::cons_(s, vd, vp, vb), sort_fbag::cons_(s, ve, vq, vc)), sort_fbag::cinsert(s, vd, sort_nat::swap_zero_monus(vf(vd), vg(vd), sort_nat::pos2nat(vp), sort_nat::c0()), fbag_difference(s, vf, vg, vb, sort_fbag::cons_(s, ve, vq, vc)))));
1846 result.push_back(data_equation(variable_list({vb, vc, vd, ve, vf, vg, vp, vq}), less(ve, vd), fbag_difference(s, vf, vg, sort_fbag::cons_(s, vd, vp, vb), sort_fbag::cons_(s, ve, vq, vc)), sort_fbag::cinsert(s, ve, sort_nat::swap_zero_monus(vf(ve), vg(ve), sort_nat::c0(), sort_nat::pos2nat(vq)), fbag_difference(s, vf, vg, sort_fbag::cons_(s, vd, vp, vb), vc))));
1847 result.push_back(data_equation(variable_list({vf}), fbag2fset(s, vf, sort_fbag::empty(s)), sort_fset::empty(s)));
1848 result.push_back(data_equation(variable_list({vb, vd, vf, vp}), fbag2fset(s, vf, sort_fbag::cons_(s, vd, vp, vb)), sort_fset::cinsert(s, vd, equal_to(equal_to(vf(vd), sort_nat::pos2nat(vp)), greater(vf(vd), sort_nat::c0())), fbag2fset(s, vf, vb))));
1849 result.push_back(data_equation(variable_list(), fset2fbag(s, sort_fset::empty(s)), sort_fbag::empty(s)));
1850 result.push_back(data_equation(variable_list({vd, vs}), fset2fbag(s, sort_fset::cons_(s, vd, vs)), sort_fbag::cinsert(s, vd, sort_nat::pos2nat(sort_pos::c1()), fset2fbag(s, vs))));
1851 return result;
1852 }
1853
1854 } // namespace sort_bag
1855
1856 } // namespace data
1857
1858} // namespace mcrl2
1859
1860#endif // MCRL2_DATA_BAG64_H
The class application.
The class basic_sort.
Term containing a string.
size_type size() const
Returns the number of arguments of this term.
Definition aterm.h:151
An application of a data expression to a number of arguments.
sort_expression sort() const
Returns the sort of the data expression.
Definition data.cpp:108
\brief A function symbol
\brief A sort expression
Standard exception class for reporting runtime errors.
Definition exception.h:27
The class container_sort.
The class function symbol.
The class data_equation.
Exception classes for use in libraries and tools.
The class forall.
The class function_sort.
atermpp::aterm_string identifier_string
String type of the LPS library. Identifier strings are represented internally as ATerms.
function_symbol fbag2fset(const sort_expression &s)
Constructor for function symbol @fbag2fset.
Definition bag1.h:1475
bool is_bag2set_application(const atermpp::aterm &e)
Recogniser for application of Bag2Set.
Definition bag1.h:751
bool is_intersection_function_symbol(const atermpp::aterm &e)
Recogniser for function *.
Definition bag1.h:559
void make_bool2nat_function(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol @Bool2Nat_.
Definition bag1.h:1243
const core::identifier_string & fbag2fset_name()
Generate identifier @fbag2fset.
Definition bag1.h:1465
const data_expression & right(const data_expression &e)
Function for projecting out argument. right from an application.
Definition bag1.h:1636
bool is_min_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @min_.
Definition bag1.h:1029
function_symbol bag_fbag(const sort_expression &s)
Constructor for function symbol @bagfbag.
Definition bag1.h:176
bool is_min_function_application(const atermpp::aterm &e)
Recogniser for application of @min_.
Definition bag1.h:1065
function_symbol monus_function(const sort_expression &s)
Constructor for function symbol @monus_.
Definition bag1.h:1083
const core::identifier_string & fbag_intersect_name()
Generate identifier @fbag_inter.
Definition bag1.h:1329
void make_bag2set(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol Bag2Set.
Definition bag1.h:741
bool is_fbag_difference_function_symbol(const atermpp::aterm &e)
Recogniser for function @fbag_diff.
Definition bag1.h:1417
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 bag1.h:336
const core::identifier_string & join_name()
Generate identifier @fbag_join.
Definition bag64.h:1261
function_symbol_vector bag_generate_functions_code(const sort_expression &s)
Give all system defined mappings for bag.
Definition bag1.h:1529
function_symbol fset2fbag(const sort_expression &s)
Constructor for function symbol @fset2fbag.
Definition bag64.h:1539
const core::identifier_string & bool2nat_function_name()
Generate identifier @Bool2Nat_.
Definition bag1.h:1199
void make_one_function(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol @one_.
Definition bag1.h:927
const data_expression & arg3(const data_expression &e)
Function for projecting out argument. arg3 from an application.
Definition bag1.h:1684
bool is_difference_application(const atermpp::aterm &e)
Recogniser for application of -.
Definition bag1.h:689
function_symbol difference(const sort_expression &s, const sort_expression &s0, const sort_expression &s1)
Definition bag1.h:612
const core::identifier_string & set2bag_name()
Generate identifier Set2Bag.
Definition bag1.h:759
bool is_bag_fbag_application(const atermpp::aterm &e)
Recogniser for application of @bagfbag.
Definition bag1.h:220
function_symbol_vector bag_generate_constructors_and_functions_code(const sort_expression &s)
Give all system defined mappings and constructors for bag.
Definition bag1.h:1562
void make_add_function(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @add_.
Definition bag1.h:991
data_equation_vector bag_generate_equations_code(const sort_expression &s)
Give all system defined equations for bag.
Definition bag1.h:1706
const core::identifier_string & fset2fbag_name()
Generate identifier @fset2fbag.
Definition bag64.h:1529
bool is_fbag_difference_application(const atermpp::aterm &e)
Recogniser for application of @fbag_diff.
Definition bag1.h:1457
bool is_bag_fbag_function_symbol(const atermpp::aterm &e)
Recogniser for function @bagfbag.
Definition bag1.h:186
const core::identifier_string & zero_function_name()
Generate identifier @zero_.
Definition bag1.h:821
const core::identifier_string & add_function_name()
Generate identifier @add_.
Definition bag1.h:945
function_symbol_vector bag_mCRL2_usable_constructors(const sort_expression &s)
Give all defined constructors which can be used in mCRL2 specs for bag.
Definition bag1.h:143
bool is_fbag2fset_function_symbol(const atermpp::aterm &e)
Recogniser for function @fbag2fset.
Definition bag1.h:1485
bool is_union_application(const atermpp::aterm &e)
Recogniser for application of +.
Definition bag1.h:495
function_symbol bag2set(const sort_expression &s)
Constructor for function symbol Bag2Set.
Definition bag1.h:707
bool is_monus_function_application(const atermpp::aterm &e)
Recogniser for application of @monus_.
Definition bag1.h:1129
const core::identifier_string & nat2bool_function_name()
Generate identifier @Nat2Bool_.
Definition bag1.h:1137
function_symbol intersection(const sort_expression &s, const sort_expression &s0, const sort_expression &s1)
Definition bag1.h:511
bool is_zero_function_application(const atermpp::aterm &e)
Recogniser for application of @zero_.
Definition bag1.h:875
const core::identifier_string & fbag_difference_name()
Generate identifier @fbag_diff.
Definition bag1.h:1397
void make_monus_function(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @monus_.
Definition bag1.h:1119
implementation_map bag_cpp_implementable_mappings(const sort_expression &s)
Give all system defined mappings that are to be implemented in C++ code for bag.
Definition bag1.h:1612
bool is_count_function_symbol(const atermpp::aterm &e)
Recogniser for function count.
Definition bag1.h:309
function_symbol count(const sort_expression &, const sort_expression &s0, const sort_expression &s1)
Definition bag1.h:298
implementation_map bag_cpp_implementable_constructors(const sort_expression &s)
Give all system defined constructors which have an implementation in C++ and not in rewrite rules for...
Definition bag1.h:156
function_symbol add_function(const sort_expression &s)
Constructor for function symbol @add_.
Definition bag1.h:955
bool is_nat2bool_function_application(const atermpp::aterm &e)
Recogniser for application of @Nat2Bool_.
Definition bag1.h:1191
function_symbol fbag_intersect(const sort_expression &s)
Constructor for function symbol @fbag_inter.
Definition bag1.h:1339
void make_fbag_intersect(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2, const data_expression &arg3)
Make an application of function symbol @fbag_inter.
Definition bag1.h:1379
bool is_union_function_symbol(const atermpp::aterm &e)
Recogniser for function +.
Definition bag1.h:458
void make_nat2bool_function(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol @Nat2Bool_.
Definition bag1.h:1181
bool is_fbag_intersect_application(const atermpp::aterm &e)
Recogniser for application of @fbag_inter.
Definition bag1.h:1389
bool is_in_application(const atermpp::aterm &e)
Recogniser for application of in.
Definition bag1.h:410
function_symbol fbag_difference(const sort_expression &s)
Constructor for function symbol @fbag_diff.
Definition bag1.h:1407
bool is_in_function_symbol(const atermpp::aterm &e)
Recogniser for function in.
Definition bag1.h:373
bool is_bag_comprehension_function_symbol(const atermpp::aterm &e)
Recogniser for function @bagcomp.
Definition bag1.h:248
void make_min_function(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @min_.
Definition bag1.h:1055
const core::identifier_string & min_function_name()
Generate identifier @min_.
Definition bag1.h:1009
bool is_set2bag_function_symbol(const atermpp::aterm &e)
Recogniser for function Set2Bag.
Definition bag1.h:779
const data_expression & left(const data_expression &e)
Function for projecting out argument. left from an application.
Definition bag1.h:1624
function_symbol_vector bag_mCRL2_usable_mappings(const sort_expression &s)
Give all system defined mappings that can be used in mCRL2 specs for bag.
Definition bag1.h:1576
bool is_nat2bool_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @Nat2Bool_.
Definition bag1.h:1157
const core::identifier_string & monus_function_name()
Generate identifier @monus_.
Definition bag1.h:1073
const data_expression & arg4(const data_expression &e)
Function for projecting out argument. arg4 from an application.
Definition bag1.h:1696
bool is_add_function_application(const atermpp::aterm &e)
Recogniser for application of @add_.
Definition bag1.h:1001
void make_fbag2fset(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @fbag2fset.
Definition bag1.h:1511
function_symbol min_function(const sort_expression &s)
Constructor for function symbol @min_.
Definition bag1.h:1019
function_symbol set2bag(const sort_expression &s)
Constructor for function symbol Set2Bag.
Definition bag1.h:769
const core::identifier_string & bag_fbag_name()
Generate identifier @bagfbag.
Definition bag1.h:166
const core::identifier_string & bag2set_name()
Generate identifier Bag2Set.
Definition bag1.h:697
const core::identifier_string & intersection_name()
Generate identifier *.
Definition bag1.h:503
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 bag1.h:400
bool is_fset2fbag_function_symbol(const atermpp::aterm &e)
Recogniser for function @fset2fbag.
Definition bag64.h:1549
function_symbol bag_comprehension(const sort_expression &s)
Constructor for function symbol @bagcomp.
Definition bag1.h:238
bool is_bag2set_function_symbol(const atermpp::aterm &e)
Recogniser for function Bag2Set.
Definition bag1.h:717
bool is_bool2nat_function_application(const atermpp::aterm &e)
Recogniser for application of @Bool2Nat_.
Definition bag1.h:1253
bool is_join_function_symbol(const atermpp::aterm &e)
Recogniser for function @fbag_join.
Definition bag64.h:1281
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 bag1.h:586
bool is_fset2fbag_application(const atermpp::aterm &e)
Recogniser for application of @fset2fbag.
Definition bag64.h:1583
function_symbol join(const sort_expression &s)
Constructor for function symbol @fbag_join.
Definition bag64.h:1271
bool is_constructor_application(const atermpp::aterm &e)
Recogniser for application of @bag.
Definition bag1.h:124
bool is_zero_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @zero_.
Definition bag1.h:841
function_symbol constructor(const sort_expression &s)
Constructor for function symbol @bag.
Definition bag1.h:78
const data_expression & arg2(const data_expression &e)
Function for projecting out argument. arg2 from an application.
Definition bag1.h:1672
const core::identifier_string & constructor_name()
Generate identifier @bag.
Definition bag1.h:68
bool is_bag_comprehension_application(const atermpp::aterm &e)
Recogniser for application of @bagcomp.
Definition bag1.h:282
bool is_set2bag_application(const atermpp::aterm &e)
Recogniser for application of Set2Bag.
Definition bag1.h:813
function_symbol in(const sort_expression &, const sort_expression &s0, const sort_expression &s1)
Definition bag1.h:362
void make_zero_function(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol @zero_.
Definition bag1.h:865
const data_expression & arg1(const data_expression &e)
Function for projecting out argument. arg1 from an application.
Definition bag1.h:1660
void make_bag_fbag(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol @bagfbag.
Definition bag1.h:210
function_symbol bool2nat_function(const sort_expression &s)
Constructor for function symbol @Bool2Nat_.
Definition bag1.h:1209
void make_set2bag(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol Set2Bag.
Definition bag1.h:803
const core::identifier_string & union_name()
Generate identifier +.
Definition bag1.h:418
bool is_fbag_intersect_function_symbol(const atermpp::aterm &e)
Recogniser for function @fbag_inter.
Definition bag1.h:1349
function_symbol union_(const sort_expression &s, const sort_expression &s0, const sort_expression &s1)
Definition bag1.h:426
bool is_intersection_application(const atermpp::aterm &e)
Recogniser for application of *.
Definition bag1.h:596
void make_bag_comprehension(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol @bagcomp.
Definition bag1.h:272
const data_expression & arg(const data_expression &e)
Function for projecting out argument. arg from an application.
Definition bag1.h:1648
void make_join(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2, const data_expression &arg3)
Make an application of function symbol @fbag_join.
Definition bag64.h:1311
void make_fbag_difference(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2, const data_expression &arg3)
Make an application of function symbol @fbag_diff.
Definition bag1.h:1447
const core::identifier_string & count_name()
Generate identifier count.
Definition bag1.h:290
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 bag1.h:485
function_symbol nat2bool_function(const sort_expression &s)
Constructor for function symbol @Nat2Bool_.
Definition bag1.h:1147
bool is_one_function_application(const atermpp::aterm &e)
Recogniser for application of @one_.
Definition bag1.h:937
const core::identifier_string & difference_name()
Generate identifier -.
Definition bag1.h:604
bool is_bool2nat_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @Bool2Nat_.
Definition bag1.h:1219
bool is_bag(const sort_expression &e)
Recogniser for sort expression Bag(s)
Definition bag1.h:55
container_sort bag(const sort_expression &s)
Constructor for sort expression Bag(S)
Definition bag1.h:44
bool is_difference_function_symbol(const atermpp::aterm &e)
Recogniser for function -.
Definition bag1.h:652
bool is_fbag2fset_application(const atermpp::aterm &e)
Recogniser for application of @fbag2fset.
Definition bag1.h:1521
bool is_join_application(const atermpp::aterm &e)
Recogniser for application of @fbag_join.
Definition bag64.h:1321
std::map< function_symbol, std::pair< std::function< void(data_expression &, const data_expression &)>, std::string > > implementation_map
Definition bag1.h:151
const core::identifier_string & in_name()
Generate identifier in.
Definition bag1.h:354
bool is_constructor_function_symbol(const atermpp::aterm &e)
Recogniser for function @bag.
Definition bag1.h:88
const core::identifier_string & bag_comprehension_name()
Generate identifier @bagcomp.
Definition bag1.h:228
bool is_count_application(const atermpp::aterm &e)
Recogniser for application of count.
Definition bag1.h:346
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 bag1.h:679
const core::identifier_string & one_function_name()
Generate identifier @one_.
Definition bag1.h:883
bool is_add_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @add_.
Definition bag1.h:965
void make_constructor(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @bag.
Definition bag1.h:114
function_symbol zero_function(const sort_expression &s)
Constructor for function symbol @zero_.
Definition bag1.h:831
bool is_one_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @one_.
Definition bag1.h:903
function_symbol one_function(const sort_expression &s)
Constructor for function symbol @one_.
Definition bag1.h:893
void make_fset2fbag(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol @fset2fbag.
Definition bag64.h:1573
function_symbol_vector bag_generate_constructors_code(const sort_expression &s)
Give all system defined constructors for bag.
Definition bag1.h:132
bool is_monus_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @monus_.
Definition bag1.h:1093
const basic_sort & bool_()
Constructor for sort expression Bool.
Definition bool.h:44
const function_symbol & and_()
Constructor for function symbol &&.
Definition bool.h:235
const function_symbol & false_()
Constructor for function symbol false.
Definition bool.h:109
container_sort fbag(const sort_expression &s)
Constructor for sort expression FBag(S)
Definition fbag1.h:43
function_symbol cons_(const sort_expression &s)
Constructor for function symbol @fbag_cons.
Definition fbag1.h:211
function_symbol empty(const sort_expression &s)
Constructor for function symbol {:}.
Definition fbag1.h:77
function_symbol cinsert(const sort_expression &s)
Constructor for function symbol @fbag_cinsert.
Definition fbag1.h:277
function_symbol cinsert(const sort_expression &s)
Constructor for function symbol @fset_cinsert.
Definition fset1.h:271
function_symbol cons_(const sort_expression &s)
Constructor for function symbol @fset_cons.
Definition fset1.h:207
function_symbol empty(const sort_expression &s)
Constructor for function symbol {}.
Definition fset1.h:75
container_sort fset(const sort_expression &s)
Constructor for sort expression FSet(S)
Definition fset1.h:41
function_symbol head(const sort_expression &s)
Constructor for function symbol head.
Definition list1.h:526
const function_symbol & one_word()
Constructor for function symbol @one_word.
const function_symbol & monus()
Constructor for function symbol @monus.
Definition nat1.h:1331
const function_symbol & c0()
Constructor for function symbol @c0.
Definition nat1.h:108
const function_symbol & swap_zero_add()
Constructor for function symbol @swap_zero_add.
Definition nat1.h:1459
const basic_sort & nat()
Constructor for sort expression Nat.
Definition nat1.h:46
const function_symbol & swap_zero()
Constructor for function symbol @swap_zero.
Definition nat1.h:1395
const function_symbol & swap_zero_min()
Constructor for function symbol @swap_zero_min.
Definition nat1.h:1527
function_symbol minimum(const sort_expression &s0, const sort_expression &s1)
Definition nat1.h:507
const function_symbol & swap_zero_monus()
Constructor for function symbol @swap_zero_monus.
Definition nat1.h:1595
const function_symbol & nat2pos()
Constructor for function symbol Nat2Pos.
Definition nat1.h:362
const function_symbol & most_significant_digit_nat()
Constructor for function symbol @most_significant_digitNat.
Definition nat64.h:301
const function_symbol & auxiliary_plus_nat()
Constructor for function symbol @plus_nat.
Definition nat64.h:1260
const function_symbol & pos2nat()
Constructor for function symbol Pos2Nat.
Definition nat1.h:300
const function_symbol & c1()
Constructor for function symbol @c1.
Definition pos1.h:78
const basic_sort & pos()
Constructor for sort expression Pos.
Definition pos1.h:45
function_symbol true_function(const sort_expression &s)
Constructor for function symbol @true_.
Definition set1.h:729
container_sort set_(const sort_expression &s)
Constructor for sort expression Set(S)
Definition set1.h:42
function_symbol constructor(const sort_expression &s)
Constructor for function symbol @set.
Definition set1.h:76
function_symbol false_function(const sort_expression &s)
Constructor for function symbol @false_.
Definition set1.h:667
function_symbol less_equal(const sort_expression &s)
Constructor for function symbol <=.
Definition standard.h:277
function_symbol not_equal_to(const sort_expression &s)
Constructor for function symbol !=.
Definition standard.h:163
function_symbol less(const sort_expression &s)
Constructor for function symbol <.
Definition standard.h:240
std::vector< data_equation > data_equation_vector
\brief vector of data_equations
function_sort make_function_sort_(const sort_expression &dom1, const sort_expression &codomain)
Convenience constructor for function sort with domain size 1.
std::string pp(const abstraction &x)
Definition data.cpp:39
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.
atermpp::term_list< variable > variable_list
\brief list of variables
function_symbol equal_to(const sort_expression &s)
Constructor for function symbol ==.
Definition standard.h:126
bool is_application(const atermpp::aterm &x)
Returns true if the term t is an application.
std::vector< function_symbol > function_symbol_vector
\brief vector of function_symbols
function_symbol if_(const sort_expression &s)
Constructor for function symbol if.
Definition standard.h:200
void make_application(atermpp::aterm &result)
Make function for an application.
function_symbol greater(const sort_expression &s)
Constructor for function symbol >
Definition standard.h:314
data::sort_expression target_sort(const data::sort_expression &s)
Definition absinthe.h:101
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
Standard functions that are available for all sorts.