mCRL2
Loading...
Searching...
No Matches
nat64.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_NAT64_H
16#define MCRL2_DATA_NAT64_H
17
18#include "functional" // std::function
25#include "mcrl2/data/standard.h"
27#include "mcrl2/data/bool.h"
28#include "mcrl2/data/pos64.h"
29
30namespace mcrl2 {
31
32 namespace data {
33
35 namespace sort_nat {
36
37 inline
39 {
41 return nat_name;
42 }
43
46 inline
47 const basic_sort& nat()
48 {
49 static basic_sort nat = basic_sort(nat_name());
50 return nat;
51 }
52
56 inline
57 bool is_nat(const sort_expression& e)
58 {
59 if (is_basic_sort(e))
60 {
61 return basic_sort(e) == nat();
62 }
63 return false;
64 }
65
66 inline
68 {
70 return natnatpair_name;
71 }
72
75 inline
77 {
79 return natnatpair;
80 }
81
85 inline
87 {
88 if (is_basic_sort(e))
89 {
90 return basic_sort(e) == natnatpair();
91 }
92 return false;
93 }
94
95
98 inline
100 {
102 return c0_name;
103 }
104
106
108 inline
109 const function_symbol& c0()
110 {
111 static function_symbol c0(c0_name(), nat());
112 return c0;
113 }
114
118 inline
120 {
121 if (is_function_symbol(e))
122 {
123 return atermpp::down_cast<function_symbol>(e) == c0();
124 }
125 return false;
126 }
127
130 inline
132 {
134 return succ_nat_name;
135 }
136
138
140 inline
142 {
144 return succ_nat;
145 }
146
150 inline
152 {
153 if (is_function_symbol(e))
154 {
155 return atermpp::down_cast<function_symbol>(e) == succ_nat();
156 }
157 return false;
158 }
159
161
164 inline
166 {
167 return sort_nat::succ_nat()(arg0);
168 }
169
172
174 inline
176 {
177 make_application(result, sort_nat::succ_nat(),arg0);
178 }
179
184 inline
186 {
187 return is_application(e) && is_succ_nat_function_symbol(atermpp::down_cast<application>(e).head());
188 }
189
192 inline
194 {
196 return nnpair_name;
197 }
198
200
202 inline
204 {
206 return nnpair;
207 }
208
212 inline
214 {
215 if (is_function_symbol(e))
216 {
217 return atermpp::down_cast<function_symbol>(e) == nnpair();
218 }
219 return false;
220 }
221
223
227 inline
229 {
230 return sort_nat::nnpair()(arg0, arg1);
231 }
232
235
238 inline
240 {
241 make_application(result, sort_nat::nnpair(),arg0, arg1);
242 }
243
248 inline
250 {
251 return is_application(e) && is_nnpair_function_symbol(atermpp::down_cast<application>(e).head());
252 }
255 inline
257 {
259 result.push_back(sort_nat::c0());
260 result.push_back(sort_nat::succ_nat());
261 result.push_back(sort_nat::nnpair());
262
263 return result;
264 }
267 inline
269 {
271 result.push_back(sort_nat::c0());
272 result.push_back(sort_nat::succ_nat());
273 result.push_back(sort_nat::nnpair());
274
275 return result;
276 }
277 // 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
278 typedef std::map<function_symbol,std::pair<std::function<void(data_expression&, const data_expression&)>, std::string> > implementation_map;
281 inline
283 {
284 implementation_map result;
285 return result;
286 }
287
290 inline
292 {
295 }
296
298
300 inline
302 {
305 }
306
310 inline
312 {
313 if (is_function_symbol(e))
314 {
315 return atermpp::down_cast<function_symbol>(e) == most_significant_digit_nat();
316 }
317 return false;
318 }
319
321
324 inline
326 {
328 }
329
332
334 inline
336 {
338 }
339
344 inline
346 {
347 return is_application(e) && is_most_significant_digit_nat_function_symbol(atermpp::down_cast<application>(e).head());
348 }
349
352 inline
354 {
356 return concat_digit_name;
357 }
358
359 // This function is not intended for public use and therefore not documented in Doxygen.
360 inline
362 {
363 sort_expression target_sort;
364 if (s0 == nat() && s1 == sort_machine_word::machine_word())
365 {
366 target_sort = nat();
367 }
368 else if (s0 == sort_pos::pos() && s1 == sort_machine_word::machine_word())
369 {
370 target_sort = sort_pos::pos();
371 }
372 else
373 {
374 throw mcrl2::runtime_error("Cannot compute target sort for concat_digit with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
375 }
376
378 return concat_digit;
379 }
380
384 inline
386 {
387 if (is_function_symbol(e))
388 {
389 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
390 return f.name() == concat_digit_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 2 && (f == concat_digit(nat(), sort_machine_word::machine_word()) || f == concat_digit(sort_pos::pos(), sort_machine_word::machine_word()));
391 }
392 return false;
393 }
394
396
400 inline
402 {
403 return sort_nat::concat_digit(arg0.sort(), arg1.sort())(arg0, arg1);
404 }
405
408
411 inline
413 {
414 make_application(result, sort_nat::concat_digit(arg0.sort(), arg1.sort()),arg0, arg1);
415 }
416
421 inline
423 {
424 return is_application(e) && is_concat_digit_function_symbol(atermpp::down_cast<application>(e).head());
425 }
426
429 inline
431 {
433 return equals_zero_name;
434 }
435
437
439 inline
441 {
443 return equals_zero;
444 }
445
449 inline
451 {
452 if (is_function_symbol(e))
453 {
454 return atermpp::down_cast<function_symbol>(e) == equals_zero();
455 }
456 return false;
457 }
458
460
463 inline
465 {
466 return sort_nat::equals_zero()(arg0);
467 }
468
471
473 inline
475 {
477 }
478
483 inline
485 {
486 return is_application(e) && is_equals_zero_function_symbol(atermpp::down_cast<application>(e).head());
487 }
488
491 inline
493 {
496 }
497
499
501 inline
503 {
505 return not_equals_zero;
506 }
507
511 inline
513 {
514 if (is_function_symbol(e))
515 {
516 return atermpp::down_cast<function_symbol>(e) == not_equals_zero();
517 }
518 return false;
519 }
520
522
525 inline
527 {
528 return sort_nat::not_equals_zero()(arg0);
529 }
530
533
535 inline
537 {
539 }
540
545 inline
547 {
548 return is_application(e) && is_not_equals_zero_function_symbol(atermpp::down_cast<application>(e).head());
549 }
550
553 inline
555 {
557 return equals_one_name;
558 }
559
560 // This function is not intended for public use and therefore not documented in Doxygen.
561 inline
563 {
564 sort_expression target_sort(sort_bool::bool_());
566 return equals_one;
567 }
568
572 inline
574 {
575 if (is_function_symbol(e))
576 {
577 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
578 return f.name() == equals_one_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 1 && (f == equals_one(nat()) || f == equals_one(sort_pos::pos()));
579 }
580 return false;
581 }
582
584
587 inline
589 {
590 return sort_nat::equals_one(arg0.sort())(arg0);
591 }
592
595
597 inline
599 {
600 make_application(result, sort_nat::equals_one(arg0.sort()),arg0);
601 }
602
607 inline
609 {
610 return is_application(e) && is_equals_one_function_symbol(atermpp::down_cast<application>(e).head());
611 }
612
615 inline
617 {
619 return pos2nat_name;
620 }
621
623
625 inline
626 const function_symbol& pos2nat()
627 {
628 static function_symbol pos2nat(pos2nat_name(), make_function_sort_(sort_pos::pos(), nat()));
629 return pos2nat;
630 }
631
635 inline
637 {
638 if (is_function_symbol(e))
639 {
640 return atermpp::down_cast<function_symbol>(e) == pos2nat();
641 }
642 return false;
643 }
644
646
649 inline
650 application pos2nat(const data_expression& arg0)
651 {
652 return sort_nat::pos2nat()(arg0);
653 }
654
657
659 inline
660 void make_pos2nat(data_expression& result, const data_expression& arg0)
661 {
662 make_application(result, sort_nat::pos2nat(),arg0);
663 }
664
669 inline
671 {
672 return is_application(e) && is_pos2nat_function_symbol(atermpp::down_cast<application>(e).head());
673 }
674
677 inline
679 {
681 return nat2pos_name;
682 }
683
685
687 inline
688 const function_symbol& nat2pos()
689 {
691 return nat2pos;
692 }
693
697 inline
699 {
700 if (is_function_symbol(e))
701 {
702 return atermpp::down_cast<function_symbol>(e) == nat2pos();
703 }
704 return false;
705 }
706
708
711 inline
712 application nat2pos(const data_expression& arg0)
713 {
714 return sort_nat::nat2pos()(arg0);
715 }
716
719
721 inline
722 void make_nat2pos(data_expression& result, const data_expression& arg0)
723 {
724 make_application(result, sort_nat::nat2pos(),arg0);
725 }
726
731 inline
733 {
734 return is_application(e) && is_nat2pos_function_symbol(atermpp::down_cast<application>(e).head());
735 }
736
739 inline
741 {
743 return succ_name;
744 }
745
746 // This function is not intended for public use and therefore not documented in Doxygen.
747 inline
748 function_symbol succ(const sort_expression& s0)
749 {
750 sort_expression target_sort(sort_pos::pos());
752 return succ;
753 }
754
758 inline
760 {
761 if (is_function_symbol(e))
762 {
763 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
764 return f.name() == succ_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 1 && (f == succ(nat()) || f == succ(sort_pos::pos()));
765 }
766 return false;
767 }
768
770
773 inline
774 application succ(const data_expression& arg0)
775 {
776 return sort_nat::succ(arg0.sort())(arg0);
777 }
778
781
783 inline
784 void make_succ(data_expression& result, const data_expression& arg0)
785 {
786 make_application(result, sort_nat::succ(arg0.sort()),arg0);
787 }
788
793 inline
795 {
796 return is_application(e) && is_succ_function_symbol(atermpp::down_cast<application>(e).head());
797 }
798
801 inline
803 {
805 return maximum_name;
806 }
807
808 // This function is not intended for public use and therefore not documented in Doxygen.
809 inline
810 function_symbol maximum(const sort_expression& s0, const sort_expression& s1)
811 {
812 sort_expression target_sort;
813 if (s0 == sort_pos::pos() && s1 == nat())
814 {
816 }
817 else if (s0 == nat() && s1 == sort_pos::pos())
818 {
820 }
821 else if (s0 == nat() && s1 == nat())
822 {
823 target_sort = nat();
824 }
825 else if (s0 == sort_pos::pos() && s1 == sort_pos::pos())
826 {
828 }
829 else
830 {
831 throw mcrl2::runtime_error("Cannot compute target sort for maximum with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
832 }
833
835 return maximum;
836 }
837
841 inline
843 {
844 if (is_function_symbol(e))
845 {
846 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
847 return f.name() == maximum_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 2 && (f == maximum(sort_pos::pos(), nat()) || f == maximum(nat(), sort_pos::pos()) || f == maximum(nat(), nat()) || f == maximum(sort_pos::pos(), sort_pos::pos()));
848 }
849 return false;
850 }
851
853
857 inline
858 application maximum(const data_expression& arg0, const data_expression& arg1)
859 {
860 return sort_nat::maximum(arg0.sort(), arg1.sort())(arg0, arg1);
861 }
862
865
868 inline
869 void make_maximum(data_expression& result, const data_expression& arg0, const data_expression& arg1)
870 {
871 make_application(result, sort_nat::maximum(arg0.sort(), arg1.sort()),arg0, arg1);
872 }
873
878 inline
880 {
881 return is_application(e) && is_maximum_function_symbol(atermpp::down_cast<application>(e).head());
882 }
883
886 inline
888 {
890 return minimum_name;
891 }
892
893 // This function is not intended for public use and therefore not documented in Doxygen.
894 inline
895 function_symbol minimum(const sort_expression& s0, const sort_expression& s1)
896 {
897 sort_expression target_sort;
898 if (s0 == nat() && s1 == nat())
899 {
900 target_sort = nat();
901 }
902 else if (s0 == sort_pos::pos() && s1 == sort_pos::pos())
903 {
905 }
906 else
907 {
908 throw mcrl2::runtime_error("Cannot compute target sort for minimum with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
909 }
910
912 return minimum;
913 }
914
918 inline
920 {
921 if (is_function_symbol(e))
922 {
923 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
924 return f.name() == minimum_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 2 && (f == minimum(nat(), nat()) || f == minimum(sort_pos::pos(), sort_pos::pos()));
925 }
926 return false;
927 }
928
930
934 inline
935 application minimum(const data_expression& arg0, const data_expression& arg1)
936 {
937 return sort_nat::minimum(arg0.sort(), arg1.sort())(arg0, arg1);
938 }
939
942
945 inline
946 void make_minimum(data_expression& result, const data_expression& arg0, const data_expression& arg1)
947 {
948 make_application(result, sort_nat::minimum(arg0.sort(), arg1.sort()),arg0, arg1);
949 }
950
955 inline
957 {
958 return is_application(e) && is_minimum_function_symbol(atermpp::down_cast<application>(e).head());
959 }
960
963 inline
965 {
967 return pred_name;
968 }
969
971
973 inline
974 const function_symbol& pred()
975 {
977 return pred;
978 }
979
983 inline
985 {
986 if (is_function_symbol(e))
987 {
988 return atermpp::down_cast<function_symbol>(e) == pred();
989 }
990 return false;
991 }
992
994
997 inline
998 application pred(const data_expression& arg0)
999 {
1000 return sort_nat::pred()(arg0);
1001 }
1002
1005
1007 inline
1008 void make_pred(data_expression& result, const data_expression& arg0)
1009 {
1010 make_application(result, sort_nat::pred(),arg0);
1011 }
1012
1017 inline
1018 bool is_pred_application(const atermpp::aterm& e)
1019 {
1020 return is_application(e) && is_pred_function_symbol(atermpp::down_cast<application>(e).head());
1021 }
1022
1025 inline
1027 {
1029 return pred_whr_name;
1030 }
1031
1033
1035 inline
1037 {
1039 return pred_whr;
1040 }
1041
1045 inline
1047 {
1048 if (is_function_symbol(e))
1049 {
1050 return atermpp::down_cast<function_symbol>(e) == pred_whr();
1051 }
1052 return false;
1053 }
1054
1056
1059 inline
1061 {
1062 return sort_nat::pred_whr()(arg0);
1063 }
1064
1067
1069 inline
1071 {
1072 make_application(result, sort_nat::pred_whr(),arg0);
1073 }
1074
1079 inline
1081 {
1082 return is_application(e) && is_pred_whr_function_symbol(atermpp::down_cast<application>(e).head());
1083 }
1084
1087 inline
1089 {
1091 return plus_name;
1092 }
1093
1094 // This function is not intended for public use and therefore not documented in Doxygen.
1095 inline
1096 function_symbol plus(const sort_expression& s0, const sort_expression& s1)
1097 {
1098 sort_expression target_sort;
1099 if (s0 == sort_pos::pos() && s1 == nat())
1100 {
1101 target_sort = sort_pos::pos();
1102 }
1103 else if (s0 == nat() && s1 == sort_pos::pos())
1104 {
1105 target_sort = sort_pos::pos();
1106 }
1107 else if (s0 == nat() && s1 == nat())
1108 {
1109 target_sort = nat();
1110 }
1111 else if (s0 == sort_pos::pos() && s1 == sort_pos::pos())
1112 {
1114 }
1115 else
1116 {
1117 throw mcrl2::runtime_error("Cannot compute target sort for plus with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
1118 }
1119
1120 function_symbol plus(plus_name(), make_function_sort_(s0, s1, target_sort));
1121 return plus;
1122 }
1123
1127 inline
1129 {
1130 if (is_function_symbol(e))
1131 {
1132 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
1133 return f.name() == plus_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 2 && (f == plus(sort_pos::pos(), nat()) || f == plus(nat(), sort_pos::pos()) || f == plus(nat(), nat()) || f == plus(sort_pos::pos(), sort_pos::pos()));
1134 }
1135 return false;
1136 }
1137
1139
1143 inline
1144 application plus(const data_expression& arg0, const data_expression& arg1)
1145 {
1146 return sort_nat::plus(arg0.sort(), arg1.sort())(arg0, arg1);
1147 }
1148
1151
1154 inline
1155 void make_plus(data_expression& result, const data_expression& arg0, const data_expression& arg1)
1156 {
1157 make_application(result, sort_nat::plus(arg0.sort(), arg1.sort()),arg0, arg1);
1158 }
1159
1164 inline
1165 bool is_plus_application(const atermpp::aterm& e)
1166 {
1167 return is_application(e) && is_plus_function_symbol(atermpp::down_cast<application>(e).head());
1168 }
1169
1172 inline
1174 {
1176 return add_with_carry_name;
1177 }
1178
1179 // This function is not intended for public use and therefore not documented in Doxygen.
1180 inline
1182 {
1183 sort_expression target_sort;
1184 if (s0 == nat() && s1 == nat())
1185 {
1186 target_sort = nat();
1187 }
1188 else if (s0 == sort_pos::pos() && s1 == sort_pos::pos())
1189 {
1190 target_sort = sort_pos::pos();
1191 }
1192 else
1193 {
1194 throw mcrl2::runtime_error("Cannot compute target sort for add_with_carry with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
1195 }
1196
1198 return add_with_carry;
1199 }
1200
1204 inline
1206 {
1207 if (is_function_symbol(e))
1208 {
1209 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
1210 return f.name() == add_with_carry_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 2 && (f == add_with_carry(nat(), nat()) || f == add_with_carry(sort_pos::pos(), sort_pos::pos()));
1211 }
1212 return false;
1213 }
1214
1216
1220 inline
1222 {
1223 return sort_nat::add_with_carry(arg0.sort(), arg1.sort())(arg0, arg1);
1224 }
1225
1228
1231 inline
1233 {
1234 make_application(result, sort_nat::add_with_carry(arg0.sort(), arg1.sort()),arg0, arg1);
1235 }
1236
1241 inline
1243 {
1244 return is_application(e) && is_add_with_carry_function_symbol(atermpp::down_cast<application>(e).head());
1245 }
1246
1249 inline
1251 {
1254 }
1255
1257
1259 inline
1261 {
1263 return auxiliary_plus_nat;
1264 }
1265
1269 inline
1271 {
1272 if (is_function_symbol(e))
1273 {
1274 return atermpp::down_cast<function_symbol>(e) == auxiliary_plus_nat();
1275 }
1276 return false;
1277 }
1278
1280
1284 inline
1286 {
1287 return sort_nat::auxiliary_plus_nat()(arg0, arg1);
1288 }
1289
1292
1295 inline
1297 {
1299 }
1300
1305 inline
1307 {
1308 return is_application(e) && is_auxiliary_plus_nat_function_symbol(atermpp::down_cast<application>(e).head());
1309 }
1310
1313 inline
1315 {
1317 return times_name;
1318 }
1319
1320 // This function is not intended for public use and therefore not documented in Doxygen.
1321 inline
1322 function_symbol times(const sort_expression& s0, const sort_expression& s1)
1323 {
1324 sort_expression target_sort;
1325 if (s0 == nat() && s1 == nat())
1326 {
1327 target_sort = nat();
1328 }
1329 else if (s0 == sort_pos::pos() && s1 == sort_pos::pos())
1330 {
1331 target_sort = sort_pos::pos();
1332 }
1333 else
1334 {
1335 throw mcrl2::runtime_error("Cannot compute target sort for times with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
1336 }
1337
1338 function_symbol times(times_name(), make_function_sort_(s0, s1, target_sort));
1339 return times;
1340 }
1341
1345 inline
1347 {
1348 if (is_function_symbol(e))
1349 {
1350 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
1351 return f.name() == times_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 2 && (f == times(nat(), nat()) || f == times(sort_pos::pos(), sort_pos::pos()));
1352 }
1353 return false;
1354 }
1355
1357
1361 inline
1362 application times(const data_expression& arg0, const data_expression& arg1)
1363 {
1364 return sort_nat::times(arg0.sort(), arg1.sort())(arg0, arg1);
1365 }
1366
1369
1372 inline
1373 void make_times(data_expression& result, const data_expression& arg0, const data_expression& arg1)
1374 {
1375 make_application(result, sort_nat::times(arg0.sort(), arg1.sort()),arg0, arg1);
1376 }
1377
1382 inline
1384 {
1385 return is_application(e) && is_times_function_symbol(atermpp::down_cast<application>(e).head());
1386 }
1387
1390 inline
1392 {
1394 return times_ordered_name;
1395 }
1396
1397 // This function is not intended for public use and therefore not documented in Doxygen.
1398 inline
1400 {
1401 sort_expression target_sort;
1402 if (s0 == nat() && s1 == nat())
1403 {
1404 target_sort = nat();
1405 }
1406 else if (s0 == sort_pos::pos() && s1 == sort_pos::pos())
1407 {
1408 target_sort = sort_pos::pos();
1409 }
1410 else
1411 {
1412 throw mcrl2::runtime_error("Cannot compute target sort for times_ordered with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
1413 }
1414
1416 return times_ordered;
1417 }
1418
1422 inline
1424 {
1425 if (is_function_symbol(e))
1426 {
1427 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
1428 return f.name() == times_ordered_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 2 && (f == times_ordered(nat(), nat()) || f == times_ordered(sort_pos::pos(), sort_pos::pos()));
1429 }
1430 return false;
1431 }
1432
1434
1438 inline
1440 {
1441 return sort_nat::times_ordered(arg0.sort(), arg1.sort())(arg0, arg1);
1442 }
1443
1446
1449 inline
1451 {
1452 make_application(result, sort_nat::times_ordered(arg0.sort(), arg1.sort()),arg0, arg1);
1453 }
1454
1459 inline
1461 {
1462 return is_application(e) && is_times_ordered_function_symbol(atermpp::down_cast<application>(e).head());
1463 }
1464
1467 inline
1469 {
1471 return times_overflow_name;
1472 }
1473
1474 // This function is not intended for public use and therefore not documented in Doxygen.
1475 inline
1477 {
1478 sort_expression target_sort;
1480 {
1481 target_sort = nat();
1482 }
1484 {
1485 target_sort = sort_pos::pos();
1486 }
1487 else
1488 {
1489 throw mcrl2::runtime_error("Cannot compute target sort for times_overflow with domain sorts " + pp(s0) + ", " + pp(s1) + ", " + pp(s2) + ". ");
1490 }
1491
1493 return times_overflow;
1494 }
1495
1499 inline
1501 {
1502 if (is_function_symbol(e))
1503 {
1504 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
1506 }
1507 return false;
1508 }
1509
1511
1516 inline
1518 {
1519 return sort_nat::times_overflow(arg0.sort(), arg1.sort(), arg2.sort())(arg0, arg1, arg2);
1520 }
1521
1524
1528 inline
1530 {
1532 }
1533
1538 inline
1540 {
1541 return is_application(e) && is_times_overflow_function_symbol(atermpp::down_cast<application>(e).head());
1542 }
1543
1546 inline
1548 {
1550 return div_name;
1551 }
1552
1554
1556 inline
1557 const function_symbol& div()
1558 {
1559 static function_symbol div(div_name(), make_function_sort_(nat(), sort_pos::pos(), nat()));
1560 return div;
1561 }
1562
1566 inline
1568 {
1569 if (is_function_symbol(e))
1570 {
1571 return atermpp::down_cast<function_symbol>(e) == div();
1572 }
1573 return false;
1574 }
1575
1577
1581 inline
1582 application div(const data_expression& arg0, const data_expression& arg1)
1583 {
1584 return sort_nat::div()(arg0, arg1);
1585 }
1586
1589
1592 inline
1593 void make_div(data_expression& result, const data_expression& arg0, const data_expression& arg1)
1594 {
1595 make_application(result, sort_nat::div(),arg0, arg1);
1596 }
1597
1602 inline
1603 bool is_div_application(const atermpp::aterm& e)
1604 {
1605 return is_application(e) && is_div_function_symbol(atermpp::down_cast<application>(e).head());
1606 }
1607
1610 inline
1612 {
1614 return mod_name;
1615 }
1616
1618
1620 inline
1621 const function_symbol& mod()
1622 {
1624 return mod;
1625 }
1626
1630 inline
1632 {
1633 if (is_function_symbol(e))
1634 {
1635 return atermpp::down_cast<function_symbol>(e) == mod();
1636 }
1637 return false;
1638 }
1639
1641
1645 inline
1646 application mod(const data_expression& arg0, const data_expression& arg1)
1647 {
1648 return sort_nat::mod()(arg0, arg1);
1649 }
1650
1653
1656 inline
1657 void make_mod(data_expression& result, const data_expression& arg0, const data_expression& arg1)
1658 {
1659 make_application(result, sort_nat::mod(),arg0, arg1);
1660 }
1661
1666 inline
1667 bool is_mod_application(const atermpp::aterm& e)
1668 {
1669 return is_application(e) && is_mod_function_symbol(atermpp::down_cast<application>(e).head());
1670 }
1671
1674 inline
1676 {
1678 return exp_name;
1679 }
1680
1681 // This function is not intended for public use and therefore not documented in Doxygen.
1682 inline
1683 function_symbol exp(const sort_expression& s0, const sort_expression& s1)
1684 {
1685 sort_expression target_sort;
1686 if (s0 == sort_pos::pos() && s1 == nat())
1687 {
1689 }
1690 else if (s0 == nat() && s1 == nat())
1691 {
1692 target_sort = nat();
1693 }
1694 else
1695 {
1696 throw mcrl2::runtime_error("Cannot compute target sort for exp with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
1697 }
1698
1699 function_symbol exp(exp_name(), make_function_sort_(s0, s1, target_sort));
1700 return exp;
1701 }
1702
1706 inline
1708 {
1709 if (is_function_symbol(e))
1710 {
1711 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
1712 return f.name() == exp_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 2 && (f == exp(sort_pos::pos(), nat()) || f == exp(nat(), nat()));
1713 }
1714 return false;
1715 }
1716
1718
1722 inline
1723 application exp(const data_expression& arg0, const data_expression& arg1)
1724 {
1725 return sort_nat::exp(arg0.sort(), arg1.sort())(arg0, arg1);
1726 }
1727
1730
1733 inline
1734 void make_exp(data_expression& result, const data_expression& arg0, const data_expression& arg1)
1735 {
1736 make_application(result, sort_nat::exp(arg0.sort(), arg1.sort()),arg0, arg1);
1737 }
1738
1743 inline
1744 bool is_exp_application(const atermpp::aterm& e)
1745 {
1746 return is_application(e) && is_exp_function_symbol(atermpp::down_cast<application>(e).head());
1747 }
1748
1751 inline
1753 {
1755 return sqrt_name;
1756 }
1757
1759
1761 inline
1762 const function_symbol& sqrt()
1763 {
1765 return sqrt;
1766 }
1767
1771 inline
1773 {
1774 if (is_function_symbol(e))
1775 {
1776 return atermpp::down_cast<function_symbol>(e) == sqrt();
1777 }
1778 return false;
1779 }
1780
1782
1785 inline
1786 application sqrt(const data_expression& arg0)
1787 {
1788 return sort_nat::sqrt()(arg0);
1789 }
1790
1793
1795 inline
1796 void make_sqrt(data_expression& result, const data_expression& arg0)
1797 {
1798 make_application(result, sort_nat::sqrt(),arg0);
1799 }
1800
1805 inline
1806 bool is_sqrt_application(const atermpp::aterm& e)
1807 {
1808 return is_application(e) && is_sqrt_function_symbol(atermpp::down_cast<application>(e).head());
1809 }
1810
1813 inline
1815 {
1817 return natpred_name;
1818 }
1819
1821
1823 inline
1825 {
1827 return natpred;
1828 }
1829
1833 inline
1835 {
1836 if (is_function_symbol(e))
1837 {
1838 return atermpp::down_cast<function_symbol>(e) == natpred();
1839 }
1840 return false;
1841 }
1842
1844
1847 inline
1849 {
1850 return sort_nat::natpred()(arg0);
1851 }
1852
1855
1857 inline
1859 {
1860 make_application(result, sort_nat::natpred(),arg0);
1861 }
1862
1867 inline
1869 {
1870 return is_application(e) && is_natpred_function_symbol(atermpp::down_cast<application>(e).head());
1871 }
1872
1875 inline
1877 {
1879 return is_odd_name;
1880 }
1881
1883
1885 inline
1887 {
1889 return is_odd;
1890 }
1891
1895 inline
1897 {
1898 if (is_function_symbol(e))
1899 {
1900 return atermpp::down_cast<function_symbol>(e) == is_odd();
1901 }
1902 return false;
1903 }
1904
1906
1909 inline
1911 {
1912 return sort_nat::is_odd()(arg0);
1913 }
1914
1917
1919 inline
1921 {
1922 make_application(result, sort_nat::is_odd(),arg0);
1923 }
1924
1929 inline
1931 {
1932 return is_application(e) && is_is_odd_function_symbol(atermpp::down_cast<application>(e).head());
1933 }
1934
1937 inline
1939 {
1941 return div2_name;
1942 }
1943
1945
1947 inline
1949 {
1951 return div2;
1952 }
1953
1957 inline
1959 {
1960 if (is_function_symbol(e))
1961 {
1962 return atermpp::down_cast<function_symbol>(e) == div2();
1963 }
1964 return false;
1965 }
1966
1968
1971 inline
1973 {
1974 return sort_nat::div2()(arg0);
1975 }
1976
1979
1981 inline
1982 void make_div2(data_expression& result, const data_expression& arg0)
1983 {
1984 make_application(result, sort_nat::div2(),arg0);
1985 }
1986
1991 inline
1993 {
1994 return is_application(e) && is_div2_function_symbol(atermpp::down_cast<application>(e).head());
1995 }
1996
1999 inline
2001 {
2003 return monus_name;
2004 }
2005
2007
2009 inline
2010 const function_symbol& monus()
2011 {
2012 static function_symbol monus(monus_name(), make_function_sort_(nat(), nat(), nat()));
2013 return monus;
2014 }
2015
2019 inline
2021 {
2022 if (is_function_symbol(e))
2023 {
2024 return atermpp::down_cast<function_symbol>(e) == monus();
2025 }
2026 return false;
2027 }
2028
2030
2034 inline
2035 application monus(const data_expression& arg0, const data_expression& arg1)
2036 {
2037 return sort_nat::monus()(arg0, arg1);
2038 }
2039
2042
2045 inline
2046 void make_monus(data_expression& result, const data_expression& arg0, const data_expression& arg1)
2047 {
2048 make_application(result, sort_nat::monus(),arg0, arg1);
2049 }
2050
2055 inline
2057 {
2058 return is_application(e) && is_monus_function_symbol(atermpp::down_cast<application>(e).head());
2059 }
2060
2063 inline
2065 {
2067 return monus_whr_name;
2068 }
2069
2071
2073 inline
2075 {
2077 return monus_whr;
2078 }
2079
2083 inline
2085 {
2086 if (is_function_symbol(e))
2087 {
2088 return atermpp::down_cast<function_symbol>(e) == monus_whr();
2089 }
2090 return false;
2091 }
2092
2094
2101 inline
2103 {
2104 return sort_nat::monus_whr()(arg0, arg1, arg2, arg3, arg4);
2105 }
2106
2109
2115 inline
2117 {
2119 }
2120
2125 inline
2127 {
2128 return is_application(e) && is_monus_whr_function_symbol(atermpp::down_cast<application>(e).head());
2129 }
2130
2133 inline
2135 {
2137 return exp_aux3p_name;
2138 }
2139
2141
2143 inline
2145 {
2147 return exp_aux3p;
2148 }
2149
2153 inline
2155 {
2156 if (is_function_symbol(e))
2157 {
2158 return atermpp::down_cast<function_symbol>(e) == exp_aux3p();
2159 }
2160 return false;
2161 }
2162
2164
2169 inline
2171 {
2172 return sort_nat::exp_aux3p()(arg0, arg1, arg2);
2173 }
2174
2177
2181 inline
2183 {
2185 }
2186
2191 inline
2193 {
2194 return is_application(e) && is_exp_aux3p_function_symbol(atermpp::down_cast<application>(e).head());
2195 }
2196
2199 inline
2201 {
2203 return exp_aux4p_name;
2204 }
2205
2207
2209 inline
2211 {
2213 return exp_aux4p;
2214 }
2215
2219 inline
2221 {
2222 if (is_function_symbol(e))
2223 {
2224 return atermpp::down_cast<function_symbol>(e) == exp_aux4p();
2225 }
2226 return false;
2227 }
2228
2230
2236 inline
2238 {
2239 return sort_nat::exp_aux4p()(arg0, arg1, arg2, arg3);
2240 }
2241
2244
2249 inline
2251 {
2253 }
2254
2259 inline
2261 {
2262 return is_application(e) && is_exp_aux4p_function_symbol(atermpp::down_cast<application>(e).head());
2263 }
2264
2267 inline
2269 {
2271 return exp_aux3n_name;
2272 }
2273
2275
2277 inline
2279 {
2281 return exp_aux3n;
2282 }
2283
2287 inline
2289 {
2290 if (is_function_symbol(e))
2291 {
2292 return atermpp::down_cast<function_symbol>(e) == exp_aux3n();
2293 }
2294 return false;
2295 }
2296
2298
2303 inline
2305 {
2306 return sort_nat::exp_aux3n()(arg0, arg1, arg2);
2307 }
2308
2311
2315 inline
2317 {
2319 }
2320
2325 inline
2327 {
2328 return is_application(e) && is_exp_aux3n_function_symbol(atermpp::down_cast<application>(e).head());
2329 }
2330
2333 inline
2335 {
2337 return exp_aux4n_name;
2338 }
2339
2341
2343 inline
2345 {
2347 return exp_aux4n;
2348 }
2349
2353 inline
2355 {
2356 if (is_function_symbol(e))
2357 {
2358 return atermpp::down_cast<function_symbol>(e) == exp_aux4n();
2359 }
2360 return false;
2361 }
2362
2364
2370 inline
2372 {
2373 return sort_nat::exp_aux4n()(arg0, arg1, arg2, arg3);
2374 }
2375
2378
2383 inline
2385 {
2387 }
2388
2393 inline
2395 {
2396 return is_application(e) && is_exp_aux4n_function_symbol(atermpp::down_cast<application>(e).head());
2397 }
2398
2401 inline
2403 {
2405 return exp_auxtruep_name;
2406 }
2407
2409
2411 inline
2413 {
2415 return exp_auxtruep;
2416 }
2417
2421 inline
2423 {
2424 if (is_function_symbol(e))
2425 {
2426 return atermpp::down_cast<function_symbol>(e) == exp_auxtruep();
2427 }
2428 return false;
2429 }
2430
2432
2437 inline
2439 {
2440 return sort_nat::exp_auxtruep()(arg0, arg1, arg2);
2441 }
2442
2445
2449 inline
2451 {
2453 }
2454
2459 inline
2461 {
2462 return is_application(e) && is_exp_auxtruep_function_symbol(atermpp::down_cast<application>(e).head());
2463 }
2464
2467 inline
2469 {
2471 return exp_auxtruen_name;
2472 }
2473
2475
2477 inline
2479 {
2481 return exp_auxtruen;
2482 }
2483
2487 inline
2489 {
2490 if (is_function_symbol(e))
2491 {
2492 return atermpp::down_cast<function_symbol>(e) == exp_auxtruen();
2493 }
2494 return false;
2495 }
2496
2498
2503 inline
2505 {
2506 return sort_nat::exp_auxtruen()(arg0, arg1, arg2);
2507 }
2508
2511
2515 inline
2517 {
2519 }
2520
2525 inline
2527 {
2528 return is_application(e) && is_exp_auxtruen_function_symbol(atermpp::down_cast<application>(e).head());
2529 }
2530
2533 inline
2535 {
2537 return exp_auxfalsep_name;
2538 }
2539
2541
2543 inline
2545 {
2547 return exp_auxfalsep;
2548 }
2549
2553 inline
2555 {
2556 if (is_function_symbol(e))
2557 {
2558 return atermpp::down_cast<function_symbol>(e) == exp_auxfalsep();
2559 }
2560 return false;
2561 }
2562
2564
2569 inline
2571 {
2572 return sort_nat::exp_auxfalsep()(arg0, arg1, arg2);
2573 }
2574
2577
2581 inline
2583 {
2585 }
2586
2591 inline
2593 {
2594 return is_application(e) && is_exp_auxfalsep_function_symbol(atermpp::down_cast<application>(e).head());
2595 }
2596
2599 inline
2601 {
2603 return exp_auxfalsen_name;
2604 }
2605
2607
2609 inline
2611 {
2613 return exp_auxfalsen;
2614 }
2615
2619 inline
2621 {
2622 if (is_function_symbol(e))
2623 {
2624 return atermpp::down_cast<function_symbol>(e) == exp_auxfalsen();
2625 }
2626 return false;
2627 }
2628
2630
2635 inline
2637 {
2638 return sort_nat::exp_auxfalsen()(arg0, arg1, arg2);
2639 }
2640
2643
2647 inline
2649 {
2651 }
2652
2657 inline
2659 {
2660 return is_application(e) && is_exp_auxfalsen_function_symbol(atermpp::down_cast<application>(e).head());
2661 }
2662
2665 inline
2667 {
2669 return div_bold_name;
2670 }
2671
2673
2675 inline
2677 {
2679 return div_bold;
2680 }
2681
2685 inline
2687 {
2688 if (is_function_symbol(e))
2689 {
2690 return atermpp::down_cast<function_symbol>(e) == div_bold();
2691 }
2692 return false;
2693 }
2694
2696
2700 inline
2702 {
2703 return sort_nat::div_bold()(arg0, arg1);
2704 }
2705
2708
2711 inline
2713 {
2714 make_application(result, sort_nat::div_bold(),arg0, arg1);
2715 }
2716
2721 inline
2723 {
2724 return is_application(e) && is_div_bold_function_symbol(atermpp::down_cast<application>(e).head());
2725 }
2726
2729 inline
2731 {
2733 return div_bold_whr_name;
2734 }
2735
2737
2739 inline
2741 {
2743 return div_bold_whr;
2744 }
2745
2749 inline
2751 {
2752 if (is_function_symbol(e))
2753 {
2754 return atermpp::down_cast<function_symbol>(e) == div_bold_whr();
2755 }
2756 return false;
2757 }
2758
2760
2768 inline
2770 {
2771 return sort_nat::div_bold_whr()(arg0, arg1, arg2, arg3, arg4, arg5);
2772 }
2773
2776
2783 inline
2785 {
2787 }
2788
2793 inline
2795 {
2796 return is_application(e) && is_div_bold_whr_function_symbol(atermpp::down_cast<application>(e).head());
2797 }
2798
2801 inline
2803 {
2805 return div_whr1_name;
2806 }
2807
2809
2811 inline
2813 {
2815 return div_whr1;
2816 }
2817
2821 inline
2823 {
2824 if (is_function_symbol(e))
2825 {
2826 return atermpp::down_cast<function_symbol>(e) == div_whr1();
2827 }
2828 return false;
2829 }
2830
2832
2838 inline
2840 {
2841 return sort_nat::div_whr1()(arg0, arg1, arg2, arg3);
2842 }
2843
2846
2851 inline
2853 {
2855 }
2856
2861 inline
2863 {
2864 return is_application(e) && is_div_whr1_function_symbol(atermpp::down_cast<application>(e).head());
2865 }
2866
2869 inline
2871 {
2873 return div_whr2_name;
2874 }
2875
2877
2879 inline
2881 {
2883 return div_whr2;
2884 }
2885
2889 inline
2891 {
2892 if (is_function_symbol(e))
2893 {
2894 return atermpp::down_cast<function_symbol>(e) == div_whr2();
2895 }
2896 return false;
2897 }
2898
2900
2907 inline
2909 {
2910 return sort_nat::div_whr2()(arg0, arg1, arg2, arg3, arg4);
2911 }
2912
2915
2921 inline
2923 {
2925 }
2926
2931 inline
2933 {
2934 return is_application(e) && is_div_whr2_function_symbol(atermpp::down_cast<application>(e).head());
2935 }
2936
2939 inline
2941 {
2943 return mod_whr1_name;
2944 }
2945
2947
2949 inline
2951 {
2953 return mod_whr1;
2954 }
2955
2959 inline
2961 {
2962 if (is_function_symbol(e))
2963 {
2964 return atermpp::down_cast<function_symbol>(e) == mod_whr1();
2965 }
2966 return false;
2967 }
2968
2970
2976 inline
2978 {
2979 return sort_nat::mod_whr1()(arg0, arg1, arg2, arg3);
2980 }
2981
2984
2989 inline
2991 {
2993 }
2994
2999 inline
3001 {
3002 return is_application(e) && is_mod_whr1_function_symbol(atermpp::down_cast<application>(e).head());
3003 }
3004
3007 inline
3009 {
3011 return divmod_aux_name;
3012 }
3013
3015
3017 inline
3019 {
3021 return divmod_aux;
3022 }
3023
3027 inline
3029 {
3030 if (is_function_symbol(e))
3031 {
3032 return atermpp::down_cast<function_symbol>(e) == divmod_aux();
3033 }
3034 return false;
3035 }
3036
3038
3042 inline
3044 {
3045 return sort_nat::divmod_aux()(arg0, arg1);
3046 }
3047
3050
3053 inline
3055 {
3057 }
3058
3063 inline
3065 {
3066 return is_application(e) && is_divmod_aux_function_symbol(atermpp::down_cast<application>(e).head());
3067 }
3068
3071 inline
3073 {
3075 return divmod_aux_whr1_name;
3076 }
3077
3079
3081 inline
3083 {
3085 return divmod_aux_whr1;
3086 }
3087
3091 inline
3093 {
3094 if (is_function_symbol(e))
3095 {
3096 return atermpp::down_cast<function_symbol>(e) == divmod_aux_whr1();
3097 }
3098 return false;
3099 }
3100
3102
3108 inline
3110 {
3111 return sort_nat::divmod_aux_whr1()(arg0, arg1, arg2, arg3);
3112 }
3113
3116
3121 inline
3123 {
3125 }
3126
3131 inline
3133 {
3134 return is_application(e) && is_divmod_aux_whr1_function_symbol(atermpp::down_cast<application>(e).head());
3135 }
3136
3139 inline
3141 {
3143 return divmod_aux_whr2_name;
3144 }
3145
3147
3149 inline
3151 {
3153 return divmod_aux_whr2;
3154 }
3155
3159 inline
3161 {
3162 if (is_function_symbol(e))
3163 {
3164 return atermpp::down_cast<function_symbol>(e) == divmod_aux_whr2();
3165 }
3166 return false;
3167 }
3168
3170
3177 inline
3179 {
3180 return sort_nat::divmod_aux_whr2()(arg0, arg1, arg2, arg3, arg4);
3181 }
3182
3185
3191 inline
3193 {
3195 }
3196
3201 inline
3203 {
3204 return is_application(e) && is_divmod_aux_whr2_function_symbol(atermpp::down_cast<application>(e).head());
3205 }
3206
3209 inline
3211 {
3213 return divmod_aux_whr3_name;
3214 }
3215
3217
3219 inline
3221 {
3223 return divmod_aux_whr3;
3224 }
3225
3229 inline
3231 {
3232 if (is_function_symbol(e))
3233 {
3234 return atermpp::down_cast<function_symbol>(e) == divmod_aux_whr3();
3235 }
3236 return false;
3237 }
3238
3240
3247 inline
3249 {
3250 return sort_nat::divmod_aux_whr3()(arg0, arg1, arg2, arg3, arg4);
3251 }
3252
3255
3261 inline
3263 {
3265 }
3266
3271 inline
3273 {
3274 return is_application(e) && is_divmod_aux_whr3_function_symbol(atermpp::down_cast<application>(e).head());
3275 }
3276
3279 inline
3281 {
3283 return divmod_aux_whr4_name;
3284 }
3285
3287
3289 inline
3291 {
3293 return divmod_aux_whr4;
3294 }
3295
3299 inline
3301 {
3302 if (is_function_symbol(e))
3303 {
3304 return atermpp::down_cast<function_symbol>(e) == divmod_aux_whr4();
3305 }
3306 return false;
3307 }
3308
3310
3316 inline
3318 {
3319 return sort_nat::divmod_aux_whr4()(arg0, arg1, arg2, arg3);
3320 }
3321
3324
3329 inline
3331 {
3333 }
3334
3339 inline
3341 {
3342 return is_application(e) && is_divmod_aux_whr4_function_symbol(atermpp::down_cast<application>(e).head());
3343 }
3344
3347 inline
3349 {
3351 return divmod_aux_whr5_name;
3352 }
3353
3355
3357 inline
3359 {
3361 return divmod_aux_whr5;
3362 }
3363
3367 inline
3369 {
3370 if (is_function_symbol(e))
3371 {
3372 return atermpp::down_cast<function_symbol>(e) == divmod_aux_whr5();
3373 }
3374 return false;
3375 }
3376
3378
3384 inline
3386 {
3387 return sort_nat::divmod_aux_whr5()(arg0, arg1, arg2, arg3);
3388 }
3389
3392
3397 inline
3399 {
3401 }
3402
3407 inline
3409 {
3410 return is_application(e) && is_divmod_aux_whr5_function_symbol(atermpp::down_cast<application>(e).head());
3411 }
3412
3415 inline
3417 {
3419 return divmod_aux_whr6_name;
3420 }
3421
3423
3425 inline
3427 {
3429 return divmod_aux_whr6;
3430 }
3431
3435 inline
3437 {
3438 if (is_function_symbol(e))
3439 {
3440 return atermpp::down_cast<function_symbol>(e) == divmod_aux_whr6();
3441 }
3442 return false;
3443 }
3444
3446
3453 inline
3455 {
3456 return sort_nat::divmod_aux_whr6()(arg0, arg1, arg2, arg3, arg4);
3457 }
3458
3461
3467 inline
3469 {
3471 }
3472
3477 inline
3479 {
3480 return is_application(e) && is_divmod_aux_whr6_function_symbol(atermpp::down_cast<application>(e).head());
3481 }
3482
3485 inline
3487 {
3489 return msd_name;
3490 }
3491
3493
3495 inline
3497 {
3499 return msd;
3500 }
3501
3505 inline
3507 {
3508 if (is_function_symbol(e))
3509 {
3510 return atermpp::down_cast<function_symbol>(e) == msd();
3511 }
3512 return false;
3513 }
3514
3516
3519 inline
3521 {
3522 return sort_nat::msd()(arg0);
3523 }
3524
3527
3529 inline
3530 void make_msd(data_expression& result, const data_expression& arg0)
3531 {
3532 make_application(result, sort_nat::msd(),arg0);
3533 }
3534
3539 inline
3541 {
3542 return is_application(e) && is_msd_function_symbol(atermpp::down_cast<application>(e).head());
3543 }
3544
3547 inline
3549 {
3551 return swap_zero_name;
3552 }
3553
3555
3557 inline
3558 const function_symbol& swap_zero()
3559 {
3560 static function_symbol swap_zero(swap_zero_name(), make_function_sort_(nat(), nat(), nat()));
3561 return swap_zero;
3562 }
3563
3567 inline
3569 {
3570 if (is_function_symbol(e))
3571 {
3572 return atermpp::down_cast<function_symbol>(e) == swap_zero();
3573 }
3574 return false;
3575 }
3576
3578
3582 inline
3583 application swap_zero(const data_expression& arg0, const data_expression& arg1)
3584 {
3585 return sort_nat::swap_zero()(arg0, arg1);
3586 }
3587
3590
3593 inline
3594 void make_swap_zero(data_expression& result, const data_expression& arg0, const data_expression& arg1)
3595 {
3596 make_application(result, sort_nat::swap_zero(),arg0, arg1);
3597 }
3598
3603 inline
3605 {
3606 return is_application(e) && is_swap_zero_function_symbol(atermpp::down_cast<application>(e).head());
3607 }
3608
3611 inline
3613 {
3615 return swap_zero_add_name;
3616 }
3617
3619
3621 inline
3623 {
3625 return swap_zero_add;
3626 }
3627
3631 inline
3633 {
3634 if (is_function_symbol(e))
3635 {
3636 return atermpp::down_cast<function_symbol>(e) == swap_zero_add();
3637 }
3638 return false;
3639 }
3640
3642
3648 inline
3649 application swap_zero_add(const data_expression& arg0, const data_expression& arg1, const data_expression& arg2, const data_expression& arg3)
3650 {
3651 return sort_nat::swap_zero_add()(arg0, arg1, arg2, arg3);
3652 }
3653
3656
3661 inline
3662 void make_swap_zero_add(data_expression& result, const data_expression& arg0, const data_expression& arg1, const data_expression& arg2, const data_expression& arg3)
3663 {
3665 }
3666
3671 inline
3673 {
3674 return is_application(e) && is_swap_zero_add_function_symbol(atermpp::down_cast<application>(e).head());
3675 }
3676
3679 inline
3681 {
3683 return swap_zero_min_name;
3684 }
3685
3687
3689 inline
3691 {
3693 return swap_zero_min;
3694 }
3695
3699 inline
3701 {
3702 if (is_function_symbol(e))
3703 {
3704 return atermpp::down_cast<function_symbol>(e) == swap_zero_min();
3705 }
3706 return false;
3707 }
3708
3710
3716 inline
3717 application swap_zero_min(const data_expression& arg0, const data_expression& arg1, const data_expression& arg2, const data_expression& arg3)
3718 {
3719 return sort_nat::swap_zero_min()(arg0, arg1, arg2, arg3);
3720 }
3721
3724
3729 inline
3730 void make_swap_zero_min(data_expression& result, const data_expression& arg0, const data_expression& arg1, const data_expression& arg2, const data_expression& arg3)
3731 {
3733 }
3734
3739 inline
3741 {
3742 return is_application(e) && is_swap_zero_min_function_symbol(atermpp::down_cast<application>(e).head());
3743 }
3744
3747 inline
3749 {
3751 return swap_zero_monus_name;
3752 }
3753
3755
3757 inline
3759 {
3761 return swap_zero_monus;
3762 }
3763
3767 inline
3769 {
3770 if (is_function_symbol(e))
3771 {
3772 return atermpp::down_cast<function_symbol>(e) == swap_zero_monus();
3773 }
3774 return false;
3775 }
3776
3778
3784 inline
3785 application swap_zero_monus(const data_expression& arg0, const data_expression& arg1, const data_expression& arg2, const data_expression& arg3)
3786 {
3787 return sort_nat::swap_zero_monus()(arg0, arg1, arg2, arg3);
3788 }
3789
3792
3797 inline
3798 void make_swap_zero_monus(data_expression& result, const data_expression& arg0, const data_expression& arg1, const data_expression& arg2, const data_expression& arg3)
3799 {
3801 }
3802
3807 inline
3809 {
3810 return is_application(e) && is_swap_zero_monus_function_symbol(atermpp::down_cast<application>(e).head());
3811 }
3812
3815 inline
3817 {
3819 return sqrt_whr1_name;
3820 }
3821
3823
3825 inline
3827 {
3829 return sqrt_whr1;
3830 }
3831
3835 inline
3837 {
3838 if (is_function_symbol(e))
3839 {
3840 return atermpp::down_cast<function_symbol>(e) == sqrt_whr1();
3841 }
3842 return false;
3843 }
3844
3846
3852 inline
3854 {
3855 return sort_nat::sqrt_whr1()(arg0, arg1, arg2, arg3);
3856 }
3857
3860
3865 inline
3867 {
3869 }
3870
3875 inline
3877 {
3878 return is_application(e) && is_sqrt_whr1_function_symbol(atermpp::down_cast<application>(e).head());
3879 }
3880
3883 inline
3885 {
3887 return sqrt_whr2_name;
3888 }
3889
3891
3893 inline
3895 {
3897 return sqrt_whr2;
3898 }
3899
3903 inline
3905 {
3906 if (is_function_symbol(e))
3907 {
3908 return atermpp::down_cast<function_symbol>(e) == sqrt_whr2();
3909 }
3910 return false;
3911 }
3912
3914
3921 inline
3923 {
3924 return sort_nat::sqrt_whr2()(arg0, arg1, arg2, arg3, arg4);
3925 }
3926
3929
3935 inline
3937 {
3939 }
3940
3945 inline
3947 {
3948 return is_application(e) && is_sqrt_whr2_function_symbol(atermpp::down_cast<application>(e).head());
3949 }
3950
3953 inline
3955 {
3957 return sqrt_pair_name;
3958 }
3959
3961
3963 inline
3965 {
3967 return sqrt_pair;
3968 }
3969
3973 inline
3975 {
3976 if (is_function_symbol(e))
3977 {
3978 return atermpp::down_cast<function_symbol>(e) == sqrt_pair();
3979 }
3980 return false;
3981 }
3982
3984
3987 inline
3989 {
3990 return sort_nat::sqrt_pair()(arg0);
3991 }
3992
3995
3997 inline
3999 {
4000 make_application(result, sort_nat::sqrt_pair(),arg0);
4001 }
4002
4007 inline
4009 {
4010 return is_application(e) && is_sqrt_pair_function_symbol(atermpp::down_cast<application>(e).head());
4011 }
4012
4015 inline
4017 {
4019 return sqrt_pair_whr1_name;
4020 }
4021
4023
4025 inline
4027 {
4029 return sqrt_pair_whr1;
4030 }
4031
4035 inline
4037 {
4038 if (is_function_symbol(e))
4039 {
4040 return atermpp::down_cast<function_symbol>(e) == sqrt_pair_whr1();
4041 }
4042 return false;
4043 }
4044
4046
4052 inline
4054 {
4055 return sort_nat::sqrt_pair_whr1()(arg0, arg1, arg2, arg3);
4056 }
4057
4060
4065 inline
4067 {
4069 }
4070
4075 inline
4077 {
4078 return is_application(e) && is_sqrt_pair_whr1_function_symbol(atermpp::down_cast<application>(e).head());
4079 }
4080
4083 inline
4085 {
4087 return sqrt_pair_whr2_name;
4088 }
4089
4091
4093 inline
4095 {
4097 return sqrt_pair_whr2;
4098 }
4099
4103 inline
4105 {
4106 if (is_function_symbol(e))
4107 {
4108 return atermpp::down_cast<function_symbol>(e) == sqrt_pair_whr2();
4109 }
4110 return false;
4111 }
4112
4114
4121 inline
4123 {
4124 return sort_nat::sqrt_pair_whr2()(arg0, arg1, arg2, arg3, arg4);
4125 }
4126
4129
4135 inline
4137 {
4139 }
4140
4145 inline
4147 {
4148 return is_application(e) && is_sqrt_pair_whr2_function_symbol(atermpp::down_cast<application>(e).head());
4149 }
4150
4153 inline
4155 {
4157 return sqrt_pair_whr3_name;
4158 }
4159
4161
4163 inline
4165 {
4167 return sqrt_pair_whr3;
4168 }
4169
4173 inline
4175 {
4176 if (is_function_symbol(e))
4177 {
4178 return atermpp::down_cast<function_symbol>(e) == sqrt_pair_whr3();
4179 }
4180 return false;
4181 }
4182
4184
4189 inline
4191 {
4192 return sort_nat::sqrt_pair_whr3()(arg0, arg1, arg2);
4193 }
4194
4197
4201 inline
4203 {
4205 }
4206
4211 inline
4213 {
4214 return is_application(e) && is_sqrt_pair_whr3_function_symbol(atermpp::down_cast<application>(e).head());
4215 }
4216
4219 inline
4221 {
4223 return sqrt_pair_whr4_name;
4224 }
4225
4227
4229 inline
4231 {
4233 return sqrt_pair_whr4;
4234 }
4235
4239 inline
4241 {
4242 if (is_function_symbol(e))
4243 {
4244 return atermpp::down_cast<function_symbol>(e) == sqrt_pair_whr4();
4245 }
4246 return false;
4247 }
4248
4250
4258 inline
4260 {
4261 return sort_nat::sqrt_pair_whr4()(arg0, arg1, arg2, arg3, arg4, arg5);
4262 }
4263
4266
4273 inline
4275 {
4277 }
4278
4283 inline
4285 {
4286 return is_application(e) && is_sqrt_pair_whr4_function_symbol(atermpp::down_cast<application>(e).head());
4287 }
4288
4291 inline
4293 {
4295 return sqrt_pair_whr5_name;
4296 }
4297
4299
4301 inline
4303 {
4305 return sqrt_pair_whr5;
4306 }
4307
4311 inline
4313 {
4314 if (is_function_symbol(e))
4315 {
4316 return atermpp::down_cast<function_symbol>(e) == sqrt_pair_whr5();
4317 }
4318 return false;
4319 }
4320
4322
4329 inline
4331 {
4332 return sort_nat::sqrt_pair_whr5()(arg0, arg1, arg2, arg3, arg4);
4333 }
4334
4337
4343 inline
4345 {
4347 }
4348
4353 inline
4355 {
4356 return is_application(e) && is_sqrt_pair_whr5_function_symbol(atermpp::down_cast<application>(e).head());
4357 }
4358
4361 inline
4363 {
4365 return sqrt_pair_whr6_name;
4366 }
4367
4369
4371 inline
4373 {
4375 return sqrt_pair_whr6;
4376 }
4377
4381 inline
4383 {
4384 if (is_function_symbol(e))
4385 {
4386 return atermpp::down_cast<function_symbol>(e) == sqrt_pair_whr6();
4387 }
4388 return false;
4389 }
4390
4392
4397 inline
4399 {
4400 return sort_nat::sqrt_pair_whr6()(arg0, arg1, arg2);
4401 }
4402
4405
4409 inline
4411 {
4413 }
4414
4419 inline
4421 {
4422 return is_application(e) && is_sqrt_pair_whr6_function_symbol(atermpp::down_cast<application>(e).head());
4423 }
4424
4427 inline
4429 {
4431 return first_name;
4432 }
4433
4435
4437 inline
4438 const function_symbol& first()
4439 {
4440 static function_symbol first(first_name(), make_function_sort_(natnatpair(), nat()));
4441 return first;
4442 }
4443
4447 inline
4449 {
4450 if (is_function_symbol(e))
4451 {
4452 return atermpp::down_cast<function_symbol>(e) == first();
4453 }
4454 return false;
4455 }
4456
4458
4461 inline
4462 application first(const data_expression& arg0)
4463 {
4464 return sort_nat::first()(arg0);
4465 }
4466
4469
4471 inline
4472 void make_first(data_expression& result, const data_expression& arg0)
4473 {
4474 make_application(result, sort_nat::first(),arg0);
4475 }
4476
4481 inline
4483 {
4484 return is_application(e) && is_first_function_symbol(atermpp::down_cast<application>(e).head());
4485 }
4486
4489 inline
4491 {
4493 return last_name;
4494 }
4495
4497
4499 inline
4500 const function_symbol& last()
4501 {
4503 return last;
4504 }
4505
4509 inline
4511 {
4512 if (is_function_symbol(e))
4513 {
4514 return atermpp::down_cast<function_symbol>(e) == last();
4515 }
4516 return false;
4517 }
4518
4520
4523 inline
4524 application last(const data_expression& arg0)
4525 {
4526 return sort_nat::last()(arg0);
4527 }
4528
4531
4533 inline
4534 void make_last(data_expression& result, const data_expression& arg0)
4535 {
4536 make_application(result, sort_nat::last(),arg0);
4537 }
4538
4543 inline
4544 bool is_last_application(const atermpp::aterm& e)
4545 {
4546 return is_application(e) && is_last_function_symbol(atermpp::down_cast<application>(e).head());
4547 }
4550 inline
4552 {
4554 result.push_back(sort_nat::most_significant_digit_nat());
4556 result.push_back(sort_nat::equals_zero());
4557 result.push_back(sort_nat::not_equals_zero());
4558 result.push_back(sort_nat::equals_one(nat()));
4559 result.push_back(sort_nat::pos2nat());
4560 result.push_back(sort_nat::nat2pos());
4561 result.push_back(sort_nat::succ(nat()));
4562 result.push_back(sort_nat::maximum(sort_pos::pos(), nat()));
4563 result.push_back(sort_nat::maximum(nat(), sort_pos::pos()));
4564 result.push_back(sort_nat::maximum(nat(), nat()));
4565 result.push_back(sort_nat::minimum(nat(), nat()));
4566 result.push_back(sort_nat::pred());
4567 result.push_back(sort_nat::pred_whr());
4568 result.push_back(sort_nat::plus(sort_pos::pos(), nat()));
4569 result.push_back(sort_nat::plus(nat(), sort_pos::pos()));
4570 result.push_back(sort_nat::plus(nat(), nat()));
4571 result.push_back(sort_nat::add_with_carry(nat(), nat()));
4572 result.push_back(sort_nat::auxiliary_plus_nat());
4573 result.push_back(sort_nat::times(nat(), nat()));
4574 result.push_back(sort_nat::times_ordered(nat(), nat()));
4576 result.push_back(sort_nat::div());
4577 result.push_back(sort_nat::mod());
4578 result.push_back(sort_nat::exp(sort_pos::pos(), nat()));
4579 result.push_back(sort_nat::exp(nat(), nat()));
4580 result.push_back(sort_nat::sqrt());
4581 result.push_back(sort_nat::natpred());
4582 result.push_back(sort_nat::is_odd());
4583 result.push_back(sort_nat::div2());
4584 result.push_back(sort_nat::monus());
4585 result.push_back(sort_nat::monus_whr());
4586 result.push_back(sort_nat::exp_aux3p());
4587 result.push_back(sort_nat::exp_aux4p());
4588 result.push_back(sort_nat::exp_aux3n());
4589 result.push_back(sort_nat::exp_aux4n());
4590 result.push_back(sort_nat::exp_auxtruep());
4591 result.push_back(sort_nat::exp_auxtruen());
4592 result.push_back(sort_nat::exp_auxfalsep());
4593 result.push_back(sort_nat::exp_auxfalsen());
4594 result.push_back(sort_nat::div_bold());
4595 result.push_back(sort_nat::div_bold_whr());
4596 result.push_back(sort_nat::div_whr1());
4597 result.push_back(sort_nat::div_whr2());
4598 result.push_back(sort_nat::mod_whr1());
4599 result.push_back(sort_nat::divmod_aux());
4600 result.push_back(sort_nat::divmod_aux_whr1());
4601 result.push_back(sort_nat::divmod_aux_whr2());
4602 result.push_back(sort_nat::divmod_aux_whr3());
4603 result.push_back(sort_nat::divmod_aux_whr4());
4604 result.push_back(sort_nat::divmod_aux_whr5());
4605 result.push_back(sort_nat::divmod_aux_whr6());
4606 result.push_back(sort_nat::msd());
4607 result.push_back(sort_nat::swap_zero());
4608 result.push_back(sort_nat::swap_zero_add());
4609 result.push_back(sort_nat::swap_zero_min());
4610 result.push_back(sort_nat::swap_zero_monus());
4611 result.push_back(sort_nat::sqrt_whr1());
4612 result.push_back(sort_nat::sqrt_whr2());
4613 result.push_back(sort_nat::sqrt_pair());
4614 result.push_back(sort_nat::sqrt_pair_whr1());
4615 result.push_back(sort_nat::sqrt_pair_whr2());
4616 result.push_back(sort_nat::sqrt_pair_whr3());
4617 result.push_back(sort_nat::sqrt_pair_whr4());
4618 result.push_back(sort_nat::sqrt_pair_whr5());
4619 result.push_back(sort_nat::sqrt_pair_whr6());
4620 result.push_back(sort_nat::first());
4621 result.push_back(sort_nat::last());
4622 return result;
4623 }
4624
4627 inline
4629 {
4631 for(const function_symbol& f: nat_generate_constructors_code())
4632 {
4633 result.push_back(f);
4634 }
4635 return result;
4636 }
4637
4640 inline
4642 {
4644 result.push_back(sort_nat::most_significant_digit_nat());
4646 result.push_back(sort_nat::equals_zero());
4647 result.push_back(sort_nat::not_equals_zero());
4648 result.push_back(sort_nat::equals_one(nat()));
4649 result.push_back(sort_nat::pos2nat());
4650 result.push_back(sort_nat::nat2pos());
4651 result.push_back(sort_nat::succ(nat()));
4652 result.push_back(sort_nat::maximum(sort_pos::pos(), nat()));
4653 result.push_back(sort_nat::maximum(nat(), sort_pos::pos()));
4654 result.push_back(sort_nat::maximum(nat(), nat()));
4655 result.push_back(sort_nat::minimum(nat(), nat()));
4656 result.push_back(sort_nat::pred());
4657 result.push_back(sort_nat::pred_whr());
4658 result.push_back(sort_nat::plus(sort_pos::pos(), nat()));
4659 result.push_back(sort_nat::plus(nat(), sort_pos::pos()));
4660 result.push_back(sort_nat::plus(nat(), nat()));
4661 result.push_back(sort_nat::add_with_carry(nat(), nat()));
4662 result.push_back(sort_nat::auxiliary_plus_nat());
4663 result.push_back(sort_nat::times(nat(), nat()));
4664 result.push_back(sort_nat::times_ordered(nat(), nat()));
4666 result.push_back(sort_nat::div());
4667 result.push_back(sort_nat::mod());
4668 result.push_back(sort_nat::exp(sort_pos::pos(), nat()));
4669 result.push_back(sort_nat::exp(nat(), nat()));
4670 result.push_back(sort_nat::sqrt());
4671 result.push_back(sort_nat::natpred());
4672 result.push_back(sort_nat::is_odd());
4673 result.push_back(sort_nat::div2());
4674 result.push_back(sort_nat::monus());
4675 result.push_back(sort_nat::monus_whr());
4676 result.push_back(sort_nat::exp_aux3p());
4677 result.push_back(sort_nat::exp_aux4p());
4678 result.push_back(sort_nat::exp_aux3n());
4679 result.push_back(sort_nat::exp_aux4n());
4680 result.push_back(sort_nat::exp_auxtruep());
4681 result.push_back(sort_nat::exp_auxtruen());
4682 result.push_back(sort_nat::exp_auxfalsep());
4683 result.push_back(sort_nat::exp_auxfalsen());
4684 result.push_back(sort_nat::div_bold());
4685 result.push_back(sort_nat::div_bold_whr());
4686 result.push_back(sort_nat::div_whr1());
4687 result.push_back(sort_nat::div_whr2());
4688 result.push_back(sort_nat::mod_whr1());
4689 result.push_back(sort_nat::divmod_aux());
4690 result.push_back(sort_nat::divmod_aux_whr1());
4691 result.push_back(sort_nat::divmod_aux_whr2());
4692 result.push_back(sort_nat::divmod_aux_whr3());
4693 result.push_back(sort_nat::divmod_aux_whr4());
4694 result.push_back(sort_nat::divmod_aux_whr5());
4695 result.push_back(sort_nat::divmod_aux_whr6());
4696 result.push_back(sort_nat::msd());
4697 result.push_back(sort_nat::swap_zero());
4698 result.push_back(sort_nat::swap_zero_add());
4699 result.push_back(sort_nat::swap_zero_min());
4700 result.push_back(sort_nat::swap_zero_monus());
4701 result.push_back(sort_nat::sqrt_whr1());
4702 result.push_back(sort_nat::sqrt_whr2());
4703 result.push_back(sort_nat::sqrt_pair());
4704 result.push_back(sort_nat::sqrt_pair_whr1());
4705 result.push_back(sort_nat::sqrt_pair_whr2());
4706 result.push_back(sort_nat::sqrt_pair_whr3());
4707 result.push_back(sort_nat::sqrt_pair_whr4());
4708 result.push_back(sort_nat::sqrt_pair_whr5());
4709 result.push_back(sort_nat::sqrt_pair_whr6());
4710 result.push_back(sort_nat::first());
4711 result.push_back(sort_nat::last());
4712 return result;
4713 }
4714
4715
4716 // 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
4717 typedef std::map<function_symbol,std::pair<std::function<void(data_expression&, const data_expression&)>, std::string> > implementation_map;
4720 inline
4722 {
4723 implementation_map result;
4724 return result;
4725 }
4731 inline
4732 const data_expression& arg(const data_expression& e)
4733 {
4735 return atermpp::down_cast<application>(e)[0];
4736 }
4737
4743 inline
4744 const data_expression& arg1(const data_expression& e)
4745 {
4747 return atermpp::down_cast<application>(e)[0];
4748 }
4749
4755 inline
4756 const data_expression& arg2(const data_expression& e)
4757 {
4759 return atermpp::down_cast<application>(e)[1];
4760 }
4761
4767 inline
4768 const data_expression& left(const data_expression& e)
4769 {
4771 return atermpp::down_cast<application>(e)[0];
4772 }
4773
4779 inline
4780 const data_expression& right(const data_expression& e)
4781 {
4783 return atermpp::down_cast<application>(e)[1];
4784 }
4785
4791 inline
4792 const data_expression& arg3(const data_expression& e)
4793 {
4795 return atermpp::down_cast<application>(e)[2];
4796 }
4797
4803 inline
4804 const data_expression& arg4(const data_expression& e)
4805 {
4807 return atermpp::down_cast<application>(e)[3];
4808 }
4809
4815 inline
4817 {
4819 return atermpp::down_cast<application>(e)[4];
4820 }
4821
4827 inline
4829 {
4831 return atermpp::down_cast<application>(e)[5];
4832 }
4833
4836 inline
4838 {
4839 variable vb("b",sort_bool::bool_());
4840 variable vp("p",sort_pos::pos());
4841 variable vp1("p1",sort_pos::pos());
4842 variable vp2("p2",sort_pos::pos());
4843 variable vn("n",nat());
4844 variable vn1("n1",nat());
4845 variable vn2("n2",nat());
4846 variable vm("m",nat());
4847 variable vm1("m1",nat());
4848 variable vm2("m2",nat());
4849 variable vm3("m3",nat());
4850 variable vm4("m4",nat());
4851 variable vm5("m5",nat());
4852 variable vpredp("predp",nat());
4853 variable vdiff("diff",nat());
4854 variable vshift_n1("shift_n1",nat());
4855 variable vsolution("solution",nat());
4856 variable vpq("pq",nat());
4857 variable vy("y",nat());
4858 variable vy_guess("y_guess",nat());
4859 variable vpair_("pair_",natnatpair());
4860 variable vlp("lp",nat());
4866 variable vshift_w("shift_w",sort_machine_word::machine_word());
4867 variable voverflow("overflow",sort_machine_word::machine_word());
4868
4869 data_equation_vector result;
4872 result.push_back(data_equation(variable_list({vn, vw}), equals_zero(concat_digit(vn, vw)), sort_bool::false_()));
4874 result.push_back(data_equation(variable_list({vn, vw}), not_equals_zero(concat_digit(vn, vw)), sort_bool::true_()));
4875 result.push_back(data_equation(variable_list({vw}), equals_one(most_significant_digit_nat(vw)), sort_machine_word::equals_one_word(vw)));
4876 result.push_back(data_equation(variable_list({vn, vw}), equals_one(concat_digit(vn, vw)), sort_bool::false_()));
4881 result.push_back(data_equation(variable_list({vw1, vw2}), equal_to(most_significant_digit_nat(vw1), most_significant_digit_nat(vw2)), sort_machine_word::equal_word(vw1, vw2)));
4882 result.push_back(data_equation(variable_list({vn, vw1, vw2}), equal_to(concat_digit(vn, vw1), most_significant_digit_nat(vw2)), sort_bool::false_()));
4883 result.push_back(data_equation(variable_list({vn, vw1, vw2}), equal_to(most_significant_digit_nat(vw1), concat_digit(vn, vw2)), sort_bool::false_()));
4884 result.push_back(data_equation(variable_list({vn1, vn2, vw1, vw2}), equal_to(concat_digit(vn1, vw1), concat_digit(vn2, vw2)), sort_bool::and_(sort_machine_word::equal_word(vw1, vw2), equal_to(vn1, vn2))));
4885 result.push_back(data_equation(variable_list({vn1, vn2}), equal_to(succ_nat(vn1), vn2), sort_bool::and_(not_equals_zero(vn2), equal_to(vn1, natpred(vn2)))));
4886 result.push_back(data_equation(variable_list({vn1, vn2}), equal_to(vn1, succ_nat(vn2)), sort_bool::and_(not_equals_zero(vn1), equal_to(natpred(vn1), vn2))));
4887 result.push_back(data_equation(variable_list({vw1, vw2}), less(most_significant_digit_nat(vw1), most_significant_digit_nat(vw2)), sort_machine_word::less_word(vw1, vw2)));
4888 result.push_back(data_equation(variable_list({vn, vw1, vw2}), less(concat_digit(vn, vw1), most_significant_digit_nat(vw2)), sort_bool::false_()));
4889 result.push_back(data_equation(variable_list({vn, vw1, vw2}), less(most_significant_digit_nat(vw1), concat_digit(vn, vw2)), sort_bool::true_()));
4890 result.push_back(data_equation(variable_list({vn1, vn2, vw1, vw2}), less(concat_digit(vn1, vw1), concat_digit(vn2, vw2)), if_(sort_machine_word::less_word(vw1, vw2), less_equal(vn1, vn2), less(vn1, vn2))));
4891 result.push_back(data_equation(variable_list({vn1, vn2}), less(succ_nat(vn1), vn2), sort_bool::and_(less(most_significant_digit_nat(sort_machine_word::one_word()), vn2), less(vn1, natpred(vn2)))));
4892 result.push_back(data_equation(variable_list({vn1, vn2}), less(vn1, succ_nat(vn2)), less_equal(vn1, vn2)));
4893 result.push_back(data_equation(variable_list({vn, vw1}), sort_machine_word::equals_zero_word(vw1), less(vn, most_significant_digit_nat(vw1)), sort_bool::false_()));
4894 result.push_back(data_equation(variable_list({vw1, vw2}), less_equal(most_significant_digit_nat(vw1), most_significant_digit_nat(vw2)), sort_machine_word::less_equal_word(vw1, vw2)));
4895 result.push_back(data_equation(variable_list({vn, vw1, vw2}), less_equal(concat_digit(vn, vw1), most_significant_digit_nat(vw2)), sort_bool::false_()));
4896 result.push_back(data_equation(variable_list({vn, vw1, vw2}), less_equal(most_significant_digit_nat(vw1), concat_digit(vn, vw2)), sort_bool::true_()));
4897 result.push_back(data_equation(variable_list({vn1, vn2, vw1, vw2}), less_equal(concat_digit(vn1, vw1), concat_digit(vn2, vw2)), if_(sort_machine_word::less_equal_word(vw1, vw2), less_equal(vn1, vn2), less(vn1, vn2))));
4898 result.push_back(data_equation(variable_list({vn1, vn2}), less_equal(succ_nat(vn1), vn2), less(vn1, vn2)));
4899 result.push_back(data_equation(variable_list({vn1, vn2}), less_equal(vn1, succ_nat(vn2)), less_equal(natpred(vn1), vn2)));
4900 result.push_back(data_equation(variable_list({vn, vw1}), sort_machine_word::equals_zero_word(vw1), less_equal(most_significant_digit_nat(vw1), vn), sort_bool::true_()));
4901 result.push_back(data_equation(variable_list({vw}), pos2nat(sort_pos::most_significant_digit(vw)), most_significant_digit_nat(vw)));
4902 result.push_back(data_equation(variable_list({vp, vw}), pos2nat(concat_digit(vp, vw)), concat_digit(pos2nat(vp), vw)));
4903 result.push_back(data_equation(variable_list({vp}), pos2nat(sort_pos::succpos(vp)), succ_nat(pos2nat(vp))));
4905 result.push_back(data_equation(variable_list({vn, vw}), nat2pos(concat_digit(vn, vw)), concat_digit(nat2pos(vn), vw)));
4906 result.push_back(data_equation(variable_list({vn, vp}), maximum(vp, vn), if_(less_equal(vn, pos2nat(vp)), vp, nat2pos(vn))));
4907 result.push_back(data_equation(variable_list({vn, vp}), maximum(vn, vp), if_(less_equal(vn, pos2nat(vp)), vp, nat2pos(vn))));
4908 result.push_back(data_equation(variable_list({vm, vn}), maximum(vm, vn), if_(less_equal(vm, vn), vn, vm)));
4909 result.push_back(data_equation(variable_list({vm, vn}), minimum(vm, vn), if_(less_equal(vm, vn), vm, vn)));
4911 result.push_back(data_equation(variable_list({vp, vw}), pred(concat_digit(vp, vw)), if_(sort_machine_word::equals_zero_word(vw), pred_whr(pred(vp)), concat_digit(pos2nat(vp), sort_machine_word::pred_word(vw)))));
4912 result.push_back(data_equation(variable_list({vpredp}), pred_whr(vpredp), if_(equals_zero(vpredp), most_significant_digit_nat(sort_machine_word::max_word()), concat_digit(vpredp, sort_machine_word::max_word()))));
4913 result.push_back(data_equation(variable_list({vn, vp}), plus(vp, vn), plus(vn, vp)));
4915 result.push_back(data_equation(variable_list({vn1, vw1, vw2}), plus(concat_digit(vn1, vw1), sort_pos::most_significant_digit(vw2)), if_(sort_machine_word::add_overflow_word(vw1, vw2), concat_digit(succ(vn1), sort_machine_word::add_word(vw1, vw2)), concat_digit(nat2pos(vn1), sort_machine_word::add_word(vw1, vw2)))));
4916 result.push_back(data_equation(variable_list({vp, vw1, vw2}), plus(most_significant_digit_nat(vw1), concat_digit(vp, vw2)), if_(sort_machine_word::add_overflow_word(vw1, vw2), concat_digit(sort_pos::succpos(vp), sort_machine_word::add_word(vw1, vw2)), concat_digit(vp, sort_machine_word::add_word(vw1, vw2)))));
4917 result.push_back(data_equation(variable_list({vn1, vp, vw1, vw2}), plus(concat_digit(vn1, vw1), concat_digit(vp, vw2)), if_(sort_machine_word::add_overflow_word(vw1, vw2), concat_digit(plus(succ(vn1), vp), sort_machine_word::add_word(vw1, vw2)), concat_digit(plus(vn1, vp), sort_machine_word::add_word(vw1, vw2)))));
4920 result.push_back(data_equation(variable_list({vn1, vw1, vw2}), plus(concat_digit(vn1, vw1), most_significant_digit_nat(vw2)), if_(sort_machine_word::add_overflow_word(vw1, vw2), concat_digit(succ_nat(vn1), sort_machine_word::add_word(vw1, vw2)), concat_digit(vn1, sort_machine_word::add_word(vw1, vw2)))));
4922 result.push_back(data_equation(variable_list({vn2, vw1, vw2}), plus(most_significant_digit_nat(vw1), concat_digit(vn2, vw2)), if_(sort_machine_word::add_overflow_word(vw1, vw2), concat_digit(succ_nat(vn2), sort_machine_word::add_word(vw1, vw2)), concat_digit(vn2, sort_machine_word::add_word(vw1, vw2)))));
4924 result.push_back(data_equation(variable_list({vn1, vn2, vw1, vw2}), plus(concat_digit(vn1, vw1), concat_digit(vn2, vw2)), if_(sort_machine_word::add_overflow_word(vw1, vw2), concat_digit(add_with_carry(vn1, vn2), sort_machine_word::add_word(vw1, vw2)), concat_digit(plus(vn1, vn2), sort_machine_word::add_word(vw1, vw2)))));
4925 result.push_back(data_equation(variable_list({vn1, vn2, vw1, vw2}), add_with_carry(concat_digit(vn1, vw1), concat_digit(vn2, vw2)), if_(sort_machine_word::add_with_carry_overflow_word(vw1, vw2), concat_digit(add_with_carry(vn1, vn2), sort_machine_word::add_with_carry_word(vw1, vw2)), concat_digit(plus(vn1, vn2), sort_machine_word::add_with_carry_word(vw1, vw2)))));
4926 result.push_back(data_equation(variable_list({vn1, vn2}), plus(succ_nat(vn1), vn2), succ_nat(plus(vn1, vn2))));
4927 result.push_back(data_equation(variable_list({vn1, vn2}), plus(vn1, succ_nat(vn2)), succ_nat(plus(vn1, vn2))));
4928 result.push_back(data_equation(variable_list({vn1, vp2}), plus(succ_nat(vn1), vp2), sort_pos::succpos(plus(vn1, vp2))));
4929 result.push_back(data_equation(variable_list({vn1, vp2}), plus(vn1, sort_pos::succpos(vp2)), sort_pos::succpos(plus(vn1, vp2))));
4930 result.push_back(data_equation(variable_list({vn2, vp1}), plus(sort_pos::succpos(vp1), vn2), sort_pos::succpos(plus(vp1, vn2))));
4931 result.push_back(data_equation(variable_list({vn2, vp1}), plus(vp1, succ_nat(vn2)), sort_pos::succpos(plus(vp1, vn2))));
4932 result.push_back(data_equation(variable_list({vn1, vn2}), auxiliary_plus_nat(vn1, vn2), plus(vn1, vn2)));
4935 result.push_back(data_equation(variable_list({vn}), natpred(succ_nat(vn)), vn));
4938 result.push_back(data_equation(variable_list({vn2, vw1, vw2}), monus(most_significant_digit_nat(vw1), concat_digit(vn2, vw2)), most_significant_digit_nat(sort_machine_word::zero_word())));
4939 result.push_back(data_equation(variable_list({vn1, vn2, vw1, vw2}), monus(concat_digit(vn1, vw1), concat_digit(vn2, vw2)), monus_whr(vn1, vw1, vn2, vw2, monus(vn1, vn2))));
4944 result.push_back(data_equation(variable_list({vn1, vn2, vw1, vw2}), times(concat_digit(vn1, vw1), concat_digit(vn2, vw2)), if_(less(vn1, vn2), times_ordered(concat_digit(vn1, vw1), concat_digit(vn2, vw2)), times_ordered(concat_digit(vn2, vw2), concat_digit(vn1, vw1)))));
4945 result.push_back(data_equation(variable_list({vn2, vw1, vw2}), times_ordered(most_significant_digit_nat(vw1), concat_digit(vn2, vw2)), concat_digit(times_overflow(vn2, vw1, sort_machine_word::times_overflow_word(vw1, vw2)), sort_machine_word::times_word(vw1, vw2))));
4946 result.push_back(data_equation(variable_list({vn1, vn2, vw1}), times_ordered(concat_digit(vn1, vw1), vn2), plus(concat_digit(times_ordered(vn1, vn2), sort_machine_word::zero_word()), times_overflow(vn2, vw1, sort_machine_word::zero_word()))));
4948 result.push_back(data_equation(variable_list({vn1, voverflow, vw1, vw2}), times_overflow(concat_digit(vn1, vw1), vw2, voverflow), if_(sort_machine_word::equals_zero_word(vw2), most_significant_digit_nat(voverflow), concat_digit(times_overflow(vn1, vw2, sort_machine_word::times_with_carry_overflow_word(vw1, vw2, voverflow)), sort_machine_word::times_with_carry_word(vw1, vw2, voverflow)))));
4949 result.push_back(data_equation(variable_list({vw}), is_odd(most_significant_digit_nat(vw)), sort_machine_word::rightmost_bit(vw)));
4950 result.push_back(data_equation(variable_list({vn, vw}), is_odd(concat_digit(vn, vw)), sort_machine_word::rightmost_bit(vw)));
4953 result.push_back(data_equation(variable_list({vw}), msd(most_significant_digit_nat(vw)), vw));
4954 result.push_back(data_equation(variable_list({vn, vw}), msd(concat_digit(vn, vw)), msd(vn)));
4955 result.push_back(data_equation(variable_list({vn, vw}), exp(vn, most_significant_digit_nat(vw)), exp_aux3n(sort_machine_word::rightmost_bit(vw), vn, vw)));
4956 result.push_back(data_equation(variable_list({vn, vn1, vw1}), exp(vn, concat_digit(vn1, vw1)), exp_aux4n(sort_machine_word::rightmost_bit(vw1), vn, vn1, vw1)));
4959 result.push_back(data_equation(variable_list({vn, vn1, vw}), exp_aux4n(sort_bool::true_(), vn, vn1, vw), exp_auxtruen(vn, div2(vn1), sort_machine_word::shift_right(is_odd(vn1), vw))));
4960 result.push_back(data_equation(variable_list({vn, vshift_n1, vshift_w}), exp_auxtruen(vn, vshift_n1, vshift_w), if_(equals_zero(vshift_n1), times(vn, exp_aux3n(sort_machine_word::rightmost_bit(vshift_w), times(vn, vn), vshift_w)), times(vn, exp_aux4n(sort_machine_word::rightmost_bit(vshift_w), times(vn, vn), vshift_n1, vshift_w)))));
4961 result.push_back(data_equation(variable_list({vn, vn1, vw}), exp_aux4n(sort_bool::false_(), vn, vn1, vw), exp_auxfalsen(vn, div2(vn1), sort_machine_word::shift_right(is_odd(vn1), vw))));
4962 result.push_back(data_equation(variable_list({vn, vshift_n1, vshift_w}), exp_auxfalsen(vn, vshift_n1, vshift_w), if_(equals_zero(vshift_n1), exp_aux3n(sort_machine_word::rightmost_bit(vshift_w), times(vn, vn), vshift_w), exp_aux4n(sort_machine_word::rightmost_bit(vshift_w), times(vn, vn), vshift_n1, vshift_w))));
4963 result.push_back(data_equation(variable_list({vp, vw}), exp(vp, most_significant_digit_nat(vw)), exp_aux3p(sort_machine_word::rightmost_bit(vw), vp, vw)));
4964 result.push_back(data_equation(variable_list({vn1, vp, vw1}), exp(vp, concat_digit(vn1, vw1)), exp_aux4p(sort_machine_word::rightmost_bit(vw1), vp, vn1, vw1)));
4967 result.push_back(data_equation(variable_list({vn1, vp, vw}), exp_aux4p(sort_bool::true_(), vp, vn1, vw), exp_auxtruep(vp, div2(vn1), sort_machine_word::shift_right(is_odd(vn1), vw))));
4968 result.push_back(data_equation(variable_list({vp, vshift_n1, vshift_w}), exp_auxtruep(vp, vshift_n1, vshift_w), if_(equals_zero(vshift_n1), times(vp, exp_aux3p(sort_machine_word::rightmost_bit(vshift_w), times(vp, vp), vshift_w)), times(vp, exp_aux4p(sort_machine_word::rightmost_bit(vshift_w), times(vp, vp), vshift_n1, vshift_w)))));
4969 result.push_back(data_equation(variable_list({vn1, vp, vw}), exp_aux4p(sort_bool::false_(), vp, vn1, vw), exp_auxfalsep(vp, div2(vn1), sort_machine_word::shift_right(is_odd(vn1), vw))));
4970 result.push_back(data_equation(variable_list({vp, vshift_n1, vshift_w}), exp_auxfalsep(vp, vshift_n1, vshift_w), if_(equals_zero(vshift_n1), exp_aux3p(sort_machine_word::rightmost_bit(vshift_w), times(vp, vp), vshift_w), exp_aux4p(sort_machine_word::rightmost_bit(vshift_w), times(vp, vp), vshift_n1, vshift_w))));
4973 result.push_back(data_equation(variable_list({vp, vw1, vw2}), div(most_significant_digit_nat(vw1), concat_digit(vp, vw2)), most_significant_digit_nat(sort_machine_word::zero_word())));
4974 result.push_back(data_equation(variable_list({vp, vw1, vw2}), mod(most_significant_digit_nat(vw1), concat_digit(vp, vw2)), most_significant_digit_nat(vw1)));
4975 result.push_back(data_equation(variable_list({vn, vw1, vw2}), div(concat_digit(vn, vw1), sort_pos::most_significant_digit(vw2)), div_whr1(vn, vw1, vw2, divmod_aux(vn, sort_pos::most_significant_digit(vw2)))));
4977 result.push_back(data_equation(variable_list({vn, vw1, vw2}), mod(concat_digit(vn, vw1), sort_pos::most_significant_digit(vw2)), most_significant_digit_nat(sort_machine_word::mod_doubleword(msd(mod(vn, sort_pos::most_significant_digit(vw2))), vw1, vw2))));
4978 result.push_back(data_equation(variable_list({vn, vp, vw1, vw2}), div(concat_digit(vn, vw1), concat_digit(vp, vw2)), if_(less(vn, pos2nat(concat_digit(vp, vw2))), most_significant_digit_nat(div_bold(concat_digit(vn, vw1), concat_digit(vp, vw2))), div_whr2(vn, vw1, vp, vw2, divmod_aux(vn, concat_digit(vp, vw2))))));
4979 result.push_back(data_equation(variable_list({vn, vp, vpair_, vw1, vw2}), div_whr2(vn, vw1, vp, vw2, vpair_), plus(if_(equals_zero(first(vpair_)), most_significant_digit_nat(sort_machine_word::zero_word()), concat_digit(first(vpair_), sort_machine_word::zero_word())), most_significant_digit_nat(div_bold(if_(equals_zero(last(vpair_)), most_significant_digit_nat(vw1), concat_digit(last(vpair_), vw1)), concat_digit(vp, vw2))))));
4980 result.push_back(data_equation(variable_list({vn, vp, vw1, vw2}), mod(concat_digit(vn, vw1), concat_digit(vp, vw2)), mod_whr1(vw1, vp, vw2, mod(vn, concat_digit(vp, vw2)))));
4984 result.push_back(data_equation(variable_list({vn, vw1, vw2}), divmod_aux(concat_digit(vn, vw1), sort_pos::most_significant_digit(vw2)), divmod_aux_whr1(vn, vw1, vw2, divmod_aux(vn,