mCRL2
Loading...
Searching...
No Matches
list64.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//
9/// \file mcrl2/data/list.h
10/// \brief The standard sort list.
11///
12/// This file was generated from the data sort specification
13/// mcrl2/data/build/list.spec.
14
15#ifndef MCRL2_DATA_LIST64_H
16#define MCRL2_DATA_LIST64_H
17
18#include "functional" // std::function
19#include "mcrl2/utilities/exception.h"
20#include "mcrl2/data/basic_sort.h"
21#include "mcrl2/data/function_sort.h"
22#include "mcrl2/data/function_symbol.h"
23#include "mcrl2/data/application.h"
24#include "mcrl2/data/data_equation.h"
25#include "mcrl2/data/standard.h"
26#include "mcrl2/data/container_sort.h"
27#include "mcrl2/data/bool.h"
28#include "mcrl2/data/pos64.h"
29#include "mcrl2/data/nat64.h"
30
31/// \brief Namespace for system defined sort list.
32namespace mcrl2::data::sort_list
33{
34
35 /// \brief Constructor for sort expression List(S)
36 /// \param s A sort expression
37 /// \return Sort expression list(s)
38 inline
40 {
42 return list;
43 }
44
45 /// \brief Recogniser for sort expression List(s)
46 /// \param e A sort expression
47 /// \return true iff e is a container sort of which the name matches
48 /// list
49 inline
50 bool is_list(const sort_expression& e)
51 {
53 {
55 }
56 return false;
57 }
58
59
60 /// \brief Generate identifier [].
61 /// \return Identifier [].
62 inline
63 const core::identifier_string& empty_name()
64 {
65 static core::identifier_string empty_name = core::identifier_string("[]");
66 return empty_name;
67 }
68
69 /// \brief Constructor for function symbol [].
70 /// \param s A sort expression.
71 /// \return Function symbol empty.
72 inline
74 {
76 return empty;
77 }
78
79 /// \brief Recogniser for function [].
80 /// \param e A data expression.
81 /// \return true iff e is the function symbol matching [].
82 inline
84 {
86 {
87 return atermpp::down_cast<function_symbol>(e).name() == empty_name();
88 }
89 return false;
90 }
91
92 /// \brief Generate identifier |>.
93 /// \return Identifier |>.
94 inline
95 const core::identifier_string& cons_name()
96 {
97 static core::identifier_string cons_name = core::identifier_string("|>");
98 return cons_name;
99 }
100
101 /// \brief Constructor for function symbol |>.
102 /// \param s A sort expression.
103 /// \return Function symbol cons_.
104 inline
106 {
108 return cons_;
109 }
110
111 /// \brief Recogniser for function |>.
112 /// \param e A data expression.
113 /// \return true iff e is the function symbol matching |>.
114 inline
116 {
118 {
119 return atermpp::down_cast<function_symbol>(e).name() == cons_name();
120 }
121 return false;
122 }
123
124 /// \brief Application of function symbol |>.
125 /// \param[in] s A sort expression.
126 /// \param[in] arg0 A data expression.
127 /// \param[in] arg1 A data expression.
128 /// \return Application of |> to a number of arguments.
129 inline
130 application cons_(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
131 {
132 return sort_list::cons_(s)(arg0, arg1);
133 }
134
135 /// \brief Make an application of function symbol |>.
136 /// \param[out] result The data expression where the |> expression is put.
137 /// \param[in] s A sort expression.
138 /// \param[in] arg0 A data expression.
139 /// \param[in] arg1 A data expression.
140 inline
141 void make_cons(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
142 {
143 make_application(result, sort_list::cons_(s),arg0, arg1);
144 }
145
146 /// \brief Recogniser for application of |>.
147 /// \param e A data expression.
148 /// \return true iff e is an application of function symbol cons_ to a
149 /// number of arguments.
150 inline
151 bool is_cons_application(const atermpp::aterm& e)
152 {
153 return is_application(e) && is_cons_function_symbol(atermpp::down_cast<application>(e).head());
154 }
155 /// \brief Give all system defined constructors for list.
156 /// \param s A sort expression.
157 /// \return All system defined constructors for list.
158 inline
160 {
161 function_symbol_vector result;
162 result.push_back(sort_list::empty(s));
163 result.push_back(sort_list::cons_(s));
164
165 return result;
166 }
167 /// \brief Give all defined constructors which can be used in mCRL2 specs for list.
168 /// \param s A sort expression.
169 /// \return All system defined constructors that can be used in an mCRL2 specification for list.
170 inline
172 {
173 function_symbol_vector result;
174 result.push_back(sort_list::empty(s));
175 result.push_back(sort_list::cons_(s));
176
177 return result;
178 }
179 // 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
181 /// \brief Give all system defined constructors which have an implementation in C++ and not in rewrite rules for list.
182 /// \param s A sort expression.
183 /// \return All system defined constructors that are to be implemented in C++ for list.
184 inline
186 {
187 implementation_map result;
188 return result;
189 }
190
191 /// \brief Generate identifier in.
192 /// \return Identifier in.
193 inline
194 const core::identifier_string& in_name()
195 {
196 static core::identifier_string in_name = core::identifier_string("in");
197 return in_name;
198 }
199
200 /// \brief Constructor for function symbol in.
201 /// \param s A sort expression.
202 /// \return Function symbol in.
203 inline
205 {
207 return in;
208 }
209
210 /// \brief Recogniser for function in.
211 /// \param e A data expression.
212 /// \return true iff e is the function symbol matching in.
213 inline
214 bool is_in_function_symbol(const atermpp::aterm& e)
215 {
217 {
218 return atermpp::down_cast<function_symbol>(e).name() == in_name();
219 }
220 return false;
221 }
222
223 /// \brief Application of function symbol in.
224 /// \param[in] s A sort expression.
225 /// \param[in] arg0 A data expression.
226 /// \param[in] arg1 A data expression.
227 /// \return Application of in to a number of arguments.
228 inline
229 application in(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
230 {
231 return sort_list::in(s)(arg0, arg1);
232 }
233
234 /// \brief Make an application of function symbol in.
235 /// \param[out] result The data expression where the in expression is put.
236 /// \param[in] s A sort expression.
237 /// \param[in] arg0 A data expression.
238 /// \param[in] arg1 A data expression.
239 inline
240 void make_in(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
241 {
242 make_application(result, sort_list::in(s),arg0, arg1);
243 }
244
245 /// \brief Recogniser for application of in.
246 /// \param e A data expression.
247 /// \return true iff e is an application of function symbol in to a
248 /// number of arguments.
249 inline
250 bool is_in_application(const atermpp::aterm& e)
251 {
252 return is_application(e) && is_in_function_symbol(atermpp::down_cast<application>(e).head());
253 }
254
255 /// \brief Generate identifier #.
256 /// \return Identifier #.
257 inline
258 const core::identifier_string& count_name()
259 {
260 static core::identifier_string count_name = core::identifier_string("#");
261 return count_name;
262 }
263
264 /// \brief Constructor for function symbol #.
265 /// \param s A sort expression.
266 /// \return Function symbol count.
267 inline
269 {
271 return count;
272 }
273
274 /// \brief Recogniser for function #.
275 /// \param e A data expression.
276 /// \return true iff e is the function symbol matching #.
277 inline
279 {
281 {
282 return atermpp::down_cast<function_symbol>(e).name() == count_name();
283 }
284 return false;
285 }
286
287 /// \brief Application of function symbol #.
288 /// \param[in] s A sort expression.
289 /// \param[in] arg0 A data expression.
290 /// \return Application of # to a number of arguments.
291 inline
292 application count(const sort_expression& s, const data_expression& arg0)
293 {
294 return sort_list::count(s)(arg0);
295 }
296
297 /// \brief Make an application of function symbol #.
298 /// \param[out] result The data expression where the # expression is put.
299 /// \param[in] s A sort expression.
300 /// \param[in] arg0 A data expression.
301 inline
302 void make_count(data_expression& result, const sort_expression& s, const data_expression& arg0)
303 {
304 make_application(result, sort_list::count(s),arg0);
305 }
306
307 /// \brief Recogniser for application of #.
308 /// \param e A data expression.
309 /// \return true iff e is an application of function symbol count to a
310 /// number of arguments.
311 inline
312 bool is_count_application(const atermpp::aterm& e)
313 {
314 return is_application(e) && is_count_function_symbol(atermpp::down_cast<application>(e).head());
315 }
316
317 /// \brief Generate identifier <|.
318 /// \return Identifier <|.
319 inline
320 const core::identifier_string& snoc_name()
321 {
322 static core::identifier_string snoc_name = core::identifier_string("<|");
323 return snoc_name;
324 }
325
326 /// \brief Constructor for function symbol <|.
327 /// \param s A sort expression.
328 /// \return Function symbol snoc.
329 inline
331 {
333 return snoc;
334 }
335
336 /// \brief Recogniser for function <|.
337 /// \param e A data expression.
338 /// \return true iff e is the function symbol matching <|.
339 inline
341 {
343 {
344 return atermpp::down_cast<function_symbol>(e).name() == snoc_name();
345 }
346 return false;
347 }
348
349 /// \brief Application of function symbol <|.
350 /// \param[in] s A sort expression.
351 /// \param[in] arg0 A data expression.
352 /// \param[in] arg1 A data expression.
353 /// \return Application of <| to a number of arguments.
354 inline
355 application snoc(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
356 {
357 return sort_list::snoc(s)(arg0, arg1);
358 }
359
360 /// \brief Make an application of function symbol <|.
361 /// \param[out] result The data expression where the <| expression is put.
362 /// \param[in] s A sort expression.
363 /// \param[in] arg0 A data expression.
364 /// \param[in] arg1 A data expression.
365 inline
366 void make_snoc(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
367 {
368 make_application(result, sort_list::snoc(s),arg0, arg1);
369 }
370
371 /// \brief Recogniser for application of <|.
372 /// \param e A data expression.
373 /// \return true iff e is an application of function symbol snoc to a
374 /// number of arguments.
375 inline
376 bool is_snoc_application(const atermpp::aterm& e)
377 {
378 return is_application(e) && is_snoc_function_symbol(atermpp::down_cast<application>(e).head());
379 }
380
381 /// \brief Generate identifier ++.
382 /// \return Identifier ++.
383 inline
384 const core::identifier_string& concat_name()
385 {
386 static core::identifier_string concat_name = core::identifier_string("++");
387 return concat_name;
388 }
389
390 /// \brief Constructor for function symbol ++.
391 /// \param s A sort expression.
392 /// \return Function symbol concat.
393 inline
395 {
397 return concat;
398 }
399
400 /// \brief Recogniser for function ++.
401 /// \param e A data expression.
402 /// \return true iff e is the function symbol matching ++.
403 inline
405 {
407 {
408 return atermpp::down_cast<function_symbol>(e).name() == concat_name();
409 }
410 return false;
411 }
412
413 /// \brief Application of function symbol ++.
414 /// \param[in] s A sort expression.
415 /// \param[in] arg0 A data expression.
416 /// \param[in] arg1 A data expression.
417 /// \return Application of ++ to a number of arguments.
418 inline
419 application concat(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
420 {
421 return sort_list::concat(s)(arg0, arg1);
422 }
423
424 /// \brief Make an application of function symbol ++.
425 /// \param[out] result The data expression where the ++ expression is put.
426 /// \param[in] s A sort expression.
427 /// \param[in] arg0 A data expression.
428 /// \param[in] arg1 A data expression.
429 inline
430 void make_concat(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
431 {
432 make_application(result, sort_list::concat(s),arg0, arg1);
433 }
434
435 /// \brief Recogniser for application of ++.
436 /// \param e A data expression.
437 /// \return true iff e is an application of function symbol concat to a
438 /// number of arguments.
439 inline
440 bool is_concat_application(const atermpp::aterm& e)
441 {
442 return is_application(e) && is_concat_function_symbol(atermpp::down_cast<application>(e).head());
443 }
444
445 /// \brief Generate identifier ..
446 /// \return Identifier ..
447 inline
448 const core::identifier_string& element_at_name()
449 {
450 static core::identifier_string element_at_name = core::identifier_string(".");
451 return element_at_name;
452 }
453
454 /// \brief Constructor for function symbol ..
455 /// \param s A sort expression.
456 /// \return Function symbol element_at.
457 inline
459 {
461 return element_at;
462 }
463
464 /// \brief Recogniser for function ..
465 /// \param e A data expression.
466 /// \return true iff e is the function symbol matching ..
467 inline
469 {
471 {
472 return atermpp::down_cast<function_symbol>(e).name() == element_at_name();
473 }
474 return false;
475 }
476
477 /// \brief Application of function symbol ..
478 /// \param[in] s A sort expression.
479 /// \param[in] arg0 A data expression.
480 /// \param[in] arg1 A data expression.
481 /// \return Application of . to a number of arguments.
482 inline
483 application element_at(const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
484 {
485 return sort_list::element_at(s)(arg0, arg1);
486 }
487
488 /// \brief Make an application of function symbol ..
489 /// \param[out] result The data expression where the . expression is put.
490 /// \param[in] s A sort expression.
491 /// \param[in] arg0 A data expression.
492 /// \param[in] arg1 A data expression.
493 inline
494 void make_element_at(data_expression& result, const sort_expression& s, const data_expression& arg0, const data_expression& arg1)
495 {
496 make_application(result, sort_list::element_at(s),arg0, arg1);
497 }
498
499 /// \brief Recogniser for application of ..
500 /// \param e A data expression.
501 /// \return true iff e is an application of function symbol element_at to a
502 /// number of arguments.
503 inline
505 {
506 return is_application(e) && is_element_at_function_symbol(atermpp::down_cast<application>(e).head());
507 }
508
509 /// \brief Generate identifier head.
510 /// \return Identifier head.
511 inline
512 const core::identifier_string& head_name()
513 {
514 static core::identifier_string head_name = core::identifier_string("head");
515 return head_name;
516 }
517
518 /// \brief Constructor for function symbol head.
519 /// \param s A sort expression.
520 /// \return Function symbol head.
521 inline
523 {
525 return head;
526 }
527
528 /// \brief Recogniser for function head.
529 /// \param e A data expression.
530 /// \return true iff e is the function symbol matching head.
531 inline
533 {
535 {
536 return atermpp::down_cast<function_symbol>(e).name() == head_name();
537 }
538 return false;
539 }
540
541 /// \brief Application of function symbol head.
542 /// \param[in] s A sort expression.
543 /// \param[in] arg0 A data expression.
544 /// \return Application of head to a number of arguments.
545 inline
546 application head(const sort_expression& s, const data_expression& arg0)
547 {
548 return sort_list::head(s)(arg0);
549 }
550
551 /// \brief Make an application of function symbol head.
552 /// \param[out] result The data expression where the head expression is put.
553 /// \param[in] s A sort expression.
554 /// \param[in] arg0 A data expression.
555 inline
556 void make_head(data_expression& result, const sort_expression& s, const data_expression& arg0)
557 {
558 make_application(result, sort_list::head(s),arg0);
559 }
560
561 /// \brief Recogniser for application of head.
562 /// \param e A data expression.
563 /// \return true iff e is an application of function symbol head to a
564 /// number of arguments.
565 inline
566 bool is_head_application(const atermpp::aterm& e)
567 {
568 return is_application(e) && is_head_function_symbol(atermpp::down_cast<application>(e).head());
569 }
570
571 /// \brief Generate identifier tail.
572 /// \return Identifier tail.
573 inline
574 const core::identifier_string& tail_name()
575 {
576 static core::identifier_string tail_name = core::identifier_string("tail");
577 return tail_name;
578 }
579
580 /// \brief Constructor for function symbol tail.
581 /// \param s A sort expression.
582 /// \return Function symbol tail.
583 inline
585 {
587 return tail;
588 }
589
590 /// \brief Recogniser for function tail.
591 /// \param e A data expression.
592 /// \return true iff e is the function symbol matching tail.
593 inline
595 {
597 {
598 return atermpp::down_cast<function_symbol>(e).name() == tail_name();
599 }
600 return false;
601 }
602
603 /// \brief Application of function symbol tail.
604 /// \param[in] s A sort expression.
605 /// \param[in] arg0 A data expression.
606 /// \return Application of tail to a number of arguments.
607 inline
608 application tail(const sort_expression& s, const data_expression& arg0)
609 {
610 return sort_list::tail(s)(arg0);
611 }
612
613 /// \brief Make an application of function symbol tail.
614 /// \param[out] result The data expression where the tail expression is put.
615 /// \param[in] s A sort expression.
616 /// \param[in] arg0 A data expression.
617 inline
618 void make_tail(data_expression& result, const sort_expression& s, const data_expression& arg0)
619 {
620 make_application(result, sort_list::tail(s),arg0);
621 }
622
623 /// \brief Recogniser for application of tail.
624 /// \param e A data expression.
625 /// \return true iff e is an application of function symbol tail to a
626 /// number of arguments.
627 inline
628 bool is_tail_application(const atermpp::aterm& e)
629 {
630 return is_application(e) && is_tail_function_symbol(atermpp::down_cast<application>(e).head());
631 }
632
633 /// \brief Generate identifier rhead.
634 /// \return Identifier rhead.
635 inline
636 const core::identifier_string& rhead_name()
637 {
638 static core::identifier_string rhead_name = core::identifier_string("rhead");
639 return rhead_name;
640 }
641
642 /// \brief Constructor for function symbol rhead.
643 /// \param s A sort expression.
644 /// \return Function symbol rhead.
645 inline
647 {
649 return rhead;
650 }
651
652 /// \brief Recogniser for function rhead.
653 /// \param e A data expression.
654 /// \return true iff e is the function symbol matching rhead.
655 inline
657 {
659 {
660 return atermpp::down_cast<function_symbol>(e).name() == rhead_name();
661 }
662 return false;
663 }
664
665 /// \brief Application of function symbol rhead.
666 /// \param[in] s A sort expression.
667 /// \param[in] arg0 A data expression.
668 /// \return Application of rhead to a number of arguments.
669 inline
670 application rhead(const sort_expression& s, const data_expression& arg0)
671 {
672 return sort_list::rhead(s)(arg0);
673 }
674
675 /// \brief Make an application of function symbol rhead.
676 /// \param[out] result The data expression where the rhead expression is put.
677 /// \param[in] s A sort expression.
678 /// \param[in] arg0 A data expression.
679 inline
680 void make_rhead(data_expression& result, const sort_expression& s, const data_expression& arg0)
681 {
682 make_application(result, sort_list::rhead(s),arg0);
683 }
684
685 /// \brief Recogniser for application of rhead.
686 /// \param e A data expression.
687 /// \return true iff e is an application of function symbol rhead to a
688 /// number of arguments.
689 inline
690 bool is_rhead_application(const atermpp::aterm& e)
691 {
692 return is_application(e) && is_rhead_function_symbol(atermpp::down_cast<application>(e).head());
693 }
694
695 /// \brief Generate identifier rtail.
696 /// \return Identifier rtail.
697 inline
698 const core::identifier_string& rtail_name()
699 {
700 static core::identifier_string rtail_name = core::identifier_string("rtail");
701 return rtail_name;
702 }
703
704 /// \brief Constructor for function symbol rtail.
705 /// \param s A sort expression.
706 /// \return Function symbol rtail.
707 inline
709 {
711 return rtail;
712 }
713
714 /// \brief Recogniser for function rtail.
715 /// \param e A data expression.
716 /// \return true iff e is the function symbol matching rtail.
717 inline
719 {
721 {
722 return atermpp::down_cast<function_symbol>(e).name() == rtail_name();
723 }
724 return false;
725 }
726
727 /// \brief Application of function symbol rtail.
728 /// \param[in] s A sort expression.
729 /// \param[in] arg0 A data expression.
730 /// \return Application of rtail to a number of arguments.
731 inline
732 application rtail(const sort_expression& s, const data_expression& arg0)
733 {
734 return sort_list::rtail(s)(arg0);
735 }
736
737 /// \brief Make an application of function symbol rtail.
738 /// \param[out] result The data expression where the rtail expression is put.
739 /// \param[in] s A sort expression.
740 /// \param[in] arg0 A data expression.
741 inline
742 void make_rtail(data_expression& result, const sort_expression& s, const data_expression& arg0)
743 {
744 make_application(result, sort_list::rtail(s),arg0);
745 }
746
747 /// \brief Recogniser for application of rtail.
748 /// \param e A data expression.
749 /// \return true iff e is an application of function symbol rtail to a
750 /// number of arguments.
751 inline
752 bool is_rtail_application(const atermpp::aterm& e)
753 {
754 return is_application(e) && is_rtail_function_symbol(atermpp::down_cast<application>(e).head());
755 }
756 /// \brief Give all system defined mappings for list
757 /// \param s A sort expression
758 /// \return All system defined mappings for list
759 inline
761 {
762 function_symbol_vector result;
763 result.push_back(sort_list::in(s));
764 result.push_back(sort_list::count(s));
765 result.push_back(sort_list::snoc(s));
766 result.push_back(sort_list::concat(s));
767 result.push_back(sort_list::element_at(s));
768 result.push_back(sort_list::head(s));
769 result.push_back(sort_list::tail(s));
770 result.push_back(sort_list::rhead(s));
771 result.push_back(sort_list::rtail(s));
772 return result;
773 }
774
775 /// \brief Give all system defined mappings and constructors for list
776 /// \param s A sort expression
777 /// \return All system defined mappings for list
778 inline
780 {
781 function_symbol_vector result=list_generate_functions_code(s);
782 for(const function_symbol& f: list_generate_constructors_code(s))
783 {
784 result.push_back(f);
785 }
786 return result;
787 }
788
789 /// \brief Give all system defined mappings that can be used in mCRL2 specs for list
790 /// \param s A sort expression
791 /// \return All system defined mappings for that can be used in mCRL2 specificationis list
792 inline
794 {
795 function_symbol_vector result;
796 result.push_back(sort_list::in(s));
797 result.push_back(sort_list::count(s));
798 result.push_back(sort_list::snoc(s));
799 result.push_back(sort_list::concat(s));
800 result.push_back(sort_list::element_at(s));
801 result.push_back(sort_list::head(s));
802 result.push_back(sort_list::tail(s));
803 result.push_back(sort_list::rhead(s));
804 result.push_back(sort_list::rtail(s));
805 return result;
806 }
807
808
809 // 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
811 /// \brief Give all system defined mappings that are to be implemented in C++ code for list
812 /// \param s A sort expression
813 /// \return A mapping from C++ implementable function symbols to system defined mappings implemented in C++ code for list
814 inline
816 {
817 implementation_map result;
818 return result;
819 }
820 ///\brief Function for projecting out argument.
821 /// left from an application.
822 /// \param e A data expression.
823 /// \pre left is defined for e.
824 /// \return The argument of e that corresponds to left.
825 inline
826 const data_expression& left(const data_expression& e)
827 {
829 return atermpp::down_cast<application>(e)[0];
830 }
831
832 ///\brief Function for projecting out argument.
833 /// right from an application.
834 /// \param e A data expression.
835 /// \pre right is defined for e.
836 /// \return The argument of e that corresponds to right.
837 inline
838 const data_expression& right(const data_expression& e)
839 {
841 return atermpp::down_cast<application>(e)[1];
842 }
843
844 ///\brief Function for projecting out argument.
845 /// arg from an application.
846 /// \param e A data expression.
847 /// \pre arg is defined for e.
848 /// \return The argument of e that corresponds to arg.
849 inline
850 const data_expression& arg(const data_expression& e)
851 {
853 return atermpp::down_cast<application>(e)[0];
854 }
855
856 /// \brief Give all system defined equations for list
857 /// \param s A sort expression
858 /// \return All system defined equations for sort list
859 inline
861 {
862 variable vd("d",s);
863 variable ve("e",s);
864 variable vs("s",list(s));
865 variable vt("t",list(s));
868
869 data_equation_vector result;
870 result.emplace_back(variable_list({vd, vs}), equal_to(empty(s), cons_(s, vd, vs)), sort_bool::false_());
871 result.emplace_back(variable_list({vd, vs}), equal_to(cons_(s, vd, vs), empty(s)), sort_bool::false_());
872 result.emplace_back(variable_list({vd, ve, vs, vt}), equal_to(cons_(s, vd, vs), cons_(s, ve, vt)), sort_bool::and_(equal_to(vd, ve), equal_to(vs, vt)));
873 result.emplace_back(variable_list({vd, vs}), less(empty(s), cons_(s, vd, vs)), sort_bool::true_());
874 result.emplace_back(variable_list({vd, vs}), less(cons_(s, vd, vs), empty(s)), sort_bool::false_());
875 result.emplace_back(variable_list({vd, ve, vs, vt}), less(cons_(s, vd, vs), cons_(s, ve, vt)), sort_bool::or_(sort_bool::and_(equal_to(vd, ve), less(vs, vt)), less(vd, ve)));
876 result.emplace_back(variable_list(), less_total(empty(s), empty(s)), sort_bool::false_());
877 result.emplace_back(variable_list({vd, vs}), less_total(empty(s), cons_(s, vd, vs)), sort_bool::true_());
878 result.emplace_back(variable_list({vd, vs}), less_total(cons_(s, vd, vs), empty(s)), sort_bool::false_());
879 result.emplace_back(variable_list({vd, ve, vs, vt}), less_total(cons_(s, vd, vs), cons_(s, ve, vt)), sort_bool::or_(sort_bool::and_(equal_to(vd, ve), less_total(vs, vt)), less_total(vd, ve)));
880 result.emplace_back(variable_list({vd, vs}), less_equal(empty(s), cons_(s, vd, vs)), sort_bool::true_());
881 result.emplace_back(variable_list({vd, vs}), less_equal(cons_(s, vd, vs), empty(s)), sort_bool::false_());
882 result.emplace_back(variable_list({vd, ve, vs, vt}), less_equal(cons_(s, vd, vs), cons_(s, ve, vt)), sort_bool::or_(sort_bool::and_(equal_to(vd, ve), less_equal(vs, vt)), less(vd, ve)));
883 result.emplace_back(variable_list({vd}), in(s, vd, empty(s)), sort_bool::false_());
884 result.emplace_back(variable_list({vd, ve, vs}), in(s, vd, cons_(s, ve, vs)), sort_bool::or_(equal_to(vd, ve), in(s, vd, vs)));
885 result.emplace_back(variable_list(), count(s, empty(s)), sort_nat::c0());
886 result.emplace_back(variable_list({vd, vs}), count(s, cons_(s, vd, vs)), sort_nat::succ_nat(count(s, vs)));
887 result.emplace_back(variable_list({vd}), snoc(s, empty(s), vd), cons_(s, vd, empty(s)));
888 result.emplace_back(variable_list({vd, ve, vs}), snoc(s, cons_(s, vd, vs), ve), cons_(s, vd, snoc(s, vs, ve)));
889 result.emplace_back(variable_list({vs}), concat(s, empty(s), vs), vs);
890 result.emplace_back(variable_list({vd, vs, vt}), concat(s, cons_(s, vd, vs), vt), cons_(s, vd, concat(s, vs, vt)));
891 result.emplace_back(variable_list({vs}), concat(s, vs, empty(s)), vs);
892 result.emplace_back(variable_list({vd, vn, vs}), element_at(s, cons_(s, vd, vs), vn), if_(equal_to(vn, sort_nat::most_significant_digit_nat(sort_machine_word::zero_word())), vd, element_at(s, vs, sort_nat::natpred(vn))));
893 result.emplace_back(variable_list({vd, vs}), head(s, cons_(s, vd, vs)), vd);
894 result.emplace_back(variable_list({vd, vs}), tail(s, cons_(s, vd, vs)), vs);
895 result.emplace_back(variable_list({vd}), rhead(s, cons_(s, vd, empty(s))), vd);
896 result.emplace_back(variable_list({vd, ve, vs}), rhead(s, cons_(s, vd, cons_(s, ve, vs))), rhead(s, cons_(s, ve, vs)));
897 result.emplace_back(variable_list({vd}), rtail(s, cons_(s, vd, empty(s))), empty(s));
898 result.emplace_back(variable_list({vd, ve, vs}), rtail(s, cons_(s, vd, cons_(s, ve, vs))), cons_(s, vd, rtail(s, cons_(s, ve, vs))));
899 return result;
900 }
901
902} // namespace mcrl2::data::sort_list
903
904#endif // MCRL2_DATA_LIST64_H
A unordered_map class in which aterms can be stored.
\brief A container sort
container_sort(const container_type &container_name, const sort_expression &element_sort)
\brief Constructor Z14.
const container_type & container_name() const
container_sort(const atermpp::aterm &term)
application operator()(const data_expression &e1, const data_expression &e2) const
Apply a data expression to two data expressions.
application operator()(const data_expression &e) const
Apply a data expression to a data expression.
\brief A function symbol
function_symbol(const core::identifier_string &name, const sort_expression &sort)
Constructor.
\brief Container type for lists
list_container()
\brief Default constructor X3.
\brief A sort expression
\brief A data variable
Definition variable.h:25
Namespace for system defined sort bool_.
Definition bool.h:29
const basic_sort & bool_()
Constructor for sort expression Bool.
Definition bool.h:41
Namespace for system defined sort list.
Definition list1.h:33
const core::identifier_string & rtail_name()
Generate identifier rtail.
Definition list1.h:698
const core::identifier_string & snoc_name()
Generate identifier <|.
Definition list1.h:320
bool is_rhead_function_symbol(const atermpp::aterm &e)
Recogniser for function rhead.
Definition list1.h:656
bool is_rhead_application(const atermpp::aterm &e)
Recogniser for application of rhead.
Definition list1.h:690
bool is_snoc_function_symbol(const atermpp::aterm &e)
Recogniser for function <|.
Definition list1.h:340
bool is_count_function_symbol(const atermpp::aterm &e)
Recogniser for function #.
Definition list1.h:278
function_symbol_vector list_mCRL2_usable_constructors(const sort_expression &s)
Give all defined constructors which can be used in mCRL2 specs for list.
Definition list1.h:171
const core::identifier_string & tail_name()
Generate identifier tail.
Definition list1.h:574
application head(const sort_expression &s, const data_expression &arg0)
Application of function symbol head.
Definition list1.h:546
bool is_tail_application(const atermpp::aterm &e)
Recogniser for application of tail.
Definition list1.h:628
bool is_element_at_function_symbol(const atermpp::aterm &e)
Recogniser for function ..
Definition list1.h:468
void make_snoc(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol <|.
Definition list1.h:366
bool is_in_function_symbol(const atermpp::aterm &e)
Recogniser for function in.
Definition list1.h:214
const core::identifier_string & rhead_name()
Generate identifier rhead.
Definition list1.h:636
function_symbol_vector list_generate_functions_code(const sort_expression &s)
Give all system defined mappings for list.
Definition list1.h:760
const core::identifier_string & in_name()
Generate identifier in.
Definition list1.h:194
function_symbol in(const sort_expression &s)
Constructor for function symbol in.
Definition list1.h:204
bool is_rtail_function_symbol(const atermpp::aterm &e)
Recogniser for function rtail.
Definition list1.h:718
bool is_concat_application(const atermpp::aterm &e)
Recogniser for application of ++.
Definition list1.h:440
const core::identifier_string & head_name()
Generate identifier head.
Definition list1.h:512
application concat(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol ++.
Definition list1.h:419
const core::identifier_string & cons_name()
Generate identifier |>.
Definition list1.h:95
const core::identifier_string & concat_name()
Generate identifier ++.
Definition list1.h:384
function_symbol rtail(const sort_expression &s)
Constructor for function symbol rtail.
Definition list1.h:708
const core::identifier_string & count_name()
Generate identifier #.
Definition list1.h:258
data_equation_vector list_generate_equations_code(const sort_expression &s)
Give all system defined equations for list.
Definition list1.h:860
void make_rhead(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol rhead.
Definition list1.h:680
bool is_tail_function_symbol(const atermpp::aterm &e)
Recogniser for function tail.
Definition list1.h:594
application rhead(const sort_expression &s, const data_expression &arg0)
Application of function symbol rhead.
Definition list1.h:670
function_symbol_vector list_mCRL2_usable_mappings(const sort_expression &s)
Give all system defined mappings that can be used in mCRL2 specs for list.
Definition list1.h:793
implementation_map list_cpp_implementable_constructors(const sort_expression &)
Give all system defined constructors which have an implementation in C++ and not in rewrite rules for...
Definition list1.h:185
bool is_in_application(const atermpp::aterm &e)
Recogniser for application of in.
Definition list1.h:250
function_symbol_vector list_generate_constructors_and_functions_code(const sort_expression &s)
Give all system defined mappings and constructors for list.
Definition list1.h:779
application rtail(const sort_expression &s, const data_expression &arg0)
Application of function symbol rtail.
Definition list1.h:732
bool is_rtail_application(const atermpp::aterm &e)
Recogniser for application of rtail.
Definition list1.h:752
function_symbol empty(const sort_expression &s)
Constructor for function symbol [].
Definition list1.h:73
application tail(const sort_expression &s, const data_expression &arg0)
Application of function symbol tail.
Definition list1.h:608
function_symbol element_at(const sort_expression &s)
Constructor for function symbol ..
Definition list1.h:458
const core::identifier_string & empty_name()
Generate identifier [].
Definition list1.h:63
function_symbol_vector list_generate_constructors_code(const sort_expression &s)
Give all system defined constructors for list.
Definition list1.h:159
void make_concat(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol ++.
Definition list1.h:430
application cons_(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol |>.
Definition list1.h:130
void make_in(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol in.
Definition list1.h:240
const core::identifier_string & element_at_name()
Generate identifier ..
Definition list1.h:448
function_symbol head(const sort_expression &s)
Constructor for function symbol head.
Definition list1.h:522
bool is_cons_application(const atermpp::aterm &e)
Recogniser for application of |>.
Definition list1.h:151
bool is_snoc_application(const atermpp::aterm &e)
Recogniser for application of <|.
Definition list1.h:376
container_sort list(const sort_expression &s)
Constructor for sort expression List(S)
Definition list1.h:39
function_symbol snoc(const sort_expression &s)
Constructor for function symbol <|.
Definition list1.h:330
function_symbol count(const sort_expression &s)
Constructor for function symbol #.
Definition list1.h:268
bool is_element_at_application(const atermpp::aterm &e)
Recogniser for application of ..
Definition list1.h:504
const data_expression & left(const data_expression &e)
Function for projecting out argument. left from an application.
Definition list1.h:826
implementation_map list_cpp_implementable_mappings(const sort_expression &)
Give all system defined mappings that are to be implemented in C++ code for list.
Definition list1.h:815
void make_head(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol head.
Definition list1.h:556
function_symbol rhead(const sort_expression &s)
Constructor for function symbol rhead.
Definition list1.h:646
void make_element_at(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol ..
Definition list1.h:494
bool is_count_application(const atermpp::aterm &e)
Recogniser for application of #.
Definition list1.h:312
void make_rtail(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol rtail.
Definition list1.h:742
bool is_head_application(const atermpp::aterm &e)
Recogniser for application of head.
Definition list1.h:566
void make_count(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol #.
Definition list1.h:302
function_symbol tail(const sort_expression &s)
Constructor for function symbol tail.
Definition list1.h:584
void make_tail(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol tail.
Definition list1.h:618
function_symbol cons_(const sort_expression &s)
Constructor for function symbol |>.
Definition list1.h:105
bool is_cons_function_symbol(const atermpp::aterm &e)
Recogniser for function |>.
Definition list1.h:115
bool is_concat_function_symbol(const atermpp::aterm &e)
Recogniser for function ++.
Definition list1.h:404
const data_expression & arg(const data_expression &e)
Function for projecting out argument. arg from an application.
Definition list1.h:850
const data_expression & right(const data_expression &e)
Function for projecting out argument. right from an application.
Definition list1.h:838
bool is_head_function_symbol(const atermpp::aterm &e)
Recogniser for function head.
Definition list1.h:532
void make_cons(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol |>.
Definition list1.h:141
bool is_empty_function_symbol(const atermpp::aterm &e)
Recogniser for function [].
Definition list1.h:83
function_symbol concat(const sort_expression &s)
Constructor for function symbol ++.
Definition list1.h:394
bool is_list(const sort_expression &e)
Recogniser for sort expression List(s)
Definition list1.h:50
application count(const sort_expression &s, const data_expression &arg0)
Application of function symbol #.
Definition list1.h:292
application element_at(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol ..
Definition list1.h:483
application in(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol in.
Definition list1.h:229
application snoc(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol <|.
Definition list1.h:355
Namespace for system defined sort nat.
const basic_sort & nat()
Constructor for sort expression Nat.
Definition nat1.h:43
Namespace for system defined sort pos.
const basic_sort & pos()
Constructor for sort expression Pos.
Definition pos1.h:42
function_sort make_function_sort_(const sort_expression &dom1, const sort_expression &codomain)
Convenience constructor for function sort with domain size 1.
bool is_container_sort(const atermpp::aterm &x)
Returns true if the term t is a container sort.
bool is_function_symbol(const atermpp::aterm &x)
Returns true if the term t is a function symbol.
function_sort make_function_sort_(const sort_expression &dom1, const sort_expression &dom2, const sort_expression &codomain)
Convenience constructor for function sort with domain size 2.