mCRL2
Loading...
Searching...
No Matches
nat1.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_NAT1_H
16#define MCRL2_DATA_NAT1_H
17
18#include "functional" // std::function
25#include "mcrl2/data/standard.h"
26#include "mcrl2/data/bool.h"
27#include "mcrl2/data/pos1.h"
28
29namespace mcrl2 {
30
31 namespace data {
32
34 namespace sort_nat {
35
36 inline
38 {
40 return nat_name;
41 }
42
45 inline
46 const basic_sort& nat()
47 {
49 return nat;
50 }
51
55 inline
56 bool is_nat(const sort_expression& e)
57 {
58 if (is_basic_sort(e))
59 {
60 return basic_sort(e) == nat();
61 }
62 return false;
63 }
64
65 inline
67 {
69 return natpair_name;
70 }
71
74 inline
76 {
78 return natpair;
79 }
80
84 inline
86 {
87 if (is_basic_sort(e))
88 {
89 return basic_sort(e) == natpair();
90 }
91 return false;
92 }
93
94
97 inline
99 {
101 return c0_name;
102 }
103
105
107 inline
109 {
110 static function_symbol c0(c0_name(), nat());
111 return c0;
112 }
113
117 inline
119 {
120 if (is_function_symbol(e))
121 {
122 return atermpp::down_cast<function_symbol>(e) == c0();
123 }
124 return false;
125 }
126
129 inline
131 {
133 return cnat_name;
134 }
135
137
139 inline
141 {
143 return cnat;
144 }
145
149 inline
151 {
152 if (is_function_symbol(e))
153 {
154 return atermpp::down_cast<function_symbol>(e) == cnat();
155 }
156 return false;
157 }
158
160
163 inline
165 {
166 return sort_nat::cnat()(arg0);
167 }
168
171
173 inline
174 void make_cnat(data_expression& result, const data_expression& arg0)
175 {
176 make_application(result, sort_nat::cnat(),arg0);
177 }
178
183 inline
185 {
186 return is_application(e) && is_cnat_function_symbol(atermpp::down_cast<application>(e).head());
187 }
188
191 inline
193 {
195 return cpair_name;
196 }
197
199
201 inline
203 {
205 return cpair;
206 }
207
211 inline
213 {
214 if (is_function_symbol(e))
215 {
216 return atermpp::down_cast<function_symbol>(e) == cpair();
217 }
218 return false;
219 }
220
222
226 inline
228 {
229 return sort_nat::cpair()(arg0, arg1);
230 }
231
234
237 inline
239 {
240 make_application(result, sort_nat::cpair(),arg0, arg1);
241 }
242
247 inline
249 {
250 return is_application(e) && is_cpair_function_symbol(atermpp::down_cast<application>(e).head());
251 }
254 inline
256 {
258 result.push_back(sort_nat::c0());
259 result.push_back(sort_nat::cnat());
260 result.push_back(sort_nat::cpair());
261
262 return result;
263 }
266 inline
268 {
270 result.push_back(sort_nat::c0());
271 result.push_back(sort_nat::cnat());
272 result.push_back(sort_nat::cpair());
273
274 return result;
275 }
276 // 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
277 typedef std::map<function_symbol,std::pair<std::function<void(data_expression&, const data_expression&)>, std::string> > implementation_map;
280 inline
282 {
283 implementation_map result;
284 return result;
285 }
286
289 inline
291 {
293 return pos2nat_name;
294 }
295
297
299 inline
301 {
303 return pos2nat;
304 }
305
309 inline
311 {
312 if (is_function_symbol(e))
313 {
314 return atermpp::down_cast<function_symbol>(e) == pos2nat();
315 }
316 return false;
317 }
318
320
323 inline
325 {
326 return sort_nat::pos2nat()(arg0);
327 }
328
331
333 inline
335 {
336 make_application(result, sort_nat::pos2nat(),arg0);
337 }
338
343 inline
345 {
346 return is_application(e) && is_pos2nat_function_symbol(atermpp::down_cast<application>(e).head());
347 }
348
351 inline
353 {
355 return nat2pos_name;
356 }
357
359
361 inline
363 {
365 return nat2pos;
366 }
367
371 inline
373 {
374 if (is_function_symbol(e))
375 {
376 return atermpp::down_cast<function_symbol>(e) == nat2pos();
377 }
378 return false;
379 }
380
382
385 inline
387 {
388 return sort_nat::nat2pos()(arg0);
389 }
390
393
395 inline
397 {
398 make_application(result, sort_nat::nat2pos(),arg0);
399 }
400
405 inline
407 {
408 return is_application(e) && is_nat2pos_function_symbol(atermpp::down_cast<application>(e).head());
409 }
410
413 inline
415 {
417 return maximum_name;
418 }
419
420 // This function is not intended for public use and therefore not documented in Doxygen.
421 inline
423 {
424 sort_expression target_sort;
425 if (s0 == sort_pos::pos() && s1 == nat())
426 {
427 target_sort = sort_pos::pos();
428 }
429 else if (s0 == nat() && s1 == sort_pos::pos())
430 {
431 target_sort = sort_pos::pos();
432 }
433 else if (s0 == nat() && s1 == nat())
434 {
435 target_sort = nat();
436 }
437 else if (s0 == sort_pos::pos() && s1 == sort_pos::pos())
438 {
439 target_sort = sort_pos::pos();
440 }
441 else
442 {
443 throw mcrl2::runtime_error("Cannot compute target sort for maximum with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
444 }
445
447 return maximum;
448 }
449
453 inline
455 {
456 if (is_function_symbol(e))
457 {
458 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
459 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()));
460 }
461 return false;
462 }
463
465
469 inline
471 {
472 return sort_nat::maximum(arg0.sort(), arg1.sort())(arg0, arg1);
473 }
474
477
480 inline
482 {
483 make_application(result, sort_nat::maximum(arg0.sort(), arg1.sort()),arg0, arg1);
484 }
485
490 inline
492 {
493 return is_application(e) && is_maximum_function_symbol(atermpp::down_cast<application>(e).head());
494 }
495
498 inline
500 {
502 return minimum_name;
503 }
504
505 // This function is not intended for public use and therefore not documented in Doxygen.
506 inline
508 {
509 sort_expression target_sort;
510 if (s0 == nat() && s1 == nat())
511 {
512 target_sort = nat();
513 }
514 else if (s0 == sort_pos::pos() && s1 == sort_pos::pos())
515 {
516 target_sort = sort_pos::pos();
517 }
518 else
519 {
520 throw mcrl2::runtime_error("Cannot compute target sort for minimum with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
521 }
522
524 return minimum;
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() == minimum_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 2 && (f == minimum(nat(), nat()) || f == minimum(sort_pos::pos(), sort_pos::pos()));
537 }
538 return false;
539 }
540
542
546 inline
548 {
549 return sort_nat::minimum(arg0.sort(), arg1.sort())(arg0, arg1);
550 }
551
554
557 inline
559 {
560 make_application(result, sort_nat::minimum(arg0.sort(), arg1.sort()),arg0, arg1);
561 }
562
567 inline
569 {
570 return is_application(e) && is_minimum_function_symbol(atermpp::down_cast<application>(e).head());
571 }
572
575 inline
577 {
579 return succ_name;
580 }
581
582 // This function is not intended for public use and therefore not documented in Doxygen.
583 inline
585 {
586 sort_expression target_sort(sort_pos::pos());
588 return succ;
589 }
590
594 inline
596 {
597 if (is_function_symbol(e))
598 {
599 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
600 return f.name() == succ_name() && atermpp::down_cast<function_sort>(f.sort()).domain().size() == 1 && (f == succ(nat()) || f == succ(sort_pos::pos()));
601 }
602 return false;
603 }
604
606
609 inline
611 {
612 return sort_nat::succ(arg0.sort())(arg0);
613 }
614
617
619 inline
620 void make_succ(data_expression& result, const data_expression& arg0)
621 {
622 make_application(result, sort_nat::succ(arg0.sort()),arg0);
623 }
624
629 inline
631 {
632 return is_application(e) && is_succ_function_symbol(atermpp::down_cast<application>(e).head());
633 }
634
637 inline
639 {
641 return pred_name;
642 }
643
645
647 inline
649 {
651 return pred;
652 }
653
657 inline
659 {
660 if (is_function_symbol(e))
661 {
662 return atermpp::down_cast<function_symbol>(e) == pred();
663 }
664 return false;
665 }
666
668
671 inline
673 {
674 return sort_nat::pred()(arg0);
675 }
676
679
681 inline
682 void make_pred(data_expression& result, const data_expression& arg0)
683 {
684 make_application(result, sort_nat::pred(),arg0);
685 }
686
691 inline
693 {
694 return is_application(e) && is_pred_function_symbol(atermpp::down_cast<application>(e).head());
695 }
696
699 inline
701 {
703 return dub_name;
704 }
705
707
709 inline
711 {
713 return dub;
714 }
715
719 inline
721 {
722 if (is_function_symbol(e))
723 {
724 return atermpp::down_cast<function_symbol>(e) == dub();
725 }
726 return false;
727 }
728
730
734 inline
736 {
737 return sort_nat::dub()(arg0, arg1);
738 }
739
742
745 inline
747 {
748 make_application(result, sort_nat::dub(),arg0, arg1);
749 }
750
755 inline
757 {
758 return is_application(e) && is_dub_function_symbol(atermpp::down_cast<application>(e).head());
759 }
760
763 inline
765 {
767 return dubsucc_name;
768 }
769
771
773 inline
775 {
777 return dubsucc;
778 }
779
783 inline
785 {
786 if (is_function_symbol(e))
787 {
788 return atermpp::down_cast<function_symbol>(e) == dubsucc();
789 }
790 return false;
791 }
792
794
797 inline
799 {
800 return sort_nat::dubsucc()(arg0);
801 }
802
805
807 inline
809 {
810 make_application(result, sort_nat::dubsucc(),arg0);
811 }
812
817 inline
819 {
820 return is_application(e) && is_dubsucc_function_symbol(atermpp::down_cast<application>(e).head());
821 }
822
825 inline
827 {
829 return plus_name;
830 }
831
832 // This function is not intended for public use and therefore not documented in Doxygen.
833 inline
835 {
836 sort_expression target_sort;
837 if (s0 == sort_pos::pos() && s1 == nat())
838 {
839 target_sort = sort_pos::pos();
840 }
841 else if (s0 == nat() && s1 == sort_pos::pos())
842 {
843 target_sort = sort_pos::pos();
844 }
845 else if (s0 == nat() && s1 == nat())
846 {
847 target_sort = nat();
848 }
849 else if (s0 == sort_pos::pos() && s1 == sort_pos::pos())
850 {
851 target_sort = sort_pos::pos();
852 }
853 else
854 {
855 throw mcrl2::runtime_error("Cannot compute target sort for plus with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
856 }
857
858 function_symbol plus(plus_name(), make_function_sort_(s0, s1, target_sort));
859 return plus;
860 }
861
865 inline
867 {
868 if (is_function_symbol(e))
869 {
870 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
871 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()));
872 }
873 return false;
874 }
875
877
881 inline
883 {
884 return sort_nat::plus(arg0.sort(), arg1.sort())(arg0, arg1);
885 }
886
889
892 inline
894 {
895 make_application(result, sort_nat::plus(arg0.sort(), arg1.sort()),arg0, arg1);
896 }
897
902 inline
904 {
905 return is_application(e) && is_plus_function_symbol(atermpp::down_cast<application>(e).head());
906 }
907
910 inline
912 {
915 }
916
918
920 inline
922 {
925 }
926
930 inline
932 {
933 if (is_function_symbol(e))
934 {
935 return atermpp::down_cast<function_symbol>(e) == gte_subtract_with_borrow();
936 }
937 return false;
938 }
939
941
946 inline
948 {
950 }
951
954
958 inline
960 {
962 }
963
968 inline
970 {
971 return is_application(e) && is_gte_subtract_with_borrow_function_symbol(atermpp::down_cast<application>(e).head());
972 }
973
976 inline
978 {
980 return times_name;
981 }
982
983 // This function is not intended for public use and therefore not documented in Doxygen.
984 inline
986 {
987 sort_expression target_sort;
988 if (s0 == nat() && s1 == nat())
989 {
990 target_sort = nat();
991 }
992 else if (s0 == sort_pos::pos() && s1 == sort_pos::pos())
993 {
994 target_sort = sort_pos::pos();
995 }
996 else
997 {
998 throw mcrl2::runtime_error("Cannot compute target sort for times with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
999 }
1000
1001 function_symbol times(times_name(), make_function_sort_(s0, s1, target_sort));
1002 return times;
1003 }
1004
1008 inline
1010 {
1011 if (is_function_symbol(e))
1012 {
1013 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
1014 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()));
1015 }
1016 return false;
1017 }
1018
1020
1024 inline
1026 {
1027 return sort_nat::times(arg0.sort(), arg1.sort())(arg0, arg1);
1028 }
1029
1032
1035 inline
1037 {
1038 make_application(result, sort_nat::times(arg0.sort(), arg1.sort()),arg0, arg1);
1039 }
1040
1045 inline
1047 {
1048 return is_application(e) && is_times_function_symbol(atermpp::down_cast<application>(e).head());
1049 }
1050
1053 inline
1055 {
1057 return div_name;
1058 }
1059
1061
1063 inline
1065 {
1067 return div;
1068 }
1069
1073 inline
1075 {
1076 if (is_function_symbol(e))
1077 {
1078 return atermpp::down_cast<function_symbol>(e) == div();
1079 }
1080 return false;
1081 }
1082
1084
1088 inline
1090 {
1091 return sort_nat::div()(arg0, arg1);
1092 }
1093
1096
1099 inline
1101 {
1102 make_application(result, sort_nat::div(),arg0, arg1);
1103 }
1104
1109 inline
1111 {
1112 return is_application(e) && is_div_function_symbol(atermpp::down_cast<application>(e).head());
1113 }
1114
1117 inline
1119 {
1121 return mod_name;
1122 }
1123
1125
1127 inline
1129 {
1131 return mod;
1132 }
1133
1137 inline
1139 {
1140 if (is_function_symbol(e))
1141 {
1142 return atermpp::down_cast<function_symbol>(e) == mod();
1143 }
1144 return false;
1145 }
1146
1148
1152 inline
1154 {
1155 return sort_nat::mod()(arg0, arg1);
1156 }
1157
1160
1163 inline
1165 {
1166 make_application(result, sort_nat::mod(),arg0, arg1);
1167 }
1168
1173 inline
1175 {
1176 return is_application(e) && is_mod_function_symbol(atermpp::down_cast<application>(e).head());
1177 }
1178
1181 inline
1183 {
1185 return exp_name;
1186 }
1187
1188 // This function is not intended for public use and therefore not documented in Doxygen.
1189 inline
1191 {
1192 sort_expression target_sort;
1193 if (s0 == sort_pos::pos() && s1 == nat())
1194 {
1195 target_sort = sort_pos::pos();
1196 }
1197 else if (s0 == nat() && s1 == nat())
1198 {
1199 target_sort = nat();
1200 }
1201 else
1202 {
1203 throw mcrl2::runtime_error("Cannot compute target sort for exp with domain sorts " + pp(s0) + ", " + pp(s1) + ". ");
1204 }
1205
1206 function_symbol exp(exp_name(), make_function_sort_(s0, s1, target_sort));
1207 return exp;
1208 }
1209
1213 inline
1215 {
1216 if (is_function_symbol(e))
1217 {
1218 const function_symbol& f = atermpp::down_cast<function_symbol>(e);
1219 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()));
1220 }
1221 return false;
1222 }
1223
1225
1229 inline
1231 {
1232 return sort_nat::exp(arg0.sort(), arg1.sort())(arg0, arg1);
1233 }
1234
1237
1240 inline
1242 {
1243 make_application(result, sort_nat::exp(arg0.sort(), arg1.sort()),arg0, arg1);
1244 }
1245
1250 inline
1252 {
1253 return is_application(e) && is_exp_function_symbol(atermpp::down_cast<application>(e).head());
1254 }
1255
1258 inline
1260 {
1262 return even_name;
1263 }
1264
1266
1268 inline
1270 {
1272 return even;
1273 }
1274
1278 inline
1280 {
1281 if (is_function_symbol(e))
1282 {
1283 return atermpp::down_cast<function_symbol>(e) == even();
1284 }
1285 return false;
1286 }
1287
1289
1292 inline
1294 {
1295 return sort_nat::even()(arg0);
1296 }
1297
1300
1302 inline
1303 void make_even(data_expression& result, const data_expression& arg0)
1304 {
1305 make_application(result, sort_nat::even(),arg0);
1306 }
1307
1312 inline
1314 {
1315 return is_application(e) && is_even_function_symbol(atermpp::down_cast<application>(e).head());
1316 }
1317
1320 inline
1322 {
1324 return monus_name;
1325 }
1326
1328
1330 inline
1332 {
1334 return monus;
1335 }
1336
1340 inline
1342 {
1343 if (is_function_symbol(e))
1344 {
1345 return atermpp::down_cast<function_symbol>(e) == monus();
1346 }
1347 return false;
1348 }
1349
1351
1355 inline
1357 {
1358 return sort_nat::monus()(arg0, arg1);
1359 }
1360
1363
1366 inline
1368 {
1369 make_application(result, sort_nat::monus(),arg0, arg1);
1370 }
1371
1376 inline
1378 {
1379 return is_application(e) && is_monus_function_symbol(atermpp::down_cast<application>(e).head());
1380 }
1381
1384 inline
1386 {
1388 return swap_zero_name;
1389 }
1390
1392
1394 inline
1396 {
1398 return swap_zero;
1399 }
1400
1404 inline
1406 {
1407 if (is_function_symbol(e))
1408 {
1409 return atermpp::down_cast<function_symbol>(e) == swap_zero();
1410 }
1411 return false;
1412 }
1413
1415
1419 inline
1421 {
1422 return sort_nat::swap_zero()(arg0, arg1);
1423 }
1424
1427
1430 inline
1432 {
1433 make_application(result, sort_nat::swap_zero(),arg0, arg1);
1434 }
1435
1440 inline
1442 {
1443 return is_application(e) && is_swap_zero_function_symbol(atermpp::down_cast<application>(e).head());
1444 }
1445
1448 inline
1450 {
1452 return swap_zero_add_name;
1453 }
1454
1456
1458 inline
1460 {
1462 return swap_zero_add;
1463 }
1464
1468 inline
1470 {
1471 if (is_function_symbol(e))
1472 {
1473 return atermpp::down_cast<function_symbol>(e) == swap_zero_add();
1474 }
1475 return false;
1476 }
1477
1479
1485 inline
1487 {
1488 return sort_nat::swap_zero_add()(arg0, arg1, arg2, arg3);
1489 }
1490
1493
1498 inline
1500 {
1502 }
1503
1508 inline
1510 {
1511 return is_application(e) && is_swap_zero_add_function_symbol(atermpp::down_cast<application>(e).head());
1512 }
1513
1516 inline
1518 {
1520 return swap_zero_min_name;
1521 }
1522
1524
1526 inline
1528 {
1530 return swap_zero_min;
1531 }
1532
1536 inline
1538 {
1539 if (is_function_symbol(e))
1540 {
1541 return atermpp::down_cast<function_symbol>(e) == swap_zero_min();
1542 }
1543 return false;
1544 }
1545
1547
1553 inline
1555 {
1556 return sort_nat::swap_zero_min()(arg0, arg1, arg2, arg3);
1557 }
1558
1561
1566 inline
1568 {
1570 }
1571
1576 inline
1578 {
1579 return is_application(e) && is_swap_zero_min_function_symbol(atermpp::down_cast<application>(e).head());
1580 }
1581
1584 inline
1586 {
1588 return swap_zero_monus_name;
1589 }
1590
1592
1594 inline
1596 {
1598 return swap_zero_monus;
1599 }
1600
1604 inline
1606 {
1607 if (is_function_symbol(e))
1608 {
1609 return atermpp::down_cast<function_symbol>(e) == swap_zero_monus();
1610 }
1611 return false;
1612 }
1613
1615
1621 inline
1623 {
1624 return sort_nat::swap_zero_monus()(arg0, arg1, arg2, arg3);
1625 }
1626
1629
1634 inline
1636 {
1638 }
1639
1644 inline
1646 {
1647 return is_application(e) && is_swap_zero_monus_function_symbol(atermpp::down_cast<application>(e).head());
1648 }
1649
1652 inline
1654 {
1656 return sqrt_name;
1657 }
1658
1660
1662 inline
1664 {
1666 return sqrt;
1667 }
1668
1672 inline
1674 {
1675 if (is_function_symbol(e))
1676 {
1677 return atermpp::down_cast<function_symbol>(e) == sqrt();
1678 }
1679 return false;
1680 }
1681
1683
1686 inline
1688 {
1689 return sort_nat::sqrt()(arg0);
1690 }
1691
1694
1696 inline
1697 void make_sqrt(data_expression& result, const data_expression& arg0)
1698 {
1699 make_application(result, sort_nat::sqrt(),arg0);
1700 }
1701
1706 inline
1708 {
1709 return is_application(e) && is_sqrt_function_symbol(atermpp::down_cast<application>(e).head());
1710 }
1711
1714 inline
1716 {
1719 }
1720
1722
1724 inline
1726 {
1728 return sqrt_nat_aux_func;
1729 }
1730
1734 inline
1736 {
1737 if (is_function_symbol(e))
1738 {
1739 return atermpp::down_cast<function_symbol>(e) == sqrt_nat_aux_func();
1740 }
1741 return false;
1742 }
1743
1745
1750 inline
1752 {
1753 return sort_nat::sqrt_nat_aux_func()(arg0, arg1, arg2);
1754 }
1755
1758
1762 inline
1764 {
1766 }
1767
1772 inline
1774 {
1775 return is_application(e) && is_sqrt_nat_aux_func_function_symbol(atermpp::down_cast<application>(e).head());
1776 }
1777
1780 inline
1782 {
1784 return first_name;
1785 }
1786
1788
1790 inline
1792 {
1794 return first;
1795 }
1796
1800 inline
1802 {
1803 if (is_function_symbol(e))
1804 {
1805 return atermpp::down_cast<function_symbol>(e) == first();
1806 }
1807 return false;
1808 }
1809
1811
1814 inline
1816 {
1817 return sort_nat::first()(arg0);
1818 }
1819
1822
1824 inline
1825 void make_first(data_expression& result, const data_expression& arg0)
1826 {
1827 make_application(result, sort_nat::first(),arg0);
1828 }
1829
1834 inline
1836 {
1837 return is_application(e) && is_first_function_symbol(atermpp::down_cast<application>(e).head());
1838 }
1839
1842 inline
1844 {
1846 return last_name;
1847 }
1848
1850
1852 inline
1854 {
1856 return last;
1857 }
1858
1862 inline
1864 {
1865 if (is_function_symbol(e))
1866 {
1867 return atermpp::down_cast<function_symbol>(e) == last();
1868 }
1869 return false;
1870 }
1871
1873
1876 inline
1878 {
1879 return sort_nat::last()(arg0);
1880 }
1881
1884
1886 inline
1887 void make_last(data_expression& result, const data_expression& arg0)
1888 {
1889 make_application(result, sort_nat::last(),arg0);
1890 }
1891
1896 inline
1898 {
1899 return is_application(e) && is_last_function_symbol(atermpp::down_cast<application>(e).head());
1900 }
1901
1904 inline
1906 {
1908 return divmod_name;
1909 }
1910
1912
1914 inline
1916 {
1918 return divmod;
1919 }
1920
1924 inline
1926 {
1927 if (is_function_symbol(e))
1928 {
1929 return atermpp::down_cast<function_symbol>(e) == divmod();
1930 }
1931 return false;
1932 }
1933
1935
1939 inline
1941 {
1942 return sort_nat::divmod()(arg0, arg1);
1943 }
1944
1947
1950 inline
1952 {
1953 make_application(result, sort_nat::divmod(),arg0, arg1);
1954 }
1955
1960 inline
1962 {
1963 return is_application(e) && is_divmod_function_symbol(atermpp::down_cast<application>(e).head());
1964 }
1965
1968 inline
1970 {
1973 }
1974
1976
1978 inline
1980 {
1982 return generalised_divmod;
1983 }
1984
1988 inline
1990 {
1991 if (is_function_symbol(e))
1992 {
1993 return atermpp::down_cast<function_symbol>(e) == generalised_divmod();
1994 }
1995 return false;
1996 }
1997
1999
2004 inline
2006 {
2007 return sort_nat::generalised_divmod()(arg0, arg1, arg2);
2008 }
2009
2012
2016 inline
2018 {
2020 }
2021
2026 inline
2028 {
2029 return is_application(e) && is_generalised_divmod_function_symbol(atermpp::down_cast<application>(e).head());
2030 }
2031
2034 inline
2036 {
2039 }
2040
2042
2044 inline
2046 {
2049 }
2050
2054 inline
2056 {
2057 if (is_function_symbol(e))
2058 {
2059 return atermpp::down_cast<function_symbol>(e) == doubly_generalised_divmod();
2060 }
2061 return false;
2062 }
2063
2065
2070 inline
2072 {
2074 }
2075
2078
2082 inline
2084 {
2086 }
2087
2092 inline
2094 {
2095 return is_application(e) && is_doubly_generalised_divmod_function_symbol(atermpp::down_cast<application>(e).head());
2096 }
2099 inline
2101 {
2103 result.push_back(sort_nat::pos2nat());
2104 result.push_back(sort_nat::nat2pos());
2105 result.push_back(sort_nat::maximum(sort_pos::pos(), nat()));
2106 result.push_back(sort_nat::maximum(nat(), sort_pos::pos()));
2107 result.push_back(sort_nat::maximum(nat(), nat()));
2108 result.push_back(sort_nat::minimum(nat(), nat()));
2109 result.push_back(sort_nat::succ(nat()));
2110 result.push_back(sort_nat::pred());
2111 result.push_back(sort_nat::dub());
2112 result.push_back(sort_nat::dubsucc());
2113 result.push_back(sort_nat::plus(sort_pos::pos(), nat()));
2114 result.push_back(sort_nat::plus(nat(), sort_pos::pos()));
2115 result.push_back(sort_nat::plus(nat(), nat()));
2116 result.push_back(sort_nat::gte_subtract_with_borrow());
2117 result.push_back(sort_nat::times(nat(), nat()));
2118 result.push_back(sort_nat::div());
2119 result.push_back(sort_nat::mod());
2120 result.push_back(sort_nat::exp(sort_pos::pos(), nat()));
2121 result.push_back(sort_nat::exp(nat(), nat()));
2122 result.push_back(sort_nat::even());
2123 result.push_back(sort_nat::monus());
2124 result.push_back(sort_nat::swap_zero());
2125 result.push_back(sort_nat::swap_zero_add());
2126 result.push_back(sort_nat::swap_zero_min());
2127 result.push_back(sort_nat::swap_zero_monus());
2128 result.push_back(sort_nat::sqrt());
2129 result.push_back(sort_nat::sqrt_nat_aux_func());
2130 result.push_back(sort_nat::first());
2131 result.push_back(sort_nat::last());
2132 result.push_back(sort_nat::divmod());
2133 result.push_back(sort_nat::generalised_divmod());
2134 result.push_back(sort_nat::doubly_generalised_divmod());
2135 return result;
2136 }
2137
2140 inline
2142 {
2145 {
2146 result.push_back(f);
2147 }
2148 return result;
2149 }
2150
2153 inline
2155 {
2157 result.push_back(sort_nat::pos2nat());
2158 result.push_back(sort_nat::nat2pos());
2159 result.push_back(sort_nat::maximum(sort_pos::pos(), nat()));
2160 result.push_back(sort_nat::maximum(nat(), sort_pos::pos()));
2161 result.push_back(sort_nat::maximum(nat(), nat()));
2162 result.push_back(sort_nat::minimum(nat(), nat()));
2163 result.push_back(sort_nat::succ(nat()));
2164 result.push_back(sort_nat::pred());
2165 result.push_back(sort_nat::dub());
2166 result.push_back(sort_nat::dubsucc());
2167 result.push_back(sort_nat::plus(sort_pos::pos(), nat()));
2168 result.push_back(sort_nat::plus(nat(), sort_pos::pos()));
2169 result.push_back(sort_nat::plus(nat(), nat()));
2170 result.push_back(sort_nat::gte_subtract_with_borrow());
2171 result.push_back(sort_nat::times(nat(), nat()));
2172 result.push_back(sort_nat::div());
2173 result.push_back(sort_nat::mod());
2174 result.push_back(sort_nat::exp(sort_pos::pos(), nat()));
2175 result.push_back(sort_nat::exp(nat(), nat()));
2176 result.push_back(sort_nat::even());
2177 result.push_back(sort_nat::monus());
2178 result.push_back(sort_nat::swap_zero());
2179 result.push_back(sort_nat::swap_zero_add());
2180 result.push_back(sort_nat::swap_zero_min());
2181 result.push_back(sort_nat::swap_zero_monus());
2182 result.push_back(sort_nat::sqrt());
2183 result.push_back(sort_nat::sqrt_nat_aux_func());
2184 result.push_back(sort_nat::first());
2185 result.push_back(sort_nat::last());
2186 result.push_back(sort_nat::divmod());
2187 result.push_back(sort_nat::generalised_divmod());
2188 result.push_back(sort_nat::doubly_generalised_divmod());
2189 return result;
2190 }
2191
2192
2193 // 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
2194 typedef std::map<function_symbol,std::pair<std::function<void(data_expression&, const data_expression&)>, std::string> > implementation_map;
2197 inline
2199 {
2200 implementation_map result;
2201 return result;
2202 }
2208 inline
2210 {
2212 return atermpp::down_cast<application>(e)[0];
2213 }
2214
2220 inline
2222 {
2224 return atermpp::down_cast<application>(e)[0];
2225 }
2226
2232 inline
2234 {
2236 return atermpp::down_cast<application>(e)[1];
2237 }
2238
2244 inline
2246 {
2248 return atermpp::down_cast<application>(e)[0];
2249 }
2250
2256 inline
2258 {
2260 return atermpp::down_cast<application>(e)[1];
2261 }
2262
2268 inline
2270 {
2272 return atermpp::down_cast<application>(e)[2];
2273 }
2274
2280 inline
2282 {
2284 return atermpp::down_cast<application>(e)[3];
2285 }
2286
2289 inline
2291 {
2292 variable vb("b",sort_bool::bool_());
2293 variable vc("c",sort_bool::bool_());
2294 variable vp("p",sort_pos::pos());
2295 variable vq("q",sort_pos::pos());
2296 variable vn("n",nat());
2297 variable vm("m",nat());
2298 variable vu("u",nat());
2299 variable vv("v",nat());
2300
2301 data_equation_vector result;
2302 result.push_back(data_equation(variable_list({vp}), equal_to(c0(), cnat(vp)), sort_bool::false_()));
2303 result.push_back(data_equation(variable_list({vp}), equal_to(cnat(vp), c0()), sort_bool::false_()));
2304 result.push_back(data_equation(variable_list({vp, vq}), equal_to(cnat(vp), cnat(vq)), equal_to(vp, vq)));
2305 result.push_back(data_equation(variable_list({vn}), less(vn, c0()), sort_bool::false_()));
2306 result.push_back(data_equation(variable_list({vp}), less(c0(), cnat(vp)), sort_bool::true_()));
2307 result.push_back(data_equation(variable_list({vp, vq}), less(cnat(vp), cnat(vq)), less(vp, vq)));
2308 result.push_back(data_equation(variable_list({vn}), less_equal(c0(), vn), sort_bool::true_()));
2309 result.push_back(data_equation(variable_list({vp}), less_equal(cnat(vp), c0()), sort_bool::false_()));
2310 result.push_back(data_equation(variable_list({vp, vq}), less_equal(cnat(vp), cnat(vq)), less_equal(vp, vq)));
2311 result.push_back(data_equation(variable_list({vp}), pos2nat(vp), cnat(vp)));
2312 result.push_back(data_equation(variable_list({vp}), nat2pos(cnat(vp)), vp));
2313 result.push_back(data_equation(variable_list({vp}), maximum(vp, c0()), vp));
2314 result.push_back(data_equation(variable_list({vp, vq}), maximum(vp, cnat(vq)), if_(less_equal(vp, vq), vq, vp)));
2315 result.push_back(data_equation(variable_list({vp}), maximum(c0(), vp), vp));
2316 result.push_back(data_equation(variable_list({vp, vq}), maximum(cnat(vp), vq), if_(less_equal(vp, vq), vq, vp)));
2317 result.push_back(data_equation(variable_list({vm, vn}), maximum(vm, vn), if_(less_equal(vm, vn), vn, vm)));
2318 result.push_back(data_equation(variable_list({vm, vn}), minimum(vm, vn), if_(less_equal(vm, vn), vm, vn)));
2319 result.push_back(data_equation(variable_list(), succ(c0()), sort_pos::c1()));
2320 result.push_back(data_equation(variable_list({vp}), succ(cnat(vp)), succ(vp)));
2321 result.push_back(data_equation(variable_list(), pred(sort_pos::c1()), c0()));
2322 result.push_back(data_equation(variable_list({vb, vp}), pred(sort_pos::cdub(vb, vp)), cnat(if_(vb, sort_pos::cdub(sort_bool::false_(), vp), dubsucc(pred(vp))))));
2323 result.push_back(data_equation(variable_list(), dubsucc(c0()), sort_pos::c1()));
2324 result.push_back(data_equation(variable_list({vp}), dubsucc(cnat(vp)), sort_pos::cdub(sort_bool::true_(), vp)));
2325 result.push_back(data_equation(variable_list(), dub(sort_bool::false_(), c0()), c0()));
2326 result.push_back(data_equation(variable_list(), dub(sort_bool::true_(), c0()), cnat(sort_pos::c1())));
2327 result.push_back(data_equation(variable_list({vb, vp}), dub(vb, cnat(vp)), cnat(sort_pos::cdub(vb, vp))));
2328 result.push_back(data_equation(variable_list({vp}), plus(vp, c0()), vp));
2329 result.push_back(data_equation(variable_list({vp, vq}), plus(vp, cnat(vq)), sort_pos::add_with_carry(sort_bool::false_(), vp, vq)));
2330 result.push_back(data_equation(variable_list({vp}), plus(c0(), vp), vp));
2331 result.push_back(data_equation(variable_list({vp, vq}), plus(cnat(vp), vq), sort_pos::add_with_carry(sort_bool::false_(), vp, vq)));
2332 result.push_back(data_equation(variable_list({vn}), plus(c0(), vn), vn));
2333 result.push_back(data_equation(variable_list({vn}), plus(vn, c0()), vn));
2334 result.push_back(data_equation(variable_list({vp, vq}), plus(cnat(vp), cnat(vq)), cnat(sort_pos::add_with_carry(sort_bool::false_(), vp, vq))));
2337 result.push_back(data_equation(variable_list({vb, vc, vp, vq}), gte_subtract_with_borrow(vb, sort_pos::cdub(vc, vp), sort_pos::cdub(vc, vq)), dub(vb, gte_subtract_with_borrow(vb, vp, vq))));
2340 result.push_back(data_equation(variable_list({vn}), times(c0(), vn), c0()));
2341 result.push_back(data_equation(variable_list({vn}), times(vn, c0()), c0()));
2342 result.push_back(data_equation(variable_list({vp, vq}), times(cnat(vp), cnat(vq)), cnat(times(vp, vq))));
2343 result.push_back(data_equation(variable_list({vp}), exp(vp, c0()), sort_pos::c1()));
2344 result.push_back(data_equation(variable_list({vp}), exp(vp, cnat(sort_pos::c1())), vp));
2345 result.push_back(data_equation(variable_list({vp, vq}), exp(vp, cnat(sort_pos::cdub(sort_bool::false_(), vq))), exp(times(vp, vp), cnat(vq))));
2346 result.push_back(data_equation(variable_list({vp, vq}), exp(vp, cnat(sort_pos::cdub(sort_bool::true_(), vq))), times(vp, exp(times(vp, vp), cnat(vq)))));
2347 result.push_back(data_equation(variable_list({vn}), exp(vn, c0()), cnat(sort_pos::c1())));
2348 result.push_back(data_equation(variable_list({vp}), exp(c0(), cnat(vp)), c0()));
2349 result.push_back(data_equation(variable_list({vn, vp}), exp(cnat(vp), vn), cnat(exp(vp, vn))));
2350 result.push_back(data_equation(variable_list(), even(c0()), sort_bool::true_()));
2352 result.push_back(data_equation(variable_list({vb, vp}), even(cnat(sort_pos::cdub(vb, vp))), sort_bool::not_(vb)));
2353 result.push_back(data_equation(variable_list({vp}), div(c0(), vp), c0()));
2354 result.push_back(data_equation(variable_list({vp, vq}), div(cnat(vp), vq), first(divmod(vp, vq))));
2355 result.push_back(data_equation(variable_list({vp}), mod(c0(), vp), c0()));
2356 result.push_back(data_equation(variable_list({vp, vq}), mod(cnat(vp), vq), last(divmod(vp, vq))));
2357 result.push_back(data_equation(variable_list({vn}), monus(c0(), vn), c0()));
2358 result.push_back(data_equation(variable_list({vn}), monus(vn, c0()), vn));
2359 result.push_back(data_equation(variable_list({vp, vq}), monus(cnat(vp), cnat(vq)), gte_subtract_with_borrow(sort_bool::false_(), vp, vq)));
2360 result.push_back(data_equation(variable_list({vm}), swap_zero(vm, c0()), vm));
2361 result.push_back(data_equation(variable_list({vn}), swap_zero(c0(), vn), vn));
2362 result.push_back(data_equation(variable_list({vp}), swap_zero(cnat(vp), cnat(vp)), c0()));
2363 result.push_back(data_equation(variable_list({vp, vq}), not_equal_to(vp, vq), swap_zero(cnat(vp), cnat(vq)), cnat(vq)));
2364 result.push_back(data_equation(variable_list({vm, vn}), swap_zero_add(c0(), c0(), vm, vn), plus(vm, vn)));
2365 result.push_back(data_equation(variable_list({vm, vp}), swap_zero_add(cnat(vp), c0(), vm, c0()), vm));
2366 result.push_back(data_equation(variable_list({vm, vp, vq}), swap_zero_add(cnat(vp), c0(), vm, cnat(vq)), swap_zero(cnat(vp), plus(swap_zero(cnat(vp), vm), cnat(vq)))));
2367 result.push_back(data_equation(variable_list({vn, vp}), swap_zero_add(c0(), cnat(vp), c0(), vn), vn));
2368 result.push_back(data_equation(variable_list({vn, vp, vq}), swap_zero_add(c0(), cnat(vp), cnat(vq), vn), swap_zero(cnat(vp), plus(cnat(vq), swap_zero(cnat(vp), vn)))));
2369 result.push_back(data_equation(variable_list({vm, vn, vp, vq}), swap_zero_add(cnat(vp), cnat(vq), vm, vn), swap_zero(plus(cnat(vp), cnat(vq)), plus(swap_zero(cnat(vp), vm), swap_zero(cnat(vq), vn)))));
2370 result.push_back(data_equation(variable_list({vm, vn}), swap_zero_min(c0(), c0(), vm, vn), minimum(vm, vn)));
2371 result.push_back(data_equation(variable_list({vm, vp}), swap_zero_min(cnat(vp), c0(), vm, c0()), c0()));
2372 result.push_back(data_equation(variable_list({vm, vp, vq}), swap_zero_min(cnat(vp), c0(), vm, cnat(vq)), minimum(swap_zero(cnat(vp), vm), cnat(vq))));
2373 result.push_back(data_equation(variable_list({vn, vp}), swap_zero_min(c0(), cnat(vp), c0(), vn), c0()));
2374 result.push_back(data_equation(variable_list({vn, vp, vq}), swap_zero_min(c0(), cnat(vp), cnat(vq), vn), minimum(cnat(vq), swap_zero(cnat(vp), vn))));
2375 result.push_back(data_equation(variable_list({vm, vn, vp, vq}), swap_zero_min(cnat(vp), cnat(vq), vm, vn), swap_zero(minimum(cnat(vp), cnat(vq)), minimum(swap_zero(cnat(vp), vm), swap_zero(cnat(vq), vn)))));
2376 result.push_back(data_equation(variable_list({vm, vn}), swap_zero_monus(c0(), c0(), vm, vn), monus(vm, vn)));
2377 result.push_back(data_equation(variable_list({vm, vp}), swap_zero_monus(cnat(vp), c0(), vm, c0()), vm));
2378 result.push_back(data_equation(variable_list({vm, vp, vq}), swap_zero_monus(cnat(vp), c0(), vm, cnat(vq)), swap_zero(cnat(vp), monus(swap_zero(cnat(vp), vm), cnat(vq)))));
2379 result.push_back(data_equation(variable_list({vn, vp}), swap_zero_monus(c0(), cnat(vp), c0(), vn), c0()));
2380 result.push_back(data_equation(variable_list({vn, vp, vq}), swap_zero_monus(c0(), cnat(vp), cnat(vq), vn), monus(cnat(vq), swap_zero(cnat(vp), vn))));
2381 result.push_back(data_equation(variable_list({vm, vn, vp, vq}), swap_zero_monus(cnat(vp), cnat(vq), vm, vn), swap_zero(monus(cnat(vp), cnat(vq)), monus(swap_zero(cnat(vp), vm), swap_zero(cnat(vq), vn)))));
2382 result.push_back(data_equation(variable_list(), sqrt(c0()), c0()));
2383 result.push_back(data_equation(variable_list({vp}), sqrt(cnat(vp)), sqrt_nat_aux_func(cnat(vp), c0(), sort_pos::powerlog2_pos(vp))));
2384 result.push_back(data_equation(variable_list({vm, vn}), sqrt_nat_aux_func(vn, vm, sort_pos::c1()), if_(less_equal(vn, vm), c0(), cnat(sort_pos::c1()))));
2385 result.push_back(data_equation(variable_list({vb, vm, vn, vp}), sqrt_nat_aux_func(vn, vm, sort_pos::cdub(vb, vp)), if_(greater(times(plus(cnat(sort_pos::cdub(vb, vp)), vm), cnat(sort_pos::cdub(vb, vp))), vn), sqrt_nat_aux_func(vn, vm, vp), plus(cnat(sort_pos::cdub(vb, vp)), sqrt_nat_aux_func(monus(vn, times(plus(cnat(sort_pos::cdub(vb, vp)), vm), cnat(sort_pos::cdub(vb, vp)))), plus(vm, cnat(sort_pos::cdub(sort_bool::false_(), sort_pos::cdub(vb, vp)))), vp)))));
2386 result.push_back(data_equation(variable_list({vm, vn, vu, vv}), equal_to(cpair(vm, vn), cpair(vu, vv)), sort_bool::and_(equal_to(vm, vu), equal_to(vn, vv))));
2387 result.push_back(data_equation(variable_list({vm, vn, vu, vv}), less(cpair(vm, vn), cpair(vu, vv)), sort_bool::or_(less(vm, vu), sort_bool::and_(equal_to(vm, vu), less(vn, vv)))));
2388 result.push_back(data_equation(variable_list({vm, vn, vu, vv}), less_equal(cpair(vm, vn), cpair(vu, vv)), sort_bool::or_(less(vm, vu), sort_bool::and_(equal_to(vm, vu), less_equal(vn, vv)))));
2389 result.push_back(data_equation(variable_list({vm, vn}), first(cpair(vm, vn)), vm));
2390 result.push_back(data_equation(variable_list({vm, vn}), last(cpair(vm, vn)), vn));
2392 result.push_back(data_equation(variable_list({vb, vp}), divmod(sort_pos::c1(), sort_pos::cdub(vb, vp)), cpair(c0(), cnat(sort_pos::c1()))));
2393 result.push_back(data_equation(variable_list({vb, vp, vq}), divmod(sort_pos::cdub(vb, vp), vq), generalised_divmod(divmod(vp, vq), vb, vq)));
2394 result.push_back(data_equation(variable_list({vb, vm, vn, vp}), generalised_divmod(cpair(vm, vn), vb, vp), doubly_generalised_divmod(dub(vb, vn), vm, vp)));
2395 result.push_back(data_equation(variable_list({vn, vp}), doubly_generalised_divmod(c0(), vn, vp), cpair(dub(sort_bool::false_(), vn), c0())));
2396 result.push_back(data_equation(variable_list({vn, vp, vq}), less(vp, vq), doubly_generalised_divmod(cnat(vp), vn, vq), cpair(dub(sort_bool::false_(), vn), cnat(vp))));
2397 result.push_back(data_equation(variable_list({vn, vp, vq}), less_equal(vq, vp), doubly_generalised_divmod(cnat(vp), vn, vq), cpair(dub(sort_bool::true_(), vn), gte_subtract_with_borrow(sort_bool::false_(), vp, vq))));
2398 return result;
2399 }
2400
2401 } // namespace sort_nat
2402
2403 } // namespace data
2404
2405} // namespace mcrl2
2406
2407#endif // MCRL2_DATA_NAT1_H
The class application.
The class basic_sort.
The standard sort bool_.
Term containing a string.
size_type size() const
Returns the number of arguments of this term.
Definition aterm.h:151
An application of a data expression to a number of arguments.
\brief A basic sort
Definition basic_sort.h:26
\brief A data equation
sort_expression sort() const
Returns the sort of the data expression.
Definition data.cpp:108
\brief A function symbol
const core::identifier_string & name() const
const sort_expression & sort() const
\brief A sort expression
\brief A data variable
Definition variable.h:28
Standard exception class for reporting runtime errors.
Definition exception.h:27
The class function symbol.
The class data_equation.
Exception classes for use in libraries and tools.
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
const core::identifier_string & succ_name()
Generate identifier succ.
Definition nat1.h:576
const data_expression & right(const data_expression &e)
Function for projecting out argument. right from an application.
Definition nat1.h:2257
bool is_cpair_application(const atermpp::aterm &e)
Recogniser for application of @cPair.
Definition nat1.h:248
void make_plus(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol +.
Definition nat1.h:893
const function_symbol & generalised_divmod()
Constructor for function symbol @gdivmod.
Definition nat1.h:1979
function_symbol maximum(const sort_expression &s0, const sort_expression &s1)
Definition nat1.h:422
const core::identifier_string & sqrt_nat_aux_func_name()
Generate identifier @sqrt_nat.
Definition nat1.h:1715
bool is_pos2nat_function_symbol(const atermpp::aterm &e)
Recogniser for function Pos2Nat.
Definition nat1.h:310
function_symbol succ(const sort_expression &s0)
Definition nat1.h:584
const function_symbol & monus()
Constructor for function symbol @monus.
Definition nat1.h:1331
void make_sqrt(data_expression &result, const data_expression &arg0)
Make an application of function symbol sqrt.
Definition nat1.h:1697
void make_generalised_divmod(data_expression &result, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2)
Make an application of function symbol @gdivmod.
Definition nat1.h:2017
bool is_gte_subtract_with_borrow_function_symbol(const atermpp::aterm &e)
Recogniser for function @gtesubtb.
Definition nat1.h:931
const function_symbol & c0()
Constructor for function symbol @c0.
Definition nat1.h:108
bool is_swap_zero_add_application(const atermpp::aterm &e)
Recogniser for application of @swap_zero_add.
Definition nat1.h:1509
void make_dub(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @dub.
Definition nat1.h:746
void make_div(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol div.
Definition nat1.h:1100
const core::identifier_string & maximum_name()
Generate identifier max.
Definition nat1.h:414
void make_mod(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol mod.
Definition nat1.h:1164
bool is_swap_zero_function_symbol(const atermpp::aterm &e)
Recogniser for function @swap_zero.
Definition nat1.h:1405
bool is_cnat_application(const atermpp::aterm &e)
Recogniser for application of @cNat.
Definition nat1.h:184
const core::identifier_string & mod_name()
Generate identifier mod.
Definition nat1.h:1118
const function_symbol & gte_subtract_with_borrow()
Constructor for function symbol @gtesubtb.
Definition nat1.h:921
bool is_generalised_divmod_application(const atermpp::aterm &e)
Recogniser for application of @gdivmod.
Definition nat1.h:2027
bool is_div_application(const atermpp::aterm &e)
Recogniser for application of div.
Definition nat1.h:1110
void make_doubly_generalised_divmod(data_expression &result, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2)
Make an application of function symbol @ggdivmod.
Definition nat1.h:2083
const core::identifier_string & swap_zero_min_name()
Generate identifier @swap_zero_min.
Definition nat1.h:1517
const function_symbol & divmod()
Constructor for function symbol @divmod.
Definition nat1.h:1915
bool is_pos2nat_application(const atermpp::aterm &e)
Recogniser for application of Pos2Nat.
Definition nat1.h:344
const function_symbol & cnat()
Constructor for function symbol @cNat.
Definition nat1.h:140
void make_pred(data_expression &result, const data_expression &arg0)
Make an application of function symbol pred.
Definition nat1.h:682
bool is_nat2pos_application(const atermpp::aterm &e)
Recogniser for application of Nat2Pos.
Definition nat1.h:406
bool is_mod_function_symbol(const atermpp::aterm &e)
Recogniser for function mod.
Definition nat1.h:1138
function_symbol exp(const sort_expression &s0, const sort_expression &s1)
Definition nat1.h:1190
const core::identifier_string & times_name()
Generate identifier *.
Definition nat1.h:977
const function_symbol & dubsucc()
Constructor for function symbol @dubsucc.
Definition nat1.h:774
const function_symbol & swap_zero_add()
Constructor for function symbol @swap_zero_add.
Definition nat1.h:1459
function_symbol_vector nat_mCRL2_usable_mappings()
Give all system defined mappings that can be used in mCRL2 specs for nat.
Definition nat1.h:2154
data_equation_vector nat_generate_equations_code()
Give all system defined equations for nat.
Definition nat1.h:2290
const function_symbol & cpair()
Constructor for function symbol @cPair.
Definition nat1.h:202
const basic_sort & nat()
Constructor for sort expression Nat.
Definition nat1.h:46
const core::identifier_string & nat_name()
Definition nat1.h:37
const core::identifier_string & exp_name()
Generate identifier exp.
Definition nat1.h:1182
const function_symbol & swap_zero()
Constructor for function symbol @swap_zero.
Definition nat1.h:1395
bool is_first_function_symbol(const atermpp::aterm &e)
Recogniser for function @first.
Definition nat1.h:1801
bool is_maximum_application(const atermpp::aterm &e)
Recogniser for application of max.
Definition nat1.h:491
void make_cpair(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @cPair.
Definition nat1.h:238
implementation_map nat_cpp_implementable_constructors()
Give all system defined constructors which have an implementation in C++ and not in rewrite rules for...
Definition nat1.h:281
bool is_nat(const sort_expression &e)
Recogniser for sort expression Nat.
Definition nat1.h:56
bool is_doubly_generalised_divmod_function_symbol(const atermpp::aterm &e)
Recogniser for function @ggdivmod.
Definition nat1.h:2055
bool is_plus_function_symbol(const atermpp::aterm &e)
Recogniser for function +.
Definition nat1.h:866
function_symbol_vector nat_generate_constructors_and_functions_code()
Give all system defined mappings and constructors for nat.
Definition nat1.h:2141
void make_nat2pos(data_expression &result, const data_expression &arg0)
Make an application of function symbol Nat2Pos.
Definition nat1.h:396
const core::identifier_string & plus_name()
Generate identifier +.
Definition nat1.h:826
const core::identifier_string & natpair_name()
Definition nat1.h:66
const data_expression & left(const data_expression &e)
Function for projecting out argument. left from an application.
Definition nat1.h:2245
bool is_succ_function_symbol(const atermpp::aterm &e)
Recogniser for function succ.
Definition nat1.h:595
void make_maximum(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol max.
Definition nat1.h:481
const core::identifier_string & div_name()
Generate identifier div.
Definition nat1.h:1054
const function_symbol & mod()
Constructor for function symbol mod.
Definition nat1.h:1128
void make_monus(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @monus.
Definition nat1.h:1367
const function_symbol & sqrt()
Constructor for function symbol sqrt.
Definition nat1.h:1663
void make_dubsucc(data_expression &result, const data_expression &arg0)
Make an application of function symbol @dubsucc.
Definition nat1.h:808
const function_symbol & doubly_generalised_divmod()
Constructor for function symbol @ggdivmod.
Definition nat1.h:2045
const function_symbol & pred()
Constructor for function symbol pred.
Definition nat1.h:648
void make_even(data_expression &result, const data_expression &arg0)
Make an application of function symbol @even.
Definition nat1.h:1303
void make_gte_subtract_with_borrow(data_expression &result, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2)
Make an application of function symbol @gtesubtb.
Definition nat1.h:959
bool is_sqrt_nat_aux_func_function_symbol(const atermpp::aterm &e)
Recogniser for function @sqrt_nat.
Definition nat1.h:1735
const function_symbol & even()
Constructor for function symbol @even.
Definition nat1.h:1269
const core::identifier_string & first_name()
Generate identifier @first.
Definition nat1.h:1781
void make_swap_zero_monus(data_expression &result, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2, const data_expression &arg3)
Make an application of function symbol @swap_zero_monus.
Definition nat1.h:1635
bool is_succ_application(const atermpp::aterm &e)
Recogniser for application of succ.
Definition nat1.h:630
bool is_dub_function_symbol(const atermpp::aterm &e)
Recogniser for function @dub.
Definition nat1.h:720
bool is_swap_zero_application(const atermpp::aterm &e)
Recogniser for application of @swap_zero.
Definition nat1.h:1441
const core::identifier_string & even_name()
Generate identifier @even.
Definition nat1.h:1259
const core::identifier_string & swap_zero_name()
Generate identifier @swap_zero.
Definition nat1.h:1385
void make_pos2nat(data_expression &result, const data_expression &arg0)
Make an application of function symbol Pos2Nat.
Definition nat1.h:334
bool is_minimum_application(const atermpp::aterm &e)
Recogniser for application of min.
Definition nat1.h:568
bool is_exp_function_symbol(const atermpp::aterm &e)
Recogniser for function exp.
Definition nat1.h:1214
bool is_monus_function_symbol(const atermpp::aterm &e)
Recogniser for function @monus.
Definition nat1.h:1341
bool is_mod_application(const atermpp::aterm &e)
Recogniser for application of mod.
Definition nat1.h:1174
bool is_even_function_symbol(const atermpp::aterm &e)
Recogniser for function @even.
Definition nat1.h:1279
const core::identifier_string & pred_name()
Generate identifier pred.
Definition nat1.h:638
bool is_exp_application(const atermpp::aterm &e)
Recogniser for application of exp.
Definition nat1.h:1251
const function_symbol & swap_zero_min()
Constructor for function symbol @swap_zero_min.
Definition nat1.h:1527
function_symbol minimum(const sort_expression &s0, const sort_expression &s1)
Definition nat1.h:507
const function_symbol & sqrt_nat_aux_func()
Constructor for function symbol @sqrt_nat.
Definition nat1.h:1725
bool is_last_application(const atermpp::aterm &e)
Recogniser for application of @last.
Definition nat1.h:1897
void make_exp(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol exp.
Definition nat1.h:1241
const function_symbol & div()
Constructor for function symbol div.
Definition nat1.h:1064
const core::identifier_string & doubly_generalised_divmod_name()
Generate identifier @ggdivmod.
Definition nat1.h:2035
void make_succ(data_expression &result, const data_expression &arg0)
Make an application of function symbol succ.
Definition nat1.h:620
bool is_maximum_function_symbol(const atermpp::aterm &e)
Recogniser for function max.
Definition nat1.h:454
bool is_gte_subtract_with_borrow_application(const atermpp::aterm &e)
Recogniser for application of @gtesubtb.
Definition nat1.h:969
bool is_swap_zero_min_application(const atermpp::aterm &e)
Recogniser for application of @swap_zero_min.
Definition nat1.h:1577
function_symbol plus(const sort_expression &s0, const sort_expression &s1)
Definition nat1.h:834
const core::identifier_string & dubsucc_name()
Generate identifier @dubsucc.
Definition nat1.h:764
bool is_first_application(const atermpp::aterm &e)
Recogniser for application of @first.
Definition nat1.h:1835
std::map< function_symbol, std::pair< std::function< void(data_expression &, const data_expression &)>, std::string > > implementation_map
Definition nat1.h:277
bool is_sqrt_application(const atermpp::aterm &e)
Recogniser for application of sqrt.
Definition nat1.h:1707
const function_symbol & first()
Constructor for function symbol @first.
Definition nat1.h:1791
void make_first(data_expression &result, const data_expression &arg0)
Make an application of function symbol @first.
Definition nat1.h:1825
bool is_pred_function_symbol(const atermpp::aterm &e)
Recogniser for function pred.
Definition nat1.h:658
bool is_generalised_divmod_function_symbol(const atermpp::aterm &e)
Recogniser for function @gdivmod.
Definition nat1.h:1989
void make_swap_zero_add(data_expression &result, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2, const data_expression &arg3)
Make an application of function symbol @swap_zero_add.
Definition nat1.h:1499
const core::identifier_string & swap_zero_monus_name()
Generate identifier @swap_zero_monus.
Definition nat1.h:1585
function_symbol_vector nat_generate_functions_code()
Give all system defined mappings for nat.
Definition nat1.h:2100
bool is_cpair_function_symbol(const atermpp::aterm &e)
Recogniser for function @cPair.
Definition nat1.h:212
bool is_divmod_function_symbol(const atermpp::aterm &e)
Recogniser for function @divmod.
Definition nat1.h:1925
const function_symbol & swap_zero_monus()
Constructor for function symbol @swap_zero_monus.
Definition nat1.h:1595
void make_times(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol *.
Definition nat1.h:1036
bool is_c0_function_symbol(const atermpp::aterm &e)
Recogniser for function @c0.
Definition nat1.h:118
const core::identifier_string & generalised_divmod_name()
Generate identifier @gdivmod.
Definition nat1.h:1969
const function_symbol & nat2pos()
Constructor for function symbol Nat2Pos.
Definition nat1.h:362
const core::identifier_string & monus_name()
Generate identifier @monus.
Definition nat1.h:1321
const core::identifier_string & cpair_name()
Generate identifier @cPair.
Definition nat1.h:192
const core::identifier_string & nat2pos_name()
Generate identifier Nat2Pos.
Definition nat1.h:352
const data_expression & arg3(const data_expression &e)
Function for projecting out argument. arg3 from an application.
Definition nat1.h:2269
void make_divmod(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @divmod.
Definition nat1.h:1951
implementation_map nat_cpp_implementable_mappings()
Give all system defined mappings that are to be implemented in C++ code for nat.
Definition nat1.h:2198
const data_expression & arg2(const data_expression &e)
Function for projecting out argument. arg2 from an application.
Definition nat1.h:2233
const core::identifier_string & gte_subtract_with_borrow_name()
Generate identifier @gtesubtb.
Definition nat1.h:911
const basic_sort & natpair()
Constructor for sort expression @NatPair.
Definition nat1.h:75
const data_expression & arg1(const data_expression &e)
Function for projecting out argument. arg1 from an application.
Definition nat1.h:2221
bool is_swap_zero_monus_application(const atermpp::aterm &e)
Recogniser for application of @swap_zero_monus.
Definition nat1.h:1645
void make_swap_zero_min(data_expression &result, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2, const data_expression &arg3)
Make an application of function symbol @swap_zero_min.
Definition nat1.h:1567
const core::identifier_string & dub_name()
Generate identifier @dub.
Definition nat1.h:700
const core::identifier_string & cnat_name()
Generate identifier @cNat.
Definition nat1.h:130
const core::identifier_string & c0_name()
Generate identifier @c0.
Definition nat1.h:98
bool is_swap_zero_add_function_symbol(const atermpp::aterm &e)
Recogniser for function @swap_zero_add.
Definition nat1.h:1469
bool is_natpair(const sort_expression &e)
Recogniser for sort expression @NatPair.
Definition nat1.h:85
bool is_swap_zero_monus_function_symbol(const atermpp::aterm &e)
Recogniser for function @swap_zero_monus.
Definition nat1.h:1605
const core::identifier_string & pos2nat_name()
Generate identifier Pos2Nat.
Definition nat1.h:290
const core::identifier_string & last_name()
Generate identifier @last.
Definition nat1.h:1843
const core::identifier_string & minimum_name()
Generate identifier min.
Definition nat1.h:499
void make_sqrt_nat_aux_func(data_expression &result, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2)
Make an application of function symbol @sqrt_nat.
Definition nat1.h:1763
bool is_sqrt_nat_aux_func_application(const atermpp::aterm &e)
Recogniser for application of @sqrt_nat.
Definition nat1.h:1773
const data_expression & arg(const data_expression &e)
Function for projecting out argument. arg from an application.
Definition nat1.h:2209
bool is_sqrt_function_symbol(const atermpp::aterm &e)
Recogniser for function sqrt.
Definition nat1.h:1673
bool is_cnat_function_symbol(const atermpp::aterm &e)
Recogniser for function @cNat.
Definition nat1.h:150
function_symbol_vector nat_mCRL2_usable_constructors()
Give all defined constructors which can be used in mCRL2 specs for nat.
Definition nat1.h:267
const function_symbol & last()
Constructor for function symbol @last.
Definition nat1.h:1853
bool is_pred_application(const atermpp::aterm &e)
Recogniser for application of pred.
Definition nat1.h:692
bool is_plus_application(const atermpp::aterm &e)
Recogniser for application of +.
Definition nat1.h:903
void make_swap_zero(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @swap_zero.
Definition nat1.h:1431
void make_minimum(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol min.
Definition nat1.h:558
const core::identifier_string & swap_zero_add_name()
Generate identifier @swap_zero_add.
Definition nat1.h:1449
bool is_dubsucc_function_symbol(const atermpp::aterm &e)
Recogniser for function @dubsucc.
Definition nat1.h:784
bool is_dubsucc_application(const atermpp::aterm &e)
Recogniser for application of @dubsucc.
Definition nat1.h:818
bool is_swap_zero_min_function_symbol(const atermpp::aterm &e)
Recogniser for function @swap_zero_min.
Definition nat1.h:1537
function_symbol_vector nat_generate_constructors_code()
Give all system defined constructors for nat.
Definition nat1.h:255
const core::identifier_string & sqrt_name()
Generate identifier sqrt.
Definition nat1.h:1653
bool is_doubly_generalised_divmod_application(const atermpp::aterm &e)
Recogniser for application of @ggdivmod.
Definition nat1.h:2093
bool is_last_function_symbol(const atermpp::aterm &e)
Recogniser for function @last.
Definition nat1.h:1863
bool is_times_application(const atermpp::aterm &e)
Recogniser for application of *.
Definition nat1.h:1046
bool is_div_function_symbol(const atermpp::aterm &e)
Recogniser for function div.
Definition nat1.h:1074
const core::identifier_string & divmod_name()
Generate identifier @divmod.
Definition nat1.h:1905
bool is_minimum_function_symbol(const atermpp::aterm &e)
Recogniser for function min.
Definition nat1.h:531
function_symbol times(const sort_expression &s0, const sort_expression &s1)
Definition nat1.h:985
bool is_times_function_symbol(const atermpp::aterm &e)
Recogniser for function *.
Definition nat1.h:1009
bool is_dub_application(const atermpp::aterm &e)
Recogniser for application of @dub.
Definition nat1.h:756
bool is_nat2pos_function_symbol(const atermpp::aterm &e)
Recogniser for function Nat2Pos.
Definition nat1.h:372
const function_symbol & dub()
Constructor for function symbol @dub.
Definition nat1.h:710
void make_cnat(data_expression &result, const data_expression &arg0)
Make an application of function symbol @cNat.
Definition nat1.h:174
const function_symbol & pos2nat()
Constructor for function symbol Pos2Nat.
Definition nat1.h:300
void make_last(data_expression &result, const data_expression &arg0)
Make an application of function symbol @last.
Definition nat1.h:1887
bool is_monus_application(const atermpp::aterm &e)
Recogniser for application of @monus.
Definition nat1.h:1377
bool is_divmod_application(const atermpp::aterm &e)
Recogniser for application of @divmod.
Definition nat1.h:1961
const data_expression & arg4(const data_expression &e)
Function for projecting out argument. arg4 from an application.
Definition nat1.h:2281
bool is_even_application(const atermpp::aterm &e)
Recogniser for application of @even.
Definition nat1.h:1313
const function_symbol & powerlog2_pos()
Constructor for function symbol @powerlog2.
Definition pos1.h:652
const function_symbol & c1()
Constructor for function symbol @c1.
Definition pos1.h:78
const function_symbol & add_with_carry()
Constructor for function symbol @addc.
Definition pos1.h:522
const function_symbol & cdub()
Constructor for function symbol @cDub.
Definition pos1.h:110
const basic_sort & pos()
Constructor for sort expression Pos.
Definition pos1.h:45
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_function_symbol(const atermpp::aterm &x)
Returns true if the term t is a function symbol.
bool is_basic_sort(const atermpp::aterm &x)
Returns true if the term t is a basic sort.
atermpp::term_list< variable > variable_list
\brief list of variables
function_symbol equal_to(const sort_expression &s)
Constructor for function symbol ==.
Definition standard.h:126
bool is_application(const atermpp::aterm &x)
Returns true if the term t is an application.
std::vector< function_symbol > function_symbol_vector
\brief vector of function_symbols
function_symbol if_(const sort_expression &s)
Constructor for function symbol if.
Definition standard.h:200
void make_application(atermpp::aterm &result)
Make function for an application.
function_symbol greater(const sort_expression &s)
Constructor for function symbol >
Definition standard.h:314
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
Standard functions that are available for all sorts.