mCRL2
Loading...
Searching...
No Matches
bag1.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_BAG1_H
16#define MCRL2_DATA_BAG1_H
17
18#include "functional" // std::function
25#include "mcrl2/data/standard.h"
26#include "mcrl2/data/forall.h"
28#include "mcrl2/data/nat1.h"
29#include "mcrl2/data/fbag1.h"
30#include "mcrl2/data/fset1.h"
31#include "mcrl2/data/set1.h"
32
33namespace mcrl2 {
34
35 namespace data {
36
38 namespace sort_bag {
39
43 inline
45 {
47 return bag;
48 }
49
54 inline
55 bool is_bag(const sort_expression& e)
56 {
57 if (is_container_sort(e))
58 {
60 }
61 return false;
62 }
63
64
67 inline
69 {
71 return constructor_name;
72 }
73
77 inline
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
104 {
105 return sort_bag::constructor(s)(arg0, arg1);
106 }
107
113 inline
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
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
201 {
202 return sort_bag::bag_fbag(s)(arg0);
203 }
204
209 inline
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
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
263 {
264 return sort_bag::bag_comprehension(s)(arg0);
265 }
266
271 inline
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
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
326 {
327 return sort_bag::count(s, arg0.sort(), arg1.sort())(arg0, arg1);
328 }
329
335 inline
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
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
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
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
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 {
435 target_sort = sort_set::set_(s);
436 }
437 else if (s0 == sort_fset::fset(s) && s1 == sort_fset::fset(s))
438 {
439 target_sort = sort_fset::fset(s);
440 }
441 else if (s0 == sort_fbag::fbag(s) && s1 == sort_fbag::fbag(s))
442 {
443 target_sort = sort_fbag::fbag(s);
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
475 {
476 return sort_bag::union_(s, arg0.sort(), arg1.sort())(arg0, arg1);
477 }
478
484 inline
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
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 {
520 target_sort = sort_fbag::fbag(s);
521 }
522 else if (s0 == bag(s) && s1 == sort_fbag::fbag(s))
523 {
524 target_sort = sort_fbag::fbag(s);
525 }
526 else if (s0 == sort_set::set_(s) && s1 == sort_set::set_(s))
527 {
528 target_sort = sort_set::set_(s);
529 }
530 else if (s0 == sort_fset::fset(s) && s1 == sort_set::set_(s))
531 {
532 target_sort = sort_fset::fset(s);
533 }
534 else if (s0 == sort_set::set_(s) && s1 == sort_fset::fset(s))
535 {
536 target_sort = sort_fset::fset(s);
537 }
538 else if (s0 == sort_fset::fset(s) && s1 == sort_fset::fset(s))
539 {
540 target_sort = sort_fset::fset(s);
541 }
542 else if (s0 == sort_fbag::fbag(s) && s1 == sort_fbag::fbag(s))
543 {
544 target_sort = sort_fbag::fbag(s);
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
576 {
577 return sort_bag::intersection(s, arg0.sort(), arg1.sort())(arg0, arg1);
578 }
579
585 inline
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
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 {
621 target_sort = sort_fbag::fbag(s);
622 }
623 else if (s0 == sort_set::set_(s) && s1 == sort_set::set_(s))
624 {
625 target_sort = sort_set::set_(s);
626 }
627 else if (s0 == sort_fset::fset(s) && s1 == sort_set::set_(s))
628 {
629 target_sort = sort_fset::fset(s);
630 }
631 else if (s0 == sort_fset::fset(s) && s1 == sort_fset::fset(s))
632 {
633 target_sort = sort_fset::fset(s);
634 }
635 else if (s0 == sort_fbag::fbag(s) && s1 == sort_fbag::fbag(s))
636 {
637 target_sort = sort_fbag::fbag(s);
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
669 {
670 return sort_bag::difference(s, arg0.sort(), arg1.sort())(arg0, arg1);
671 }
672
678 inline
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
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
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
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
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
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
856 {
857 return sort_bag::zero_function(s)(arg0);
858 }
859
864 inline
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
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
918 {
919 return sort_bag::one_function(s)(arg0);
920 }
921
926 inline
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
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
981 {
982 return sort_bag::add_function(s)(arg0, arg1);
983 }
984
990 inline
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
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
1045 {
1046 return sort_bag::min_function(s)(arg0, arg1);
1047 }
1048
1054 inline
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
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
1109 {
1110 return sort_bag::monus_function(s)(arg0, arg1);
1111 }
1112
1118 inline
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
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
1172 {
1173 return sort_bag::nat2bool_function(s)(arg0);
1174 }
1175
1180 inline
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
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
1234 {
1235 return sort_bag::bool2nat_function(s)(arg0);
1236 }
1237
1242 inline
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 fbag_join_name;
1265 }
1266
1270 inline
1272 {
1274 return fbag_join;
1275 }
1276
1280 inline
1282 {
1283 if (is_function_symbol(e))
1284 {
1285 return atermpp::down_cast<function_symbol>(e).name() == fbag_join_name();
1286 }
1287 return false;
1288 }
1289
1297 inline
1299 {
1300 return sort_bag::fbag_join(s)(arg0, arg1, arg2, arg3);
1301 }
1302
1310 inline
1312 {
1314 }
1315
1320 inline
1322 {
1323 return is_application(e) && is_fbag_join_function_symbol(atermpp::down_cast<application>(e).head());
1324 }
1325
1328 inline
1330 {
1332 return fbag_intersect_name;
1333 }
1334
1338 inline
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
1367 {
1368 return sort_bag::fbag_intersect(s)(arg0, arg1, arg2, arg3);
1369 }
1370
1378 inline
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
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
1435 {
1436 return sort_bag::fbag_difference(s)(arg0, arg1, arg2, arg3);
1437 }
1438
1446 inline
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
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
1501 {
1502 return sort_bag::fbag2fset(s)(arg0, arg1);
1503 }
1504
1510 inline
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 }
1528 inline
1530 {
1532 result.push_back(sort_bag::bag_fbag(s));
1533 result.push_back(sort_bag::bag_comprehension(s));
1534 result.push_back(sort_bag::count(s, s, bag(s)));
1535 result.push_back(sort_bag::in(s, s, bag(s)));
1536 result.push_back(sort_bag::union_(s, bag(s), bag(s)));
1537 result.push_back(sort_bag::intersection(s, bag(s), bag(s)));
1538 result.push_back(sort_bag::intersection(s, sort_fbag::fbag(s), bag(s)));
1539 result.push_back(sort_bag::intersection(s, bag(s), sort_fbag::fbag(s)));
1540 result.push_back(sort_bag::difference(s, bag(s), bag(s)));
1541 result.push_back(sort_bag::difference(s, sort_fbag::fbag(s), bag(s)));
1542 result.push_back(sort_bag::bag2set(s));
1543 result.push_back(sort_bag::set2bag(s));
1544 result.push_back(sort_bag::zero_function(s));
1545 result.push_back(sort_bag::one_function(s));
1546 result.push_back(sort_bag::add_function(s));
1547 result.push_back(sort_bag::min_function(s));
1548 result.push_back(sort_bag::monus_function(s));
1549 result.push_back(sort_bag::nat2bool_function(s));
1550 result.push_back(sort_bag::bool2nat_function(s));
1551 result.push_back(sort_bag::fbag_join(s));
1552 result.push_back(sort_bag::fbag_intersect(s));
1553 result.push_back(sort_bag::fbag_difference(s));
1554 result.push_back(sort_bag::fbag2fset(s));
1555 return result;
1556 }
1557
1561 inline
1563 {
1566 {
1567 result.push_back(f);
1568 }
1569 return result;
1570 }
1571
1575 inline
1577 {
1579 result.push_back(sort_bag::bag_fbag(s));
1580 result.push_back(sort_bag::bag_comprehension(s));
1581 result.push_back(sort_bag::count(s, s, bag(s)));
1582 result.push_back(sort_bag::in(s, s, bag(s)));
1583 result.push_back(sort_bag::union_(s, bag(s), bag(s)));
1584 result.push_back(sort_bag::intersection(s, bag(s), bag(s)));
1585 result.push_back(sort_bag::intersection(s, sort_fbag::fbag(s), bag(s)));
1586 result.push_back(sort_bag::intersection(s, bag(s), sort_fbag::fbag(s)));
1587 result.push_back(sort_bag::difference(s, bag(s), bag(s)));
1588 result.push_back(sort_bag::difference(s, sort_fbag::fbag(s), bag(s)));
1589 result.push_back(sort_bag::bag2set(s));
1590 result.push_back(sort_bag::set2bag(s));
1591 result.push_back(sort_bag::zero_function(s));
1592 result.push_back(sort_bag::one_function(s));
1593 result.push_back(sort_bag::add_function(s));
1594 result.push_back(sort_bag::min_function(s));
1595 result.push_back(sort_bag::monus_function(s));
1596 result.push_back(sort_bag::nat2bool_function(s));
1597 result.push_back(sort_bag::bool2nat_function(s));
1598 result.push_back(sort_bag::fbag_join(s));
1599 result.push_back(sort_bag::fbag_intersect(s));
1600 result.push_back(sort_bag::fbag_difference(s));
1601 result.push_back(sort_bag::fbag2fset(s));
1602 return result;
1603 }
1604
1605
1606 // 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
1607 typedef std::map<function_symbol,std::pair<std::function<void(data_expression&, const data_expression&)>, std::string> > implementation_map;
1611 inline
1613 {
1614 implementation_map result;
1615 static_cast< void >(s); // suppress unused variable warnings
1616 return result;
1617 }
1623 inline
1625 {
1627 return atermpp::down_cast<application>(e)[0];
1628 }
1629
1635 inline
1637 {
1639 return atermpp::down_cast<application>(e)[1];
1640 }
1641
1647 inline
1649 {
1651 return atermpp::down_cast<application>(e)[0];
1652 }
1653
1659 inline
1661 {
1663 return atermpp::down_cast<application>(e)[0];
1664 }
1665
1671 inline
1673 {
1675 return atermpp::down_cast<application>(e)[1];
1676 }
1677
1683 inline
1685 {
1687 return atermpp::down_cast<application>(e)[2];
1688 }
1689
1695 inline
1697 {
1699 return atermpp::down_cast<application>(e)[3];
1700 }
1701
1705 inline
1707 {
1708 variable vb("b",sort_fbag::fbag(s));
1709 variable vc("c",sort_fbag::fbag(s));
1710 variable vd("d",s);
1711 variable ve("e",s);
1715 variable vp("p",sort_pos::pos());
1716 variable vq("q",sort_pos::pos());
1717 variable vs("s",sort_fset::fset(s));
1718 variable vx("x",bag(s));
1719 variable vy("y",bag(s));
1720
1721 data_equation_vector result;
1722 result.push_back(data_equation(variable_list({vb}), bag_fbag(s, vb), constructor(s, zero_function(s), vb)));
1723 result.push_back(data_equation(variable_list({vf}), sort_bag::bag_comprehension(s, vf), constructor(s, vf, sort_fbag::empty(s))));
1724 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))));
1725 result.push_back(data_equation(variable_list({ve, vx}), in(s, ve, vx), greater(count(s, ve, vx), sort_nat::c0())));
1726 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)))))));
1727 result.push_back(data_equation(variable_list({vx, vy}), less(vx, vy), sort_bool::and_(less_equal(vx, vy), not_equal_to(vx, vy))));
1728 result.push_back(data_equation(variable_list({vx, vy}), less_equal(vx, vy), equal_to(intersection(s, vx, vy), vx)));
1729 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), fbag_join(s, vf, vg, vb, vc))));
1730 result.push_back(data_equation(variable_list({vx}), intersection(s, vx, vx), vx));
1731 result.push_back(data_equation(variable_list({vx, vy}), intersection(s, vx, intersection(s, vx, vy)), intersection(s, vx, vy)));
1732 result.push_back(data_equation(variable_list({vx, vy}), intersection(s, vx, intersection(s, vy, vx)), intersection(s, vy, vx)));
1733 result.push_back(data_equation(variable_list({vx, vy}), intersection(s, intersection(s, vx, vy), vx), intersection(s, vx, vy)));
1734 result.push_back(data_equation(variable_list({vx, vy}), intersection(s, intersection(s, vy, vx), vx), intersection(s, vy, vx)));
1735 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))));
1736 result.push_back(data_equation(variable_list({vx}), intersection(s, sort_fbag::empty(s), vx), sort_fbag::empty(s)));
1737 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))));
1738 result.push_back(data_equation(variable_list({vb, vx}), intersection(s, vx, vb), intersection(s, vb, vx)));
1739 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))));
1740 result.push_back(data_equation(variable_list({vx}), difference(s, sort_fbag::empty(s), vx), sort_fbag::empty(s)));
1741 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))));
1742 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))));
1743 result.push_back(data_equation(variable_list({vh, vs}), set2bag(s, sort_set::constructor(s, vh, vs)), constructor(s, bool2nat_function(s, vh), sort_fbag::fset2fbag(s, vs))));
1744 result.push_back(data_equation(variable_list({ve}), zero_function(s, ve), sort_nat::c0()));
1745 result.push_back(data_equation(variable_list({ve}), one_function(s, ve), sort_nat::cnat(sort_pos::c1())));
1748 result.push_back(data_equation(variable_list({ve, vf, vg}), add_function(s, vf, vg)(ve), sort_nat::plus(vf(ve), vg(ve))));
1749 result.push_back(data_equation(variable_list({vf}), add_function(s, vf, zero_function(s)), vf));
1750 result.push_back(data_equation(variable_list({vf}), add_function(s, zero_function(s), vf), vf));
1751 result.push_back(data_equation(variable_list({ve, vf, vg}), min_function(s, vf, vg)(ve), sort_nat::minimum(vf(ve), vg(ve))));
1752 result.push_back(data_equation(variable_list({vf}), min_function(s, vf, vf), vf));
1753 result.push_back(data_equation(variable_list({vf}), min_function(s, vf, zero_function(s)), zero_function(s)));
1754 result.push_back(data_equation(variable_list({vf}), min_function(s, zero_function(s), vf), zero_function(s)));
1755 result.push_back(data_equation(variable_list({ve, vf, vg}), monus_function(s, vf, vg)(ve), sort_nat::monus(vf(ve), vg(ve))));
1756 result.push_back(data_equation(variable_list({vf}), monus_function(s, vf, vf), zero_function(s)));
1757 result.push_back(data_equation(variable_list({vf}), monus_function(s, vf, zero_function(s)), vf));
1758 result.push_back(data_equation(variable_list({vf}), monus_function(s, zero_function(s), vf), zero_function(s)));
1759 result.push_back(data_equation(variable_list({ve, vf}), nat2bool_function(s, vf)(ve), greater(vf(ve), sort_nat::c0())));
1762 result.push_back(data_equation(variable_list({ve, vh}), bool2nat_function(s, vh)(ve), if_(vh(ve), sort_nat::cnat(sort_pos::c1()), sort_nat::c0())));
1765 result.push_back(data_equation(variable_list({vf, vg}), fbag_join(s, vf, vg, sort_fbag::empty(s), sort_fbag::empty(s)), sort_fbag::empty(s)));
1766 result.push_back(data_equation(variable_list({vb, vd, vf, vg, vp}), fbag_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::cnat(vp), sort_nat::c0()), fbag_join(s, vf, vg, vb, sort_fbag::empty(s)))));
1767 result.push_back(data_equation(variable_list({vc, ve, vf, vg, vq}), fbag_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::cnat(vq)), fbag_join(s, vf, vg, sort_fbag::empty(s), vc))));
1768 result.push_back(data_equation(variable_list({vb, vc, vd, vf, vg, vp, vq}), fbag_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::cnat(vp), sort_nat::cnat(vq)), fbag_join(s, vf, vg, vb, vc))));
1769 result.push_back(data_equation(variable_list({vb, vc, vd, ve, vf, vg, vp, vq}), less(vd, ve), fbag_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::cnat(vp), sort_nat::c0()), fbag_join(s, vf, vg, vb, sort_fbag::cons_(s, ve, vq, vc)))));
1770 result.push_back(data_equation(variable_list({vb, vc, vd, ve, vf, vg, vp, vq}), less(ve, vd), fbag_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::cnat(vq)), fbag_join(s, vf, vg, sort_fbag::cons_(s, vd, vp, vb), vc))));
1771 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)));
1772 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::cnat(vp), sort_nat::c0()), fbag_intersect(s, vf, vg, vb, sort_fbag::empty(s)))));
1773 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::cnat(vq)), fbag_intersect(s, vf, vg, sort_fbag::empty(s), vc))));
1774 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::cnat(vp), sort_nat::cnat(vq)), fbag_intersect(s, vf, vg, vb, vc))));
1775 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::cnat(vp), sort_nat::c0()), fbag_intersect(s, vf, vg, vb, sort_fbag::cons_(s, ve, vq, vc)))));
1776 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::cnat(vq)), fbag_intersect(s, vf, vg, sort_fbag::cons_(s, vd, vp, vb), vc))));
1777 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)));
1778 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::cnat(vp), sort_nat::c0()), fbag_difference(s, vf, vg, vb, sort_fbag::empty(s)))));
1779 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::cnat(vq)), fbag_difference(s, vf, vg, sort_fbag::empty(s), vc))));
1780 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::cnat(vp), sort_nat::cnat(vq)), fbag_difference(s, vf, vg, vb, vc))));
1781 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::cnat(vp), sort_nat::c0()), fbag_difference(s, vf, vg, vb, sort_fbag::cons_(s, ve, vq, vc)))));
1782 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::cnat(vq)), fbag_difference(s, vf, vg, sort_fbag::cons_(s, vd, vp, vb), vc))));
1783 result.push_back(data_equation(variable_list({vf}), fbag2fset(s, vf, sort_fbag::empty(s)), sort_fset::empty(s)));
1784 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::cnat(vp)), greater(vf(vd), sort_nat::c0())), fbag2fset(s, vf, vb))));
1785 return result;
1786 }
1787
1788 } // namespace sort_bag
1789
1790 } // namespace data
1791
1792} // namespace mcrl2
1793
1794#endif // MCRL2_DATA_BAG1_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.
universal quantification.
\brief Container type for bags
\brief A container sort
const container_type & container_name() const
\brief A data equation
sort_expression sort() const
Returns the sort of the data expression.
Definition data.cpp:108
universal quantification.
Definition forall.h:26
\brief A function symbol
const core::identifier_string & name() const
const sort_expression & sort() const
\brief A sort expression
\brief A data variable
Definition variable.h:28
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
bool is_fbag_join_function_symbol(const atermpp::aterm &e)
Recogniser for function @fbag_join.
Definition bag1.h:1281
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
function_symbol_vector bag_generate_functions_code(const sort_expression &s)
Give all system defined mappings for bag.
Definition bag1.h:1529
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
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
void make_fbag_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 bag1.h:1311
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
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
const core::identifier_string & fbag_join_name()
Generate identifier @fbag_join.
Definition bag1.h:1261
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
function_symbol fbag_join(const sort_expression &s)
Constructor for function symbol @fbag_join.
Definition bag1.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_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
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
function_symbol_vector bag_generate_constructors_code(const sort_expression &s)
Give all system defined constructors for bag.
Definition bag1.h:132
bool is_fbag_join_application(const atermpp::aterm &e)
Recogniser for application of @fbag_join.
Definition bag1.h:1321
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 fset2fbag(const sort_expression &s)
Constructor for function symbol @fset2fbag.
Definition fbag1.h:471
function_symbol cinsert(const sort_expression &s)
Constructor for function symbol @fset_cinsert.
Definition fset1.h:271
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
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 & cnat()
Constructor for function symbol @cNat.
Definition nat1.h:140
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
function_symbol plus(const sort_expression &s0, const sort_expression &s1)
Definition nat1.h:834
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 & 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
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.