mCRL2
Loading...
Searching...
No Matches
set64.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_SET64_H
16#define MCRL2_DATA_SET64_H
17
18#include "functional" // std::function
25#include "mcrl2/data/standard.h"
26#include "mcrl2/data/forall.h"
28#include "mcrl2/data/bool.h"
29#include "mcrl2/data/fset64.h"
30
31namespace mcrl2 {
32
33 namespace data {
34
36 namespace sort_set {
37
41 inline
42 container_sort set_(const sort_expression& s)
43 {
44 container_sort set_(set_container(), s);
45 return set_;
46 }
47
52 inline
53 bool is_set(const sort_expression& e)
54 {
55 if (is_container_sort(e))
56 {
57 return container_sort(e).container_name() == set_container();
58 }
59 return false;
60 }
61
62
65 inline
67 {
69 return constructor_name;
70 }
71
75 inline
76 function_symbol constructor(const sort_expression& s)
77 {
79 return constructor;
80 }
81
85 inline
87 {
88 if (is_function_symbol(e))
89 {
90 return atermpp::down_cast<function_symbol>(e).name() == constructor_name();
91 }
92 return false;
93 }
94
100 inline
101 application constructor(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
102 {
103 return sort_set::constructor(s)(arg0, arg1);
104 }
105
111 inline
112 void make_constructor(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
113 {
115 }
116
121 inline
123 {
124 return is_application(e) && is_constructor_function_symbol(atermpp::down_cast<application>(e).head());
125 }
129 inline
131 {
133 result.push_back(sort_set::constructor(s));
134
135 return result;
136 }
140 inline
142 {
144 result.push_back(sort_set::constructor(s));
145
146 return result;
147 }
148 // 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
149 typedef std::map<function_symbol,std::pair<std::function<void(data_expression&, const data_expression&)>, std::string> > implementation_map;
153 inline
155 {
156 implementation_map result;
157 static_cast< void >(s); // suppress unused variable warnings
158 return result;
159 }
160
163 inline
165 {
167 return set_fset_name;
168 }
169
173 inline
174 function_symbol set_fset(const sort_expression& s)
175 {
177 return set_fset;
178 }
179
183 inline
185 {
186 if (is_function_symbol(e))
187 {
188 return atermpp::down_cast<function_symbol>(e).name() == set_fset_name();
189 }
190 return false;
191 }
192
197 inline
198 application set_fset(const sort_expression& s, const data_expression& arg0)
199 {
200 return sort_set::set_fset(s)(arg0);
201 }
202
207 inline
208 void make_set_fset(data_expression& result, const sort_expression& s, const data_expression& arg0)
209 {
210 make_application(result, sort_set::set_fset(s),arg0);
211 }
212
217 inline
219 {
220 return is_application(e) && is_set_fset_function_symbol(atermpp::down_cast<application>(e).head());
221 }
222
225 inline
227 {
230 }
231
235 inline
236 function_symbol set_comprehension(const sort_expression& s)
237 {
239 return set_comprehension;
240 }
241
245 inline
247 {
248 if (is_function_symbol(e))
249 {
250 return atermpp::down_cast<function_symbol>(e).name() == set_comprehension_name();
251 }
252 return false;
253 }
254
259 inline
260 application set_comprehension(const sort_expression& s, const data_expression& arg0)
261 {
262 return sort_set::set_comprehension(s)(arg0);
263 }
264
269 inline
270 void make_set_comprehension(data_expression& result, const sort_expression& s, const data_expression& arg0)
271 {
273 }
274
279 inline
281 {
282 return is_application(e) && is_set_comprehension_function_symbol(atermpp::down_cast<application>(e).head());
283 }
284
287 inline
289 {
291 return in_name;
292 }
293
294 // This function is not intended for public use and therefore not documented in Doxygen.
295 inline
296 function_symbol in(const sort_expression& , const sort_expression& s0, const sort_expression& s1)
297 {
298 sort_expression target_sort(sort_bool::bool_());
299 function_symbol in(in_name(), make_function_sort_(s0, s1, target_sort));
300 return in;
301 }
302
306 inline
308 {
309 if (is_function_symbol(e))
310 {
311 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
312 return f.name() == in_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 2;
313 }
314 return false;
315 }
316
322 inline
323 application in(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
324 {
325 return sort_set::in(s, arg0.sort(), arg1.sort())(arg0, arg1);
326 }
327
333 inline
334 void make_in(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
335 {
336 make_application(result, sort_set::in(s, arg0.sort(), arg1.sort()),arg0, arg1);
337 }
338
343 inline
344 bool is_in_application(const atermpp::aterm& e)
345 {
346 return is_application(e) && is_in_function_symbol(atermpp::down_cast<application>(e).head());
347 }
348
351 inline
353 {
355 return complement_name;
356 }
357
361 inline
362 function_symbol complement(const sort_expression& s)
363 {
365 return complement;
366 }
367
371 inline
373 {
374 if (is_function_symbol(e))
375 {
376 return atermpp::down_cast<function_symbol>(e).name() == complement_name();
377 }
378 return false;
379 }
380
385 inline
386 application complement(const sort_expression& s, const data_expression& arg0)
387 {
388 return sort_set::complement(s)(arg0);
389 }
390
395 inline
396 void make_complement(data_expression& result, const sort_expression& s, const data_expression& arg0)
397 {
398 make_application(result, sort_set::complement(s),arg0);
399 }
400
405 inline
407 {
408 return is_application(e) && is_complement_function_symbol(atermpp::down_cast<application>(e).head());
409 }
410
413 inline
415 {
417 return union_name;
418 }
419
420 // This function is not intended for public use and therefore not documented in Doxygen.
421 inline
422 function_symbol union_(const sort_expression& s, const sort_expression& s0, const sort_expression& s1)
423 {
424 sort_expression target_sort;
425 if (s0 == set_(s) && s1 == set_(s))
426 {
427 target_sort = set_(s);
428 }
429 else if (s0 == sort_fset::fset(s) && s1 == sort_fset::fset(s))
430 {
432 }
433 else
434 {
435 throw mcrl2::runtime_error("Cannot compute target sort for union_ with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
436 }
437
438 function_symbol union_(union_name(), make_function_sort_(s0, s1, target_sort));
439 return union_;
440 }
441
445 inline
447 {
448 if (is_function_symbol(e))
449 {
450 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
451 return f.name() == union_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 2;
452 }
453 return false;
454 }
455
461 inline
462 application union_(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
463 {
464 return sort_set::union_(s, arg0.sort(), arg1.sort())(arg0, arg1);
465 }
466
472 inline
473 void make_union_(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
474 {
475 make_application(result, sort_set::union_(s, arg0.sort(), arg1.sort()),arg0, arg1);
476 }
477
482 inline
484 {
485 return is_application(e) && is_union_function_symbol(atermpp::down_cast<application>(e).head());
486 }
487
490 inline
492 {
494 return intersection_name;
495 }
496
497 // This function is not intended for public use and therefore not documented in Doxygen.
498 inline
499 function_symbol intersection(const sort_expression& s, const sort_expression& s0, const sort_expression& s1)
500 {
501 sort_expression target_sort;
502 if (s0 == set_(s) && s1 == set_(s))
503 {
504 target_sort = set_(s);
505 }
506 else if (s0 == sort_fset::fset(s) && s1 == set_(s))
507 {
509 }
510 else if (s0 == set_(s) && s1 == sort_fset::fset(s))
511 {
513 }
514 else if (s0 == sort_fset::fset(s) && s1 == sort_fset::fset(s))
515 {
517 }
518 else
519 {
520 throw mcrl2::runtime_error("Cannot compute target sort for intersection with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
521 }
522
524 return intersection;
525 }
526
530 inline
532 {
533 if (is_function_symbol(e))
534 {
535 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
536 return f.name() == intersection_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 2;
537 }
538 return false;
539 }
540
546 inline
547 application intersection(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
548 {
549 return sort_set::intersection(s, arg0.sort(), arg1.sort())(arg0, arg1);
550 }
551
557 inline
558 void make_intersection(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
559 {
560 make_application(result, sort_set::intersection(s, arg0.sort(), arg1.sort()),arg0, arg1);
561 }
562
567 inline
569 {
570 return is_application(e) && is_intersection_function_symbol(atermpp::down_cast<application>(e).head());
571 }
572
575 inline
577 {
579 return difference_name;
580 }
581
582 // This function is not intended for public use and therefore not documented in Doxygen.
583 inline
584 function_symbol difference(const sort_expression& s, const sort_expression& s0, const sort_expression& s1)
585 {
586 sort_expression target_sort;
587 if (s0 == set_(s) && s1 == set_(s))
588 {
589 target_sort = set_(s);
590 }
591 else if (s0 == sort_fset::fset(s) && s1 == set_(s))
592 {
594 }
595 else if (s0 == sort_fset::fset(s) && s1 == sort_fset::fset(s))
596 {
598 }
599 else
600 {
601 throw mcrl2::runtime_error("Cannot compute target sort for difference with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
602 }
603
605 return difference;
606 }
607
611 inline
613 {
614 if (is_function_symbol(e))
615 {
616 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
617 return f.name() == difference_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 2;
618 }
619 return false;
620 }
621
627 inline
628 application difference(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
629 {
630 return sort_set::difference(s, arg0.sort(), arg1.sort())(arg0, arg1);
631 }
632
638 inline
639 void make_difference(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
640 {
641 make_application(result, sort_set::difference(s, arg0.sort(), arg1.sort()),arg0, arg1);
642 }
643
648 inline
650 {
651 return is_application(e) && is_difference_function_symbol(atermpp::down_cast<application>(e).head());
652 }
653
656 inline
658 {
660 return false_function_name;
661 }
662
666 inline
667 function_symbol false_function(const sort_expression& s)
668 {
670 return false_function;
671 }
672
676 inline
678 {
679 if (is_function_symbol(e))
680 {
681 return atermpp::down_cast<function_symbol>(e).name() == false_function_name();
682 }
683 return false;
684 }
685
690 inline
691 application false_function(const sort_expression& s, const data_expression& arg0)
692 {
693 return sort_set::false_function(s)(arg0);
694 }
695
700 inline
701 void make_false_function(data_expression& result, const sort_expression& s, const data_expression& arg0)
702 {
704 }
705
710 inline
712 {
713 return is_application(e) && is_false_function_function_symbol(atermpp::down_cast<application>(e).head());
714 }
715
718 inline
720 {
722 return true_function_name;
723 }
724
728 inline
729 function_symbol true_function(const sort_expression& s)
730 {
732 return true_function;
733 }
734
738 inline
740 {
741 if (is_function_symbol(e))
742 {
743 return atermpp::down_cast<function_symbol>(e).name() == true_function_name();
744 }
745 return false;
746 }
747
752 inline
753 application true_function(const sort_expression& s, const data_expression& arg0)
754 {
755 return sort_set::true_function(s)(arg0);
756 }
757
762 inline
763 void make_true_function(data_expression& result, const sort_expression& s, const data_expression& arg0)
764 {
766 }
767
772 inline
774 {
775 return is_application(e) && is_true_function_function_symbol(atermpp::down_cast<application>(e).head());
776 }
777
780 inline
782 {
784 return not_function_name;
785 }
786
790 inline
791 function_symbol not_function(const sort_expression& s)
792 {
794 return not_function;
795 }
796
800 inline
802 {
803 if (is_function_symbol(e))
804 {
805 return atermpp::down_cast<function_symbol>(e).name() == not_function_name();
806 }
807 return false;
808 }
809
814 inline
815 application not_function(const sort_expression& s, const data_expression& arg0)
816 {
817 return sort_set::not_function(s)(arg0);
818 }
819
824 inline
825 void make_not_function(data_expression& result, const sort_expression& s, const data_expression& arg0)
826 {
828 }
829
834 inline
836 {
837 return is_application(e) && is_not_function_function_symbol(atermpp::down_cast<application>(e).head());
838 }
839
842 inline
844 {
846 return and_function_name;
847 }
848
852 inline
853 function_symbol and_function(const sort_expression& s)
854 {
856 return and_function;
857 }
858
862 inline
864 {
865 if (is_function_symbol(e))
866 {
867 return atermpp::down_cast<function_symbol>(e).name() == and_function_name();
868 }
869 return false;
870 }
871
877 inline
878 application and_function(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
879 {
880 return sort_set::and_function(s)(arg0, arg1);
881 }
882
888 inline
889 void make_and_function(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
890 {
892 }
893
898 inline
900 {
901 return is_application(e) && is_and_function_function_symbol(atermpp::down_cast<application>(e).head());
902 }
903
906 inline
908 {
910 return or_function_name;
911 }
912
916 inline
917 function_symbol or_function(const sort_expression& s)
918 {
920 return or_function;
921 }
922
926 inline
928 {
929 if (is_function_symbol(e))
930 {
931 return atermpp::down_cast<function_symbol>(e).name() == or_function_name();
932 }
933 return false;
934 }
935
941 inline
942 application or_function(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
943 {
944 return sort_set::or_function(s)(arg0, arg1);
945 }
946
952 inline
953 void make_or_function(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
954 {
956 }
957
962 inline
964 {
965 return is_application(e) && is_or_function_function_symbol(atermpp::down_cast<application>(e).head());
966 }
967
970 inline
972 {
974 return fset_union_name;
975 }
976
980 inline
981 function_symbol fset_union(const sort_expression& s)
982 {
984 return fset_union;
985 }
986
990 inline
992 {
993 if (is_function_symbol(e))
994 {
995 return atermpp::down_cast<function_symbol>(e).name() == fset_union_name();
996 }
997 return false;
998 }
999
1007 inline
1008 application fset_union(const sort_expression& s, const data_expression& arg0, const data_expression& arg1, const data_expression& arg2, const data_expression& arg3)
1009 {
1010 return sort_set::fset_union(s)(arg0, arg1, arg2, arg3);
1011 }
1012
1020 inline
1021 void make_fset_union(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1, const data_expression& arg2, const data_expression& arg3)
1022 {
1024 }
1025
1030 inline
1032 {
1033 return is_application(e) && is_fset_union_function_symbol(atermpp::down_cast<application>(e).head());
1034 }
1035
1038 inline
1040 {
1043 }
1044
1048 inline
1049 function_symbol fset_intersection(const sort_expression& s)
1050 {
1052 return fset_intersection;
1053 }
1054
1058 inline
1060 {
1061 if (is_function_symbol(e))
1062 {
1063 return atermpp::down_cast<function_symbol>(e).name() == fset_intersection_name();
1064 }
1065 return false;
1066 }
1067
1075 inline
1076 application fset_intersection(const sort_expression& s, const data_expression& arg0, const data_expression& arg1, const data_expression& arg2, const data_expression& arg3)
1077 {
1078 return sort_set::fset_intersection(s)(arg0, arg1, arg2, arg3);
1079 }
1080
1088 inline
1089 void make_fset_intersection(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1, const data_expression& arg2, const data_expression& arg3)
1090 {
1092 }
1093
1098 inline
1100 {
1101 return is_application(e) && is_fset_intersection_function_symbol(atermpp::down_cast<application>(e).head());
1102 }
1106 inline
1107 function_symbol_vector set_generate_functions_code(const sort_expression& s)
1108 {
1110 result.push_back(sort_set::set_fset(s));
1111 result.push_back(sort_set::set_comprehension(s));
1112 result.push_back(sort_set::in(s, s, set_(s)));
1113 result.push_back(sort_set::complement(s));
1114 result.push_back(sort_set::union_(s, set_(s), set_(s)));
1115 result.push_back(sort_set::intersection(s, set_(s), set_(s)));
1116 result.push_back(sort_set::intersection(s, sort_fset::fset(s), set_(s)));
1117 result.push_back(sort_set::intersection(s, set_(s), sort_fset::fset(s)));
1118 result.push_back(sort_set::difference(s, set_(s), set_(s)));
1119 result.push_back(sort_set::difference(s, sort_fset::fset(s), set_(s)));
1120 result.push_back(sort_set::false_function(s));
1121 result.push_back(sort_set::true_function(s));
1122 result.push_back(sort_set::not_function(s));
1123 result.push_back(sort_set::and_function(s));
1124 result.push_back(sort_set::or_function(s));
1125 result.push_back(sort_set::fset_union(s));
1126 result.push_back(sort_set::fset_intersection(s));
1127 return result;
1128 }
1129
1133 inline
1135 {
1137 for(const function_symbol& f: set_generate_constructors_code(s))
1138 {
1139 result.push_back(f);
1140 }
1141 return result;
1142 }
1143
1147 inline
1148 function_symbol_vector set_mCRL2_usable_mappings(const sort_expression& s)
1149 {
1151 result.push_back(sort_set::set_fset(s));
1152 result.push_back(sort_set::set_comprehension(s));
1153 result.push_back(sort_set::in(s, s, set_(s)));
1154 result.push_back(sort_set::complement(s));
1155 result.push_back(sort_set::union_(s, set_(s), set_(s)));
1156 result.push_back(sort_set::intersection(s, set_(s), set_(s)));
1157 result.push_back(sort_set::intersection(s, sort_fset::fset(s), set_(s)));
1158 result.push_back(sort_set::intersection(s, set_(s), sort_fset::fset(s)));
1159 result.push_back(sort_set::difference(s, set_(s), set_(s)));
1160 result.push_back(sort_set::difference(s, sort_fset::fset(s), set_(s)));
1161 result.push_back(sort_set::false_function(s));
1162 result.push_back(sort_set::true_function(s));
1163 result.push_back(sort_set::not_function(s));
1164 result.push_back(sort_set::and_function(s));
1165 result.push_back(sort_set::or_function(s));
1166 result.push_back(sort_set::fset_union(s));
1167 result.push_back(sort_set::fset_intersection(s));
1168 return result;
1169 }
1170
1171
1172 // 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
1173 typedef std::map<function_symbol,std::pair<std::function<void(data_expression&, const data_expression&)>, std::string> > implementation_map;
1177 inline
1178 implementation_map set_cpp_implementable_mappings(const sort_expression& s)
1179 {
1180 implementation_map result;
1181 static_cast< void >(s); // suppress unused variable warnings
1182 return result;
1183 }
1189 inline
1190 const data_expression& left(const data_expression& e)
1191 {
1193 return atermpp::down_cast<application>(e)[0];
1194 }
1195
1201 inline
1202 const data_expression& right(const data_expression& e)
1203 {
1205 return atermpp::down_cast<application>(e)[1];
1206 }
1207
1213 inline
1214 const data_expression& arg(const data_expression& e)
1215 {
1217 return atermpp::down_cast<application>(e)[0];
1218 }
1219
1225 inline
1226 const data_expression& arg1(const data_expression& e)
1227 {
1229 return atermpp::down_cast<application>(e)[0];
1230 }
1231
1237 inline
1238 const data_expression& arg2(const data_expression& e)
1239 {
1241 return atermpp::down_cast<application>(e)[1];
1242 }
1243
1249 inline
1250 const data_expression& arg3(const data_expression& e)
1251 {
1253 return atermpp::down_cast<application>(e)[2];
1254 }
1255
1261 inline
1262 const data_expression& arg4(const data_expression& e)
1263 {
1265 return atermpp::down_cast<application>(e)[3];
1266 }
1267
1271 inline
1272 data_equation_vector set_generate_equations_code(const sort_expression& s)
1273 {
1274 variable vd("d",s);
1275 variable ve("e",s);
1276 variable vs("s",sort_fset::fset(s));
1277 variable vt("t",sort_fset::fset(s));
1278 variable vf("f",make_function_sort_(s, sort_bool::bool_()));
1279 variable vg("g",make_function_sort_(s, sort_bool::bool_()));
1280 variable vx("x",set_(s));
1281 variable vy("y",set_(s));
1282 variable vc("c",s);
1283
1284 data_equation_vector result;
1285 result.push_back(data_equation(variable_list({vs}), set_fset(s, vs), constructor(s, false_function(s), vs)));
1286 result.push_back(data_equation(variable_list({vf}), sort_set::set_comprehension(s, vf), constructor(s, vf, sort_fset::empty(s))));
1287 result.push_back(data_equation(variable_list({ve, vf, vs}), in(s, ve, constructor(s, vf, vs)), not_equal_to(vf(ve), in(s, ve, vs))));
1288 result.push_back(data_equation(variable_list({vf, vg, vs, vt}), equal_to(constructor(s, vf, vs), constructor(s, vg, vt)), forall(variable_list({vc}), equal_to(equal_to(vf(vc), vg(vc)), equal_to(in(s, vc, vs), in(s, vc, vt))))));
1289 result.push_back(data_equation(variable_list({vx, vy}), less(vx, vy), sort_bool::and_(less_equal(vx, vy), not_equal_to(vx, vy))));
1290 result.push_back(data_equation(variable_list({vx, vy}), less_equal(vx, vy), equal_to(intersection(s, vx, vy), vx)));
1291 result.push_back(data_equation(variable_list({vf, vs}), complement(s, constructor(s, vf, vs)), constructor(s, not_function(s, vf), vs)));
1292 result.push_back(data_equation(variable_list({vx}), union_(s, vx, vx), vx));
1293 result.push_back(data_equation(variable_list({vx, vy}), union_(s, vx, union_(s, vx, vy)), union_(s, vx, vy)));
1294 result.push_back(data_equation(variable_list({vx, vy}), union_(s, vx, union_(s, vy, vx)), union_(s, vy, vx)));
1295 result.push_back(data_equation(variable_list({vx, vy}), union_(s, union_(s, vx, vy), vx), union_(s, vx, vy)));
1296 result.push_back(data_equation(variable_list({vx, vy}), union_(s, union_(s, vy, vx), vx), union_(s, vy, vx)));
1297 result.push_back(data_equation(variable_list({vf, vg, vs, vt}), union_(s, constructor(s, vf, vs), constructor(s, vg, vt)), constructor(s, or_function(s, vf, vg), fset_union(s, vf, vg, vs, vt))));
1298 result.push_back(data_equation(variable_list({vx}), intersection(s, vx, vx), vx));
1299 result.push_back(data_equation(variable_list({vx, vy}), intersection(s, vx, intersection(s, vx, vy)), intersection(s, vx, vy)));
1300 result.push_back(data_equation(variable_list({vx, vy}), intersection(s, vx, intersection(s, vy, vx)), intersection(s, vy, vx)));
1301 result.push_back(data_equation(variable_list({vx, vy}), intersection(s, intersection(s, vx, vy), vx), intersection(s, vx, vy)));
1302 result.push_back(data_equation(variable_list({vx, vy}), intersection(s, intersection(s, vy, vx), vx), intersection(s, vy, vx)));
1303 result.push_back(data_equation(variable_list({vf, vg, vs, vt}), intersection(s, constructor(s, vf, vs), constructor(s, vg, vt)), constructor(s, and_function(s, vf, vg), fset_intersection(s, vf, vg, vs, vt))));
1304 result.push_back(data_equation(variable_list({vx}), intersection(s, sort_fset::empty(s), vx), sort_fset::empty(s)));
1305 result.push_back(data_equation(variable_list({vd, vs, vx}), intersection(s, sort_fset::cons_(s, vd, vs), vx), if_(in(s, vd, vx), sort_fset::cons_(s, vd, intersection(s, vs, vx)), intersection(s, vs, vx))));
1306 result.push_back(data_equation(variable_list({vs, vx}), intersection(s, vx, vs), intersection(s, vs, vx)));
1307 result.push_back(data_equation(variable_list({vx, vy}), difference(s, vx, vy), intersection(s, vx, complement(s, vy))));
1308 result.push_back(data_equation(variable_list({vs, vx}), difference(s, vs, vx), intersection(s, vs, complement(s, vx))));
1309 result.push_back(data_equation(variable_list({ve}), false_function(s, ve), sort_bool::false_()));
1310 result.push_back(data_equation(variable_list({ve}), true_function(s, ve), sort_bool::true_()));
1311 result.push_back(data_equation(variable_list(), equal_to(false_function(s), true_function(s)), sort_bool::false_()));
1312 result.push_back(data_equation(variable_list(), equal_to(true_function(s), false_function(s)), sort_bool::false_()));
1313 result.push_back(data_equation(variable_list({ve, vf}), not_function(s, vf)(ve), sort_bool::not_(vf(ve))));
1314 result.push_back(data_equation(variable_list(), not_function(s, false_function(s)), true_function(s)));
1315 result.push_back(data_equation(variable_list(), not_function(s, true_function(s)), false_function(s)));
1316 result.push_back(data_equation(variable_list({ve, vf, vg}), and_function(s, vf, vg)(ve), sort_bool::and_(vf(ve), vg(ve))));
1317 result.push_back(data_equation(variable_list({vf}), and_function(s, vf, vf), vf));
1318 result.push_back(data_equation(variable_list({vf}), and_function(s, vf, false_function(s)), false_function(s)));
1319 result.push_back(data_equation(variable_list({vf}), and_function(s, false_function(s), vf), false_function(s)));
1320 result.push_back(data_equation(variable_list({vf}), and_function(s, vf, true_function(s)), vf));
1321 result.push_back(data_equation(variable_list({vf}), and_function(s, true_function(s), vf), vf));
1322 result.push_back(data_equation(variable_list({vf}), or_function(s, vf, vf), vf));
1323 result.push_back(data_equation(variable_list({vf}), or_function(s, vf, false_function(s)), vf));
1324 result.push_back(data_equation(variable_list({vf}), or_function(s, false_function(s), vf), vf));
1325 result.push_back(data_equation(variable_list({vf}), or_function(s, vf, true_function(s)), true_function(s)));
1326 result.push_back(data_equation(variable_list({vf}), or_function(s, true_function(s), vf), true_function(s)));
1327 result.push_back(data_equation(variable_list({ve, vf, vg}), or_function(s, vf, vg)(ve), sort_bool::or_(vf(ve), vg(ve))));
1328 result.push_back(data_equation(variable_list({vf, vg}), fset_union(s, vf, vg, sort_fset::empty(s), sort_fset::empty(s)), sort_fset::empty(s)));
1329 result.push_back(data_equation(variable_list({vd, vf, vg, vs}), fset_union(s, vf, vg, sort_fset::cons_(s, vd, vs), sort_fset::empty(s)), sort_fset::cinsert(s, vd, sort_bool::not_(vg(vd)), fset_union(s, vf, vg, vs, sort_fset::empty(s)))));
1330 result.push_back(data_equation(variable_list({ve, vf, vg, vt}), fset_union(s, vf, vg, sort_fset::empty(s), sort_fset::cons_(s, ve, vt)), sort_fset::cinsert(s, ve, sort_bool::not_(vf(ve)), fset_union(s, vf, vg, sort_fset::empty(s), vt))));
1331 result.push_back(data_equation(variable_list({vd, vf, vg, vs, vt}), fset_union(s, vf, vg, sort_fset::cons_(s, vd, vs), sort_fset::cons_(s, vd, vt)), sort_fset::cinsert(s, vd, equal_to(vf(vd), vg(vd)), fset_union(s, vf, vg, vs, vt))));
1332 result.push_back(data_equation(variable_list({vd, ve, vf, vg, vs, vt}), less(vd, ve), fset_union(s, vf, vg, sort_fset::cons_(s, vd, vs), sort_fset::cons_(s, ve, vt)), sort_fset::cinsert(s, vd, sort_bool::not_(vg(vd)), fset_union(s, vf, vg, vs, sort_fset::cons_(s, ve, vt)))));
1333 result.push_back(data_equation(variable_list({vd, ve, vf, vg, vs, vt}), less(ve, vd), fset_union(s, vf, vg, sort_fset::cons_(s, vd, vs), sort_fset::cons_(s, ve, vt)), sort_fset::cinsert(s, ve, sort_bool::not_(vf(ve)), fset_union(s, vf, vg, sort_fset::cons_(s, vd, vs), vt))));
1334 result.push_back(data_equation(variable_list({vf, vg}), fset_intersection(s, vf, vg, sort_fset::empty(s), sort_fset::empty(s)), sort_fset::empty(s)));
1335 result.push_back(data_equation(variable_list({vd, vf, vg, vs}), fset_intersection(s, vf, vg, sort_fset::cons_(s, vd, vs), sort_fset::empty(s)), sort_fset::cinsert(s, vd, vg(vd), fset_intersection(s, vf, vg, vs, sort_fset::empty(s)))));
1336 result.push_back(data_equation(variable_list({ve, vf, vg, vt}), fset_intersection(s, vf, vg, sort_fset::empty(s), sort_fset::cons_(s, ve, vt)), sort_fset::cinsert(s, ve, vf(ve), fset_intersection(s, vf, vg, sort_fset::empty(s), vt))));
1337 result.push_back(data_equation(variable_list({vd, vf, vg, vs, vt}), fset_intersection(s, vf, vg, sort_fset::cons_(s, vd, vs), sort_fset::cons_(s, vd, vt)), sort_fset::cinsert(s, vd, equal_to(vf(vd), vg(vd)), fset_intersection(s, vf, vg, vs, vt))));
1338 result.push_back(data_equation(variable_list({vd, ve, vf, vg, vs, vt}), less(vd, ve), fset_intersection(s, vf, vg, sort_fset::cons_(s, vd, vs), sort_fset::cons_(s, ve, vt)), sort_fset::cinsert(s, vd, vg(vd), fset_intersection(s, vf, vg, vs, sort_fset::cons_(s, ve, vt)))));
1339 result.push_back(data_equation(variable_list({vd, ve, vf, vg, vs, vt}), less(ve, vd), fset_intersection(s, vf, vg, sort_fset::cons_(s, vd, vs), sort_fset::cons_(s, ve, vt)), sort_fset::cinsert(s, ve, vf(ve), fset_intersection(s, vf, vg, sort_fset::cons_(s, vd, vs), vt))));
1340 return result;
1341 }
1342
1343 } // namespace sort_set_
1344
1345 } // namespace data
1346
1347} // namespace mcrl2
1348
1349#endif // MCRL2_DATA_SET64_H
The class application.
The class basic_sort.
The standard sort bool_.
size_type size() const
Returns the number of arguments of this term.
Definition aterm.h:151
sort_expression sort() const
Returns the sort of the data expression.
Definition data.cpp:108
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.
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
const function_symbol & or_()
Constructor for function symbol ||.
Definition bool.h:299
const function_symbol & not_()
Constructor for function symbol !.
Definition bool.h:173
const function_symbol & true_()
Constructor for function symbol true.
Definition bool.h:77
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 core::identifier_string & fset_intersection_name()
Generate identifier @fset_inter.
Definition set1.h:1039
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 set1.h:334
function_symbol true_function(const sort_expression &s)
Constructor for function symbol @true_.
Definition set1.h:729
const core::identifier_string & or_function_name()
Generate identifier @or_.
Definition set1.h:907
bool is_set_comprehension_application(const atermpp::aterm &e)
Recogniser for application of @setcomp.
Definition set1.h:280
const core::identifier_string & constructor_name()
Generate identifier @set.
Definition set1.h:66
bool is_false_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @false_.
Definition set1.h:677
bool is_difference_function_symbol(const atermpp::aterm &e)
Recogniser for function -.
Definition set1.h:612
bool is_not_function_application(const atermpp::aterm &e)
Recogniser for application of @not_.
Definition set1.h:835
bool is_and_function_application(const atermpp::aterm &e)
Recogniser for application of @and_.
Definition set1.h:899
void make_or_function(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @or_.
Definition set1.h:953
function_symbol_vector set_generate_constructors_and_functions_code(const sort_expression &s)
Give all system defined mappings and constructors for set_.
Definition set1.h:1134
bool is_fset_intersection_function_symbol(const atermpp::aterm &e)
Recogniser for function @fset_inter.
Definition set1.h:1059
bool is_set(const sort_expression &e)
Recogniser for sort expression Set(s)
Definition set1.h:53
function_symbol or_function(const sort_expression &s)
Constructor for function symbol @or_.
Definition set1.h:917
void make_complement(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol !.
Definition set1.h:396
bool is_union_application(const atermpp::aterm &e)
Recogniser for application of +.
Definition set1.h:483
const core::identifier_string & false_function_name()
Generate identifier @false_.
Definition set1.h:657
bool is_in_function_symbol(const atermpp::aterm &e)
Recogniser for function in.
Definition set1.h:307
const data_expression & arg4(const data_expression &e)
Function for projecting out argument. arg4 from an application.
Definition set1.h:1262
bool is_true_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @true_.
Definition set1.h:739
bool is_complement_application(const atermpp::aterm &e)
Recogniser for application of !.
Definition set1.h:406
bool is_or_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @or_.
Definition set1.h:927
function_symbol fset_intersection(const sort_expression &s)
Constructor for function symbol @fset_inter.
Definition set1.h:1049
std::map< function_symbol, std::pair< std::function< void(data_expression &, const data_expression &)>, std::string > > implementation_map
Definition set1.h:149
const core::identifier_string & set_comprehension_name()
Generate identifier @setcomp.
Definition set1.h:226
void make_fset_union(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 @fset_union.
Definition set1.h:1021
bool is_fset_union_application(const atermpp::aterm &e)
Recogniser for application of @fset_union.
Definition set1.h:1031
bool is_false_function_application(const atermpp::aterm &e)
Recogniser for application of @false_.
Definition set1.h:711
const data_expression & left(const data_expression &e)
Function for projecting out argument. left from an application.
Definition set1.h:1190
bool is_not_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @not_.
Definition set1.h:801
function_symbol and_function(const sort_expression &s)
Constructor for function symbol @and_.
Definition set1.h:853
bool is_set_comprehension_function_symbol(const atermpp::aterm &e)
Recogniser for function @setcomp.
Definition set1.h:246
bool is_in_application(const atermpp::aterm &e)
Recogniser for application of in.
Definition set1.h:344
const core::identifier_string & not_function_name()
Generate identifier @not_.
Definition set1.h:781
const core::identifier_string & in_name()
Generate identifier in.
Definition set1.h:288
function_symbol_vector set_generate_constructors_code(const sort_expression &s)
Give all system defined constructors for set_.
Definition set1.h:130
implementation_map set_cpp_implementable_mappings(const sort_expression &s)
Give all system defined mappings that are to be implemented in C++ code for set_.
Definition set1.h:1178
bool is_fset_intersection_application(const atermpp::aterm &e)
Recogniser for application of @fset_inter.
Definition set1.h:1099
bool is_difference_application(const atermpp::aterm &e)
Recogniser for application of -.
Definition set1.h:649
function_symbol not_function(const sort_expression &s)
Constructor for function symbol @not_.
Definition set1.h:791
const data_expression & arg(const data_expression &e)
Function for projecting out argument. arg from an application.
Definition set1.h:1214
bool is_constructor_application(const atermpp::aterm &e)
Recogniser for application of @set.
Definition set1.h:122
const core::identifier_string & fset_union_name()
Generate identifier @fset_union.
Definition set1.h:971
bool is_set_fset_application(const atermpp::aterm &e)
Recogniser for application of @setfset.
Definition set1.h:218
implementation_map set_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 set1.h:154
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 set1.h:558
const core::identifier_string & complement_name()
Generate identifier !.
Definition set1.h:352
function_symbol intersection(const sort_expression &s, const sort_expression &s0, const sort_expression &s1)
Definition set1.h:499
const core::identifier_string & and_function_name()
Generate identifier @and_.
Definition set1.h:843
bool is_fset_union_function_symbol(const atermpp::aterm &e)
Recogniser for function @fset_union.
Definition set1.h:991
const data_expression & arg2(const data_expression &e)
Function for projecting out argument. arg2 from an application.
Definition set1.h:1238
function_symbol fset_union(const sort_expression &s)
Constructor for function symbol @fset_union.
Definition set1.h:981
void make_and_function(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @and_.
Definition set1.h:889
container_sort set_(const sort_expression &s)
Constructor for sort expression Set(S)
Definition set1.h:42
bool is_set_fset_function_symbol(const atermpp::aterm &e)
Recogniser for function @setfset.
Definition set1.h:184
const core::identifier_string & intersection_name()
Generate identifier *.
Definition set1.h:491
void make_fset_intersection(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 @fset_inter.
Definition set1.h:1089
function_symbol constructor(const sort_expression &s)
Constructor for function symbol @set.
Definition set1.h:76
const data_expression & arg3(const data_expression &e)
Function for projecting out argument. arg3 from an application.
Definition set1.h:1250
const data_expression & right(const data_expression &e)
Function for projecting out argument. right from an application.
Definition set1.h:1202
function_symbol false_function(const sort_expression &s)
Constructor for function symbol @false_.
Definition set1.h:667
void make_constructor(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @set.
Definition set1.h:112
const core::identifier_string & set_fset_name()
Generate identifier @setfset.
Definition set1.h:164
const core::identifier_string & union_name()
Generate identifier +.
Definition set1.h:414
bool is_complement_function_symbol(const atermpp::aterm &e)
Recogniser for function !.
Definition set1.h:372
function_symbol in(const sort_expression &, const sort_expression &s0, const sort_expression &s1)
Definition set1.h:296
function_symbol union_(const sort_expression &s, const sort_expression &s0, const sort_expression &s1)
Definition set1.h:422
bool is_constructor_function_symbol(const atermpp::aterm &e)
Recogniser for function @set.
Definition set1.h:86
function_symbol_vector set_generate_functions_code(const sort_expression &s)
Give all system defined mappings for set_.
Definition set1.h:1107
function_symbol_vector set_mCRL2_usable_constructors(const sort_expression &s)
Give all defined constructors which can be used in mCRL2 specs for set_.
Definition set1.h:141
const core::identifier_string & difference_name()
Generate identifier -.
Definition set1.h:576
void make_set_comprehension(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol @setcomp.
Definition set1.h:270
void make_not_function(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol @not_.
Definition set1.h:825
bool is_or_function_application(const atermpp::aterm &e)
Recogniser for application of @or_.
Definition set1.h:963
const core::identifier_string & true_function_name()
Generate identifier @true_.
Definition set1.h:719
void make_false_function(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol @false_.
Definition set1.h:701
void make_true_function(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol @true_.
Definition set1.h:763
function_symbol difference(const sort_expression &s, const sort_expression &s0, const sort_expression &s1)
Definition set1.h:584
bool is_union_function_symbol(const atermpp::aterm &e)
Recogniser for function +.
Definition set1.h:446
function_symbol complement(const sort_expression &s)
Constructor for function symbol !.
Definition set1.h:362
bool is_true_function_application(const atermpp::aterm &e)
Recogniser for application of @true_.
Definition set1.h:773
function_symbol set_fset(const sort_expression &s)
Constructor for function symbol @setfset.
Definition set1.h:174
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 set1.h:639
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 set1.h:473
function_symbol set_comprehension(const sort_expression &s)
Constructor for function symbol @setcomp.
Definition set1.h:236
bool is_intersection_application(const atermpp::aterm &e)
Recogniser for application of *.
Definition set1.h:568
data_equation_vector set_generate_equations_code(const sort_expression &s)
Give all system defined equations for set_.
Definition set1.h:1272
function_symbol_vector set_mCRL2_usable_mappings(const sort_expression &s)
Give all system defined mappings that can be used in mCRL2 specs for set_.
Definition set1.h:1148
bool is_and_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @and_.
Definition set1.h:863
void make_set_fset(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol @setfset.
Definition set1.h:208
bool is_intersection_function_symbol(const atermpp::aterm &e)
Recogniser for function *.
Definition set1.h:531
const data_expression & arg1(const data_expression &e)
Function for projecting out argument. arg1 from an application.
Definition set1.h:1226
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.
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.