mCRL2
Loading...
Searching...
No Matches
pres_expression.h
Go to the documentation of this file.
1// Author(s): Jan Friso Groote. Based on pbes_expression.h by Wieger Wesselink
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//
11
12#ifndef MCRL2_PRES_PRES_EXPRESSION_H
13#define MCRL2_PRES_PRES_EXPRESSION_H
14
20
21namespace mcrl2
22{
23
24
25namespace pres_system
26{
27
30
31//--- start generated classes ---//
34{
35 public:
38 : atermpp::aterm(core::detail::default_values::PRExpr)
39 {}
40
43 explicit pres_expression(const atermpp::aterm& term)
44 : atermpp::aterm(term)
45 {
47 }
48
51 : atermpp::aterm(x)
52 {}
53
56 : atermpp::aterm(x)
57 {}
58
61 : atermpp::aterm(x)
62 {}
63
65 pres_expression(const pres_expression&) noexcept = default;
66 pres_expression(pres_expression&&) noexcept = default;
67 pres_expression& operator=(const pres_expression&) noexcept = default;
68 pres_expression& operator=(pres_expression&&) noexcept = default;
69};
70
73
76
77// prototypes
79inline bool is_minus(const atermpp::aterm& x);
80inline bool is_and(const atermpp::aterm& x);
81inline bool is_or(const atermpp::aterm& x);
82inline bool is_imp(const atermpp::aterm& x);
83inline bool is_plus(const atermpp::aterm& x);
84inline bool is_const_multiply(const atermpp::aterm& x);
85inline bool is_const_multiply_alt(const atermpp::aterm& x);
86inline bool is_infimum(const atermpp::aterm& x);
87inline bool is_supremum(const atermpp::aterm& x);
88inline bool is_sum(const atermpp::aterm& x);
89inline bool is_eqinf(const atermpp::aterm& x);
90inline bool is_eqninf(const atermpp::aterm& x);
91inline bool is_condsm(const atermpp::aterm& x);
92inline bool is_condeq(const atermpp::aterm& x);
93
97inline
99{
100 return data::is_data_expression(x) ||
118}
119
120// prototype declaration
121std::string pp(const pres_expression& x);
122
127inline
128std::ostream& operator<<(std::ostream& out, const pres_expression& x)
129{
130 return out << pres_system::pp(x);
131}
132
135{
136 t1.swap(t2);
137}
138
139
142{
143 public:
144
145
151
152 const core::identifier_string& name() const
153 {
154 return atermpp::down_cast<core::identifier_string>((*this)[0]);
155 }
156
158 {
159 return atermpp::down_cast<data::data_expression_list>((*this)[1]);
160 }
161//--- start user section propositional_variable_instantiation ---//
164 : pres_expression(core::detail::default_values::PropVarInst)
165 {}
166
170 : pres_expression(term)
171 {
172 assert(core::detail::check_term_PropVarInst(*this));
173 }
174
177 {
178 atermpp::make_term_appl(*this,core::detail::function_symbol_PropVarInst(), name, parameters);
179 }
180
182 propositional_variable_instantiation(const std::string& name, const data::data_expression_list& parameters)
183 {
184 atermpp::make_term_appl(*this,core::detail::function_symbol_PropVarInst(), core::identifier_string(name), parameters);
185 }
186
187//--- end user section propositional_variable_instantiation ---//
188};
189
192template <class... ARGUMENTS>
193inline void make_propositional_variable_instantiation(atermpp::aterm& t, const ARGUMENTS&... args)
194{
196}
197
200
202typedef std::vector<propositional_variable_instantiation> propositional_variable_instantiation_vector;
203
207inline
209{
211}
212
213// prototype declaration
214std::string pp(const propositional_variable_instantiation& x);
215
220inline
221std::ostream& operator<<(std::ostream& out, const propositional_variable_instantiation& x)
222{
223 return out << pres_system::pp(x);
224}
225
228{
229 t1.swap(t2);
230}
231
232
235{
236 public:
239 : pres_expression(core::detail::default_values::PRESMinus)
240 {}
241
244 explicit minus(const atermpp::aterm& term)
245 : pres_expression(term)
246 {
247 assert(core::detail::check_term_PRESMinus(*this));
248 }
249
251 explicit minus(const pres_expression& operand)
252 : pres_expression(atermpp::aterm(core::detail::function_symbol_PRESMinus(), operand))
253 {}
254
256 minus(const minus&) noexcept = default;
257 minus(minus&&) noexcept = default;
258 minus& operator=(const minus&) noexcept = default;
259 minus& operator=(minus&&) noexcept = default;
260
261 const pres_expression& operand() const
262 {
263 return atermpp::down_cast<pres_expression>((*this)[0]);
264 }
265};
266
269template <class... ARGUMENTS>
270inline void make_minus(atermpp::aterm& t, const ARGUMENTS&... args)
271{
273}
274
278inline
280{
282}
283
284// prototype declaration
285std::string pp(const minus& x);
286
291inline
292std::ostream& operator<<(std::ostream& out, const minus& x)
293{
294 return out << pres_system::pp(x);
295}
296
298inline void swap(minus& t1, minus& t2)
299{
300 t1.swap(t2);
301}
302
303
306{
307 public:
310 : pres_expression(core::detail::default_values::PRESAnd)
311 {}
312
315 explicit and_(const atermpp::aterm& term)
316 : pres_expression(term)
317 {
318 assert(core::detail::check_term_PRESAnd(*this));
319 }
320
322 and_(const pres_expression& left, const pres_expression& right)
323 : pres_expression(atermpp::aterm(core::detail::function_symbol_PRESAnd(), left, right))
324 {}
325
327 and_(const and_&) noexcept = default;
328 and_(and_&&) noexcept = default;
329 and_& operator=(const and_&) noexcept = default;
330 and_& operator=(and_&&) noexcept = default;
331
332 const pres_expression& left() const
333 {
334 return atermpp::down_cast<pres_expression>((*this)[0]);
335 }
336
337 const pres_expression& right() const
338 {
339 return atermpp::down_cast<pres_expression>((*this)[1]);
340 }
341};
342
345template <class... ARGUMENTS>
346inline void make_and_(atermpp::aterm& t, const ARGUMENTS&... args)
347{
349}
350
354inline
355bool is_and(const atermpp::aterm& x)
356{
358}
359
360// prototype declaration
361std::string pp(const and_& x);
362
367inline
368std::ostream& operator<<(std::ostream& out, const and_& x)
369{
370 return out << pres_system::pp(x);
371}
372
374inline void swap(and_& t1, and_& t2)
375{
376 t1.swap(t2);
377}
378
379
381class or_: public pres_expression
382{
383 public:
386 : pres_expression(core::detail::default_values::PRESOr)
387 {}
388
391 explicit or_(const atermpp::aterm& term)
392 : pres_expression(term)
393 {
394 assert(core::detail::check_term_PRESOr(*this));
395 }
396
398 or_(const pres_expression& left, const pres_expression& right)
399 : pres_expression(atermpp::aterm(core::detail::function_symbol_PRESOr(), left, right))
400 {}
401
403 or_(const or_&) noexcept = default;
404 or_(or_&&) noexcept = default;
405 or_& operator=(const or_&) noexcept = default;
406 or_& operator=(or_&&) noexcept = default;
407
408 const pres_expression& left() const
409 {
410 return atermpp::down_cast<pres_expression>((*this)[0]);
411 }
412
413 const pres_expression& right() const
414 {
415 return atermpp::down_cast<pres_expression>((*this)[1]);
416 }
417};
418
421template <class... ARGUMENTS>
422inline void make_or_(atermpp::aterm& t, const ARGUMENTS&... args)
423{
425}
426
430inline
431bool is_or(const atermpp::aterm& x)
432{
434}
435
436// prototype declaration
437std::string pp(const or_& x);
438
443inline
444std::ostream& operator<<(std::ostream& out, const or_& x)
445{
446 return out << pres_system::pp(x);
447}
448
450inline void swap(or_& t1, or_& t2)
451{
452 t1.swap(t2);
453}
454
455
457class imp: public pres_expression
458{
459 public:
462 : pres_expression(core::detail::default_values::PRESImp)
463 {}
464
467 explicit imp(const atermpp::aterm& term)
468 : pres_expression(term)
469 {
470 assert(core::detail::check_term_PRESImp(*this));
471 }
472
474 imp(const pres_expression& left, const pres_expression& right)
475 : pres_expression(atermpp::aterm(core::detail::function_symbol_PRESImp(), left, right))
476 {}
477
479 imp(const imp&) noexcept = default;
480 imp(imp&&) noexcept = default;
481 imp& operator=(const imp&) noexcept = default;
482 imp& operator=(imp&&) noexcept = default;
483
484 const pres_expression& left() const
485 {
486 return atermpp::down_cast<pres_expression>((*this)[0]);
487 }
488
489 const pres_expression& right() const
490 {
491 return atermpp::down_cast<pres_expression>((*this)[1]);
492 }
493};
494
497template <class... ARGUMENTS>
498inline void make_imp(atermpp::aterm& t, const ARGUMENTS&... args)
499{
501}
502
506inline
507bool is_imp(const atermpp::aterm& x)
508{
510}
511
512// prototype declaration
513std::string pp(const imp& x);
514
519inline
520std::ostream& operator<<(std::ostream& out, const imp& x)
521{
522 return out << pres_system::pp(x);
523}
524
526inline void swap(imp& t1, imp& t2)
527{
528 t1.swap(t2);
529}
530
531
534{
535 public:
538 : pres_expression(core::detail::default_values::PRESPlus)
539 {}
540
543 explicit plus(const atermpp::aterm& term)
544 : pres_expression(term)
545 {
546 assert(core::detail::check_term_PRESPlus(*this));
547 }
548
550 plus(const pres_expression& left, const pres_expression& right)
551 : pres_expression(atermpp::aterm(core::detail::function_symbol_PRESPlus(), left, right))
552 {}
553
555 plus(const plus&) noexcept = default;
556 plus(plus&&) noexcept = default;
557 plus& operator=(const plus&) noexcept = default;
558 plus& operator=(plus&&) noexcept = default;
559
560 const pres_expression& left() const
561 {
562 return atermpp::down_cast<pres_expression>((*this)[0]);
563 }
564
565 const pres_expression& right() const
566 {
567 return atermpp::down_cast<pres_expression>((*this)[1]);
568 }
569};
570
573template <class... ARGUMENTS>
574inline void make_plus(atermpp::aterm& t, const ARGUMENTS&... args)
575{
577}
578
582inline
584{
586}
587
588// prototype declaration
589std::string pp(const plus& x);
590
595inline
596std::ostream& operator<<(std::ostream& out, const plus& x)
597{
598 return out << pres_system::pp(x);
599}
600
602inline void swap(plus& t1, plus& t2)
603{
604 t1.swap(t2);
605}
606
607
610{
611 public:
614 : pres_expression(core::detail::default_values::PRESConstantMultiply)
615 {}
616
619 explicit const_multiply(const atermpp::aterm& term)
620 : pres_expression(term)
621 {
622 assert(core::detail::check_term_PRESConstantMultiply(*this));
623 }
624
627 : pres_expression(atermpp::aterm(core::detail::function_symbol_PRESConstantMultiply(), left, right))
628 {}
629
631 const_multiply(const const_multiply&) noexcept = default;
632 const_multiply(const_multiply&&) noexcept = default;
633 const_multiply& operator=(const const_multiply&) noexcept = default;
634 const_multiply& operator=(const_multiply&&) noexcept = default;
635
636 const data::data_expression& left() const
637 {
638 return atermpp::down_cast<data::data_expression>((*this)[0]);
639 }
640
641 const pres_expression& right() const
642 {
643 return atermpp::down_cast<pres_expression>((*this)[1]);
644 }
645};
646
649template <class... ARGUMENTS>
650inline void make_const_multiply(atermpp::aterm& t, const ARGUMENTS&... args)
651{
653}
654
658inline
660{
662}
663
664// prototype declaration
665std::string pp(const const_multiply& x);
666
671inline
672std::ostream& operator<<(std::ostream& out, const const_multiply& x)
673{
674 return out << pres_system::pp(x);
675}
676
678inline void swap(const_multiply& t1, const_multiply& t2)
679{
680 t1.swap(t2);
681}
682
683
686{
687 public:
690 : pres_expression(core::detail::default_values::PRESConstantMultiplyAlt)
691 {}
692
695 explicit const_multiply_alt(const atermpp::aterm& term)
696 : pres_expression(term)
697 {
698 assert(core::detail::check_term_PRESConstantMultiplyAlt(*this));
699 }
700
703 : pres_expression(atermpp::aterm(core::detail::function_symbol_PRESConstantMultiplyAlt(), left, right))
704 {}
705
707 const_multiply_alt(const const_multiply_alt&) noexcept = default;
709 const_multiply_alt& operator=(const const_multiply_alt&) noexcept = default;
710 const_multiply_alt& operator=(const_multiply_alt&&) noexcept = default;
711
712 const pres_expression& left() const
713 {
714 return atermpp::down_cast<pres_expression>((*this)[0]);
715 }
716
718 {
719 return atermpp::down_cast<data::data_expression>((*this)[1]);
720 }
721};
722
725template <class... ARGUMENTS>
726inline void make_const_multiply_alt(atermpp::aterm& t, const ARGUMENTS&... args)
727{
729}
730
734inline
736{
738}
739
740// prototype declaration
741std::string pp(const const_multiply_alt& x);
742
747inline
748std::ostream& operator<<(std::ostream& out, const const_multiply_alt& x)
749{
750 return out << pres_system::pp(x);
751}
752
755{
756 t1.swap(t2);
757}
758
759
762{
763 public:
766 : pres_expression(core::detail::default_values::PRESInfimum)
767 {}
768
771 explicit infimum(const atermpp::aterm& term)
772 : pres_expression(term)
773 {
774 assert(core::detail::check_term_PRESInfimum(*this));
775 }
776
778 infimum(const data::variable_list& variables, const pres_expression& body)
779 : pres_expression(atermpp::aterm(core::detail::function_symbol_PRESInfimum(), variables, body))
780 {}
781
783 infimum(const infimum&) noexcept = default;
784 infimum(infimum&&) noexcept = default;
785 infimum& operator=(const infimum&) noexcept = default;
786 infimum& operator=(infimum&&) noexcept = default;
787
788 const data::variable_list& variables() const
789 {
790 return atermpp::down_cast<data::variable_list>((*this)[0]);
791 }
792
793 const pres_expression& body() const
794 {
795 return atermpp::down_cast<pres_expression>((*this)[1]);
796 }
797};
798
801template <class... ARGUMENTS>
802inline void make_infimum(atermpp::aterm& t, const ARGUMENTS&... args)
803{
805}
806
810inline
812{
814}
815
816// prototype declaration
817std::string pp(const infimum& x);
818
823inline
824std::ostream& operator<<(std::ostream& out, const infimum& x)
825{
826 return out << pres_system::pp(x);
827}
828
830inline void swap(infimum& t1, infimum& t2)
831{
832 t1.swap(t2);
833}
834
835
838{
839 public:
842 : pres_expression(core::detail::default_values::PRESSupremum)
843 {}
844
847 explicit supremum(const atermpp::aterm& term)
848 : pres_expression(term)
849 {
850 assert(core::detail::check_term_PRESSupremum(*this));
851 }
852
854 supremum(const data::variable_list& variables, const pres_expression& body)
855 : pres_expression(atermpp::aterm(core::detail::function_symbol_PRESSupremum(), variables, body))
856 {}
857
859 supremum(const supremum&) noexcept = default;
860 supremum(supremum&&) noexcept = default;
861 supremum& operator=(const supremum&) noexcept = default;
862 supremum& operator=(supremum&&) noexcept = default;
863
864 const data::variable_list& variables() const
865 {
866 return atermpp::down_cast<data::variable_list>((*this)[0]);
867 }
868
869 const pres_expression& body() const
870 {
871 return atermpp::down_cast<pres_expression>((*this)[1]);
872 }
873};
874
877template <class... ARGUMENTS>
878inline void make_supremum(atermpp::aterm& t, const ARGUMENTS&... args)
879{
881}
882
886inline
888{
890}
891
892// prototype declaration
893std::string pp(const supremum& x);
894
899inline
900std::ostream& operator<<(std::ostream& out, const supremum& x)
901{
902 return out << pres_system::pp(x);
903}
904
906inline void swap(supremum& t1, supremum& t2)
907{
908 t1.swap(t2);
909}
910
911
913class sum: public pres_expression
914{
915 public:
918 : pres_expression(core::detail::default_values::PRESSum)
919 {}
920
923 explicit sum(const atermpp::aterm& term)
924 : pres_expression(term)
925 {
926 assert(core::detail::check_term_PRESSum(*this));
927 }
928
930 sum(const data::variable_list& variables, const pres_expression& body)
931 : pres_expression(atermpp::aterm(core::detail::function_symbol_PRESSum(), variables, body))
932 {}
933
935 sum(const sum&) noexcept = default;
936 sum(sum&&) noexcept = default;
937 sum& operator=(const sum&) noexcept = default;
938 sum& operator=(sum&&) noexcept = default;
939
940 const data::variable_list& variables() const
941 {
942 return atermpp::down_cast<data::variable_list>((*this)[0]);
943 }
944
945 const pres_expression& body() const
946 {
947 return atermpp::down_cast<pres_expression>((*this)[1]);
948 }
949};
950
953template <class... ARGUMENTS>
954inline void make_sum(atermpp::aterm& t, const ARGUMENTS&... args)
955{
957}
958
962inline
963bool is_sum(const atermpp::aterm& x)
964{
966}
967
968// prototype declaration
969std::string pp(const sum& x);
970
975inline
976std::ostream& operator<<(std::ostream& out, const sum& x)
977{
978 return out << pres_system::pp(x);
979}
980
982inline void swap(sum& t1, sum& t2)
983{
984 t1.swap(t2);
985}
986
987
990{
991 public:
994 : pres_expression(core::detail::default_values::PRESEqInf)
995 {}
996
999 explicit eqinf(const atermpp::aterm& term)
1000 : pres_expression(term)
1001 {
1002 assert(core::detail::check_term_PRESEqInf(*this));
1003 }
1004
1006 explicit eqinf(const pres_expression& operand)
1007 : pres_expression(atermpp::aterm(core::detail::function_symbol_PRESEqInf(), operand))
1008 {}
1009
1011 eqinf(const eqinf&) noexcept = default;
1012 eqinf(eqinf&&) noexcept = default;
1013 eqinf& operator=(const eqinf&) noexcept = default;
1014 eqinf& operator=(eqinf&&) noexcept = default;
1015
1016 const pres_expression& operand() const
1017 {
1018 return atermpp::down_cast<pres_expression>((*this)[0]);
1019 }
1020};
1021
1024template <class... ARGUMENTS>
1025inline void make_eqinf(atermpp::aterm& t, const ARGUMENTS&... args)
1026{
1028}
1029
1033inline
1035{
1037}
1038
1039// prototype declaration
1040std::string pp(const eqinf& x);
1041
1046inline
1047std::ostream& operator<<(std::ostream& out, const eqinf& x)
1048{
1049 return out << pres_system::pp(x);
1050}
1051
1053inline void swap(eqinf& t1, eqinf& t2)
1054{
1055 t1.swap(t2);
1056}
1057
1058
1061{
1062 public:
1065 : pres_expression(core::detail::default_values::PRESEqNInf)
1066 {}
1067
1070 explicit eqninf(const atermpp::aterm& term)
1071 : pres_expression(term)
1072 {
1073 assert(core::detail::check_term_PRESEqNInf(*this));
1074 }
1075
1077 explicit eqninf(const pres_expression& operand)
1078 : pres_expression(atermpp::aterm(core::detail::function_symbol_PRESEqNInf(), operand))
1079 {}
1080
1082 eqninf(const eqninf&) noexcept = default;
1083 eqninf(eqninf&&) noexcept = default;
1084 eqninf& operator=(const eqninf&) noexcept = default;
1085 eqninf& operator=(eqninf&&) noexcept = default;
1086
1087 const pres_expression& operand() const
1088 {
1089 return atermpp::down_cast<pres_expression>((*this)[0]);
1090 }
1091};
1092
1095template <class... ARGUMENTS>
1096inline void make_eqninf(atermpp::aterm& t, const ARGUMENTS&... args)
1097{
1099}
1100
1104inline
1106{
1108}
1109
1110// prototype declaration
1111std::string pp(const eqninf& x);
1112
1117inline
1118std::ostream& operator<<(std::ostream& out, const eqninf& x)
1119{
1120 return out << pres_system::pp(x);
1121}
1122
1124inline void swap(eqninf& t1, eqninf& t2)
1125{
1126 t1.swap(t2);
1127}
1128
1129
1132{
1133 public:
1136 : pres_expression(core::detail::default_values::PRESCondSm)
1137 {}
1138
1141 explicit condsm(const atermpp::aterm& term)
1142 : pres_expression(term)
1143 {
1144 assert(core::detail::check_term_PRESCondSm(*this));
1145 }
1146
1148 condsm(const pres_expression& arg1, const pres_expression& arg2, const pres_expression& arg3)
1149 : pres_expression(atermpp::aterm(core::detail::function_symbol_PRESCondSm(), arg1, arg2, arg3))
1150 {}
1151
1153 condsm(const condsm&) noexcept = default;
1154 condsm(condsm&&) noexcept = default;
1155 condsm& operator=(const condsm&) noexcept = default;
1156 condsm& operator=(condsm&&) noexcept = default;
1157
1158 const pres_expression& arg1() const
1159 {
1160 return atermpp::down_cast<pres_expression>((*this)[0]);
1161 }
1162
1163 const pres_expression& arg2() const
1164 {
1165 return atermpp::down_cast<pres_expression>((*this)[1]);
1166 }
1167
1168 const pres_expression& arg3() const
1169 {
1170 return atermpp::down_cast<pres_expression>((*this)[2]);
1171 }
1172};
1173
1176template <class... ARGUMENTS>
1177inline void make_condsm(atermpp::aterm& t, const ARGUMENTS&... args)
1178{
1180}
1181
1185inline
1187{
1189}
1190
1191// prototype declaration
1192std::string pp(const condsm& x);
1193
1198inline
1199std::ostream& operator<<(std::ostream& out, const condsm& x)
1200{
1201 return out << pres_system::pp(x);
1202}
1203
1205inline void swap(condsm& t1, condsm& t2)
1206{
1207 t1.swap(t2);
1208}
1209
1210
1213{
1214 public:
1217 : pres_expression(core::detail::default_values::PRESCondEq)
1218 {}
1219
1222 explicit condeq(const atermpp::aterm& term)
1223 : pres_expression(term)
1224 {
1225 assert(core::detail::check_term_PRESCondEq(*this));
1226 }
1227
1229 condeq(const pres_expression& arg1, const pres_expression& arg2, const pres_expression& arg3)
1230 : pres_expression(atermpp::aterm(core::detail::function_symbol_PRESCondEq(), arg1, arg2, arg3))
1231 {}
1232
1234 condeq(const condeq&) noexcept = default;
1235 condeq(condeq&&) noexcept = default;
1236 condeq& operator=(const condeq&) noexcept = default;
1237 condeq& operator=(condeq&&) noexcept = default;
1238
1239 const pres_expression& arg1() const
1240 {
1241 return atermpp::down_cast<pres_expression>((*this)[0]);
1242 }
1243
1244 const pres_expression& arg2() const
1245 {
1246 return atermpp::down_cast<pres_expression>((*this)[1]);
1247 }
1248
1249 const pres_expression& arg3() const
1250 {
1251 return atermpp::down_cast<pres_expression>((*this)[2]);
1252 }
1253};
1254
1257template <class... ARGUMENTS>
1258inline void make_condeq(atermpp::aterm& t, const ARGUMENTS&... args)
1259{
1261}
1262
1266inline
1268{
1270}
1271
1272// prototype declaration
1273std::string pp(const condeq& x);
1274
1279inline
1280std::ostream& operator<<(std::ostream& out, const condeq& x)
1281{
1282 return out << pres_system::pp(x);
1283}
1284
1286inline void swap(condeq& t1, condeq& t2)
1287{
1288 t1.swap(t2);
1289}
1290//--- end generated classes ---//
1291
1292// template function overloads
1293std::string pp(const pres_expression_list& x);
1294std::string pp(const pres_expression_vector& x);
1295std::string pp(const propositional_variable_instantiation_list& x);
1297std::set<pres_system::propositional_variable_instantiation> find_propositional_variable_instantiations(const pres_system::pres_expression& x);
1298std::set<core::identifier_string> find_identifiers(const pres_system::pres_expression& x);
1299std::set<data::variable> find_free_variables(const pres_system::pres_expression& x);
1303
1305inline
1307{
1308 /* The dynamic cast is required, to prevent copying the data term true to
1309 a local term on the stack. */
1310 return reinterpret_cast<const pres_expression&>(data::sort_bool::true_());
1311}
1312
1314inline
1316{
1317 /* The dynamic cast is required, to prevent copying the data term false to
1318 a local term on the stack. */
1319 return reinterpret_cast<const pres_expression&>(data::sort_bool::false_());
1320}
1321
1325inline bool is_true(const pres_expression& t)
1326{
1328}
1329
1333inline bool is_false(const pres_expression& t)
1334{
1336}
1337
1341inline bool is_pres_minus(const pres_expression& t)
1342{
1343 return pres_system::is_minus(t);
1344}
1345
1349inline bool is_pres_and(const pres_expression& t)
1350{
1351 return pres_system::is_and(t);
1352}
1353
1357inline bool is_pres_or(const pres_expression& t)
1358{
1359 return pres_system::is_or(t);
1360}
1361
1365inline bool is_pres_imp(const pres_expression& t)
1366{
1367 return pres_system::is_imp(t);
1368}
1369
1374{
1375 return pres_system::is_infimum(t);
1376}
1377
1382{
1383 return pres_system::is_supremum(t);
1384}
1385
1386/* /// \brief Test for a conjunction
1389inline bool is_universal_not(const pres_expression& t)
1390{
1391 return is_pres_not(t) || data::sort_bool::is_not_application(t);
1392} */
1393
1398{
1400}
1401
1406{
1408}
1409
1413inline bool is_data(const pres_expression& t)
1414{
1415 return data::is_data_expression(t);
1416}
1417
1419namespace accessors
1420{
1421
1425inline
1427{
1428 if (is_pres_minus(t))
1429 {
1430 return atermpp::down_cast<const pres_expression>(t[0]);
1431 }
1432 else
1433 {
1434 assert(is_infimum(t) || is_supremum(t) || is_sum(t));
1435 return atermpp::down_cast<const pres_expression>(t[1]);
1436 }
1437}
1438
1442inline
1444{
1445 if (data::is_data_expression(t))
1446 {
1447 assert(data::is_application(t));
1448 const auto& a = atermpp::down_cast<const data::application>(t);
1449 return *(a.begin());
1450 }
1451 else
1452 {
1453 return arg(t);
1454 }
1455}
1456
1460inline
1462{
1463 assert(is_and(t) || is_or(t) || is_imp(t));
1464 return atermpp::down_cast<pres_expression>(t[0]);
1465}
1466
1470inline
1472{
1473 if (data::is_data_expression(x))
1474 {
1475 return data::binary_left(atermpp::down_cast<data::application>(x));
1476 }
1477 else
1478 {
1479 return left(x);
1480 }
1481}
1482
1486inline
1487const pres_expression& right(const pres_expression& t)
1488{
1489 return atermpp::down_cast<pres_expression>(t[1]);
1490}
1491
1495inline
1497{
1498 if (data::is_data_expression(x))
1499 {
1500 return data::binary_right(atermpp::down_cast<data::application>(x));
1501 }
1502 else
1503 {
1504 return right(x);
1505 }
1506}
1507
1511inline
1513{
1514 assert(is_infimum(t) || is_supremum(t) || is_sum(t));
1515 return atermpp::down_cast<data::variable_list>(t[0]);
1516}
1517
1521inline
1523{
1524 assert(is_propositional_variable_instantiation(t));
1525 return atermpp::down_cast<core::identifier_string>(t[0]);
1526}
1527
1531inline
1533{
1534 assert(is_propositional_variable_instantiation(t));
1535 return atermpp::down_cast<data::data_expression_list>(t[1]);
1536}
1537} // namespace accessors
1538
1544inline
1546{
1547 if (l.empty())
1548 {
1549 return p;
1550 }
1552}
1553
1559inline
1561{
1562 if (l.empty())
1563 {
1564 return p;
1565 }
1567}
1568
1572inline
1574{
1575 // Should be optimized.
1576 // true false special cases.
1577 // data::sort_real::is_zero(p)
1578 make_minus(result, p);
1579}
1580
1585inline
1587{
1588 data::optimized_and(result, p, q);
1589}
1590
1595inline
1597{
1598 data::optimized_or(result, p, q);
1599}
1600
1605inline
1607{
1608 if (is_true(p))
1609 {
1610 result=p;
1611 }
1612 else if (is_true(q))
1613 {
1614 result=q;
1615 }
1616 else if (is_false(p))
1617 {
1619 {
1620 const data::data_expression& qa = atermpp::down_cast<data::data_expression>(q);
1621 if (qa.sort() == data::sort_real::real_())
1622 {
1623 result=p;
1624 return;
1625 }
1626 }
1627 make_plus(result, p, q);
1628 }
1629 else if (is_false(q))
1630 {
1632 {
1633 const data::data_expression& pa = atermpp::down_cast<data::data_expression>(p);
1634 if (pa.sort() == data::sort_real::real_())
1635 {
1636 result=q;
1637 return;
1638 }
1639 }
1640 make_plus(result, p, q);
1641 }
1642 else if (data::sort_real::is_zero(p))
1643 {
1644 result=q;
1645 }
1646 else if (data::sort_real::is_zero(q))
1647 {
1648 result=p;
1649 }
1650 else make_plus(result, p, q);
1651}
1652
1657/* inline
1658void optimized_imp(pres_expression& result, const pres_expression& p, const pres_expression& q)
1659{
1660 data::optimized_imp(result, p, q);
1661} */
1662
1668inline
1670{
1671 std::set<data::variable> free_variables = find_free_variables(p);
1672 data::variable_list new_l(l.begin(),
1673 l.end(),
1674 [](const data::variable& v){ return v; },
1675 [&free_variables](const data::variable& v){ return free_variables.find(v)!=free_variables.end(); });
1676 if (new_l.empty())
1677 {
1678 result=p;
1679 }
1680 else
1681 {
1682 make_infimum(result, new_l, p);
1683 }
1684}
1685
1691inline
1693{
1694 std::set<data::variable> free_variables = find_free_variables(p);
1695 data::variable_list new_l(l.begin(),
1696 l.end(),
1697 [](const data::variable& v){ return v; },
1698 [&free_variables](const data::variable& v){ return free_variables.find(v)!=free_variables.end(); });
1699 if (new_l.empty())
1700 {
1701 result=p;
1702 }
1703 else
1704 {
1705 make_supremum(result, new_l, p);
1706 }
1707}
1708
1716inline
1718 const data::variable_list& l,
1719 const pres_expression& p,
1720 const data::data_specification& data_specification,
1721 const data::rewriter& rewr)
1722{
1723 if (l.size()==0)
1724 {
1725 result=p;
1726 return;
1727 }
1728 std::set<data::variable> free_variables = find_free_variables(p);
1729 data::variable_list new_l;
1730 std::size_t factor=1;
1731 data::cardinality_calculator cardinality(data_specification, rewr);
1732 for(const data::variable& v: l)
1733 {
1734 if (free_variables.find(v)==free_variables.end()) // not found.
1735 {
1736 if (!is_true(p) && !is_false(p) && !data::sort_real::is_zero(p))
1737 {
1738 // Determine the cardinality.
1739 std::size_t c = cardinality(v.sort());
1740 if (c==0) // This means the cardinality is infinite or cannot be determined.
1741 {
1742 new_l.push_front(v);
1743 }
1744 else
1745 {
1746 factor=factor*c;
1747 }
1748 }
1749 }
1750 else
1751 {
1752 new_l.push_front(v);
1753 }
1754 }
1755 if (factor!=1)
1756 {
1757 if (is_const_multiply(p))
1758 {
1759 const const_multiply& cm=atermpp::down_cast<const_multiply>(p);
1761 }
1762 else if (is_false(p) || is_true(p))
1763 {
1764 result=p;
1765 }
1766 else if (data::is_data_expression(p))
1767 {
1768 const data::data_expression& d = atermpp::down_cast<data::data_expression>(p);
1769 if (d.sort()==data::sort_bool::bool_())
1770 {
1771 result = d;
1772 }
1773 else
1774 {
1775 assert(d.sort()==data::sort_real::real_());
1776 result=rewr(data::sort_real::times(d,data::sort_real::real_(factor)));
1777 }
1778 }
1779 else
1780 {
1782 }
1783 }
1784 else
1785 {
1786 result=p;
1787 }
1788 if (new_l.size()>0)
1789 {
1790 make_sum(result, new_l, result);
1791 }
1792 return;
1793}
1794
1800inline
1802{
1803 if (p1==false_())
1804 {
1805 result = p2;
1806 return;
1807 }
1808 else if (p1==true_())
1809 {
1810 optimized_or(result, p2, p3);
1811 return;
1812 }
1813 make_condsm(result, p1, p2, p3);
1814 return;
1815}
1816
1822inline
1824{
1825 if (p1==false_())
1826 {
1827 // N.B. Here we use the fact that mCRL2 data types are never empty.
1828 optimized_and(result, p2, p3);
1829 return;
1830 }
1831 else if (p1==true_())
1832 {
1833 result = p3;
1834 return;
1835 }
1836 make_condeq(result, p1, p2, p3);
1837 return;
1838}
1839
1843inline
1845{
1846 if (p==false_())
1847 {
1848 // N.B. Here we use the fact that mCRL2 data types are never empty.
1849 result = p;
1850 return;
1851 }
1852 else if (p==true_())
1853 {
1854 // N.B. Here we use the fact that mCRL2 data types are never empty.
1855 result = p;
1856 return;
1857 }
1858 else if (data::is_data_expression(p) && atermpp::down_cast<data::data_expression>(p).sort()==data::sort_real::real_())
1859 {
1860 result = false_();
1861 return;
1862 }
1863 make_eqinf(result, p);
1864}
1865
1869inline
1871{
1872 if (p==false_())
1873 {
1874 // N.B. Here we use the fact that mCRL2 data types are never empty.
1875 result = p;
1876 return;
1877 }
1878 else if (p==true_())
1879 {
1880 // N.B. Here we use the fact that mCRL2 data types are never empty.
1881 result = p;
1882 return;
1883 }
1884 else if (data::is_data_expression(p) && atermpp::down_cast<data::data_expression>(p).sort()==data::sort_real::real_())
1885 {
1886 result = true_();
1887 return;
1888 }
1889 make_eqninf(result, p);
1890}
1891
1896inline
1898{
1900 {
1901 result = d;
1902 return;
1903 }
1905 (p==false_() || p==true_() || is_eqinf(p) || is_eqninf(d)))
1906 {
1907 result = p;
1908 return;
1909 }
1910 make_const_multiply(result, d, p);
1911}
1912
1917inline
1919{
1921 {
1922 result = d;
1923 return;
1924 }
1926 (p==false_() || p==true_() || is_eqinf(p) || is_eqninf(d)))
1927 {
1928 result = p;
1929 return;
1930 }
1931 make_const_multiply_alt(result, d, p);
1932}
1933
1934inline
1936{
1937 return find_free_variables(x).empty();
1938}
1939
1940/* inline
1941const data::variable_list& quantifier_variables(const pres_expression& x)
1942{
1943 assert(is_exists(x) || is_forall(x));
1944 if (is_exists(x))
1945 {
1946 return atermpp::down_cast<exists>(x).variables();
1947 }
1948 else
1949 {
1950 return atermpp::down_cast<forall>(x).variables();
1951 }
1952} */
1953
1954inline
1956{
1957 std::set<data::variable> v = find_free_variables(x);
1958 return data::variable_list(v.begin(), v.end());
1959}
1960
1963template <class... ARGUMENTS>
1964inline void make_propositional_variable(atermpp::aterm& t, const ARGUMENTS&... args)
1965{
1967}
1968
1971
1973typedef std::vector<pbes_system::propositional_variable> propositional_variable_vector;
1974
1975} // namespace pres_system
1976
1977} // namespace mcrl2
1978
1979namespace mcrl2
1980{
1981
1982namespace core
1983{
1984
1986template <>
1987struct term_traits<pres_system::pres_expression>
1988{
1991
1994
1997
2000
2003
2006
2009
2012
2015 static inline
2017 {
2018 return pres_system::true_();
2019 }
2020
2023 static inline
2025 {
2026 return pres_system::false_();
2027 }
2028
2032 static inline
2034 {
2035 return pres_system::minus(p);
2036 }
2037
2041 static inline
2042 void make_minus(term_type& result, const term_type& p)
2043 {
2044 pres_system::make_minus(result, p);
2045 }
2046
2051 static inline
2052 term_type and_(const term_type& p, const term_type& q)
2053 {
2054 return pres_system::and_(p,q);
2055 }
2056
2061 static inline
2062 void make_and_(term_type& result, const term_type& p, const term_type& q)
2063 {
2064 pres_system::make_and_(result, p, q);
2065 }
2066
2071 static inline
2072 term_type or_(const term_type& p, const term_type& q)
2073 {
2074 return pres_system::or_(p,q);
2075 }
2076
2081 static inline
2082 void make_or_(term_type& result, const term_type& p, const term_type& q)
2083 {
2084 pres_system::make_or_(result, p,q);
2085 }
2086
2087 template <typename FwdIt>
2088 static inline
2089 term_type join_or(FwdIt first, FwdIt last)
2090 {
2091 return utilities::detail::join(first, last, or_, false_());
2092 }
2093
2094 template <typename FwdIt>
2095 static inline
2096 term_type join_and(FwdIt first, FwdIt last)
2097 {
2098 return utilities::detail::join(first, last, and_, true_());
2099 }
2100
2105 static inline
2106 term_type imp(const term_type& p, const term_type& q)
2107 {
2108 return pres_system::imp(p,q);
2109 }
2110
2115 static inline
2116 void make_imp(term_type& result, const term_type& p, const term_type& q)
2117 {
2118 pres_system::make_imp(result, p, q);
2119 }
2120
2125 static inline
2126 term_type plus(const term_type& p, const term_type& q)
2127 {
2128 return pres_system::plus(p,q);
2129 }
2130
2135 static inline
2136 void make_plus(term_type& result, const term_type& p, const term_type& q)
2137 {
2138 pres_system::make_plus(result, p, q);
2139 }
2140
2145 static inline
2146
2148 {
2149 return pres_system::const_multiply(p, q);
2150 }
2151
2156 static inline
2158 {
2160 }
2161
2166 static inline
2168 {
2170 }
2171
2176 static inline
2178 {
2180 }
2181
2186 static inline
2188 {
2189 if (l.empty())
2190 {
2191 return p;
2192 }
2193 return pres_system::infimum(l, p);
2194 }
2195
2200 static inline
2201 void make_infimum(term_type& result, const variable_sequence_type& l, const term_type& p)
2202 {
2203 if (l.empty())
2204 {
2205 result = p;
2206 return;
2207 }
2208 pres_system::make_infimum(result, l, p);
2209 }
2210
2215 static inline
2217 {
2218 if (l.empty())
2219 {
2220 return p;
2221 }
2222 return pres_system::supremum(l, p);
2223 }
2224
2229 static inline
2231 {
2232 if (l.empty())
2233 {
2234 result = p;
2235 return;
2236 }
2237 pres_system::make_supremum(result, l, p);
2238 }
2239
2244 static inline
2246 {
2247 if (l.empty())
2248 {
2249 return p;
2250 }
2251 return pres_system::sum(l, p);
2252 }
2253
2258 static inline
2259 void make_sum(term_type& result, const variable_sequence_type& l, const term_type& p)
2260 {
2261 if (l.empty())
2262 {
2263 result = p;
2264 return;
2265 }
2266 pres_system::make_sum(result, l, p);
2267 }
2268
2272 static inline
2273 bool is_true(const term_type& t)
2274 {
2276 }
2277
2281 static inline
2282 bool is_false(const term_type& t)
2283 {
2285 }
2286
2290 static inline
2291 bool is_minus(const term_type& t)
2292 {
2293 return pres_system::is_minus(t);
2294 }
2295
2299 static inline
2300 bool is_and(const term_type& t)
2301 {
2302 return pres_system::is_and(t);
2303 }
2304
2308 static inline
2309 bool is_or(const term_type& t)
2310 {
2311 return pres_system::is_or(t);
2312 }
2313
2317 static inline
2318 bool is_imp(const term_type& t)
2319 {
2320 return pres_system::is_imp(t);
2321 }
2322
2326 static inline
2327 bool is_infimum(const term_type& t)
2328 {
2329 return pres_system::is_infimum(t);
2330 }
2331
2335 static inline
2336 bool is_supremum(const term_type& t)
2337 {
2338 return pres_system::is_supremum(t);
2339 }
2340
2344 static inline
2345 bool is_data(const term_type& t)
2346 {
2347 return data::is_data_expression(t);
2348 }
2349
2353 static inline
2354 bool is_prop_var(const term_type& t)
2355 {
2357 }
2358
2362 static inline
2364 {
2366 }
2367
2371 static inline
2373 {
2375 }
2376
2379 static inline
2381 {
2382 assert(is_pres_minus(t));
2383 return atermpp::down_cast<term_type>(t[0]);
2384 }
2385
2389 static inline
2391 {
2392 // Forall and exists are not fully supported by the data library
2394 || (!is_infimum(data::abstraction(t)) && !is_supremum(data::abstraction(t)))));
2395 assert(is_supremum(t) || is_infimum(t));
2396
2397 return atermpp::down_cast<variable_sequence_type>(t[0]);
2398 }
2399
2403 static inline
2404 const string_type &name(const term_type& t)
2405 {
2406 assert(is_prop_var(t));
2407 return atermpp::down_cast<string_type>(t[0]);
2408 }
2409
2413 static inline
2415 {
2416 assert(is_prop_var(t));
2417 return atermpp::down_cast<data_term_sequence_type>(t[1]);
2418 }
2419
2423 static inline
2425 {
2426 return atermpp::down_cast<term_type>(v);
2427 }
2428
2432 static inline
2433 bool is_variable(const term_type& t)
2434 {
2435 return data::is_variable(t);
2436 }
2437
2441 static inline
2442 std::string pp(const term_type& t)
2443 {
2444 return pres_system::pp(t);
2445 }
2446};
2447
2448} // namespace core
2449
2450} // namespace mcrl2
2451
2452namespace std
2453{
2454
2455 template <>
2456 struct hash<mcrl2::pres_system::pres_expression>
2457 {
2459 {
2460 return hash<atermpp::aterm>()(x);
2461 }
2462 };
2463
2464 template <>
2465 struct hash<mcrl2::pres_system::propositional_variable_instantiation>
2466 {
2468 {
2469 return hash<atermpp::aterm>()(x);
2470 }
2471 };
2472
2473} // namespace std
2474
2475#endif // MCRL2_PRES_PRES_EXPRESSION_H
This file provides a class that can determine the cardinality of a sort in a datatype.
Term containing a string.
aterm()
Default constructor.
Definition aterm.h:48
const function_symbol & function() const
Returns the function symbol belonging to an aterm.
Definition aterm.h:144
A list of aterm objects.
Definition aterm_list.h:24
size_type size() const
Returns the size of the term_list.
Definition aterm_list.h:256
const_iterator end() const
Returns a const_iterator pointing to the end of the term_list.
Definition aterm_list.h:282
const_iterator begin() const
Returns a const_iterator pointing to the beginning of the term_list.
Definition aterm_list.h:275
bool empty() const
Returns true if the list's size is 0.
Definition aterm_list.h:268
void push_front(const Term &el)
Inserts a new element at the beginning of the current list.
void swap(unprotected_aterm_core &t) noexcept
Swaps this term with its argument.
Definition aterm_core.h:152
An abstraction expression.
Definition abstraction.h:26
sort_expression sort() const
Returns the sort of the data expression.
Definition data.cpp:108
Rewriter that operates on data expressions.
Definition rewriter.h:81
\brief A data variable
Definition variable.h:28
\brief A propositional variable declaration
\brief The and operator for pres expressions
and_(const pres_expression &left, const pres_expression &right)
\brief Constructor Z14.
and_()
\brief Default constructor X3.
const pres_expression & right() const
and_(const atermpp::aterm &term)
and_(and_ &&) noexcept=default
and_(const and_ &) noexcept=default
Move semantics.
\brief Conditional operator with condition smaller than or equal to 0
condeq(const condeq &) noexcept=default
Move semantics.
condeq(condeq &&) noexcept=default
condeq(const atermpp::aterm &term)
condeq()
\brief Default constructor X3.
const pres_expression & arg2() const
condeq(const pres_expression &arg1, const pres_expression &arg2, const pres_expression &arg3)
\brief Constructor Z14.
const pres_expression & arg3() const
\brief Conditional operator with condition smaller than 0
condsm()
\brief Default constructor X3.
condsm(const atermpp::aterm &term)
condsm(condsm &&) noexcept=default
const pres_expression & arg2() const
const pres_expression & arg3() const
condsm(const condsm &) noexcept=default
Move semantics.
condsm(const pres_expression &arg1, const pres_expression &arg2, const pres_expression &arg3)
\brief Constructor Z14.
\brief The multiplication with a positive constant with the constant at the right.
const_multiply_alt(const atermpp::aterm &term)
const_multiply_alt(const const_multiply_alt &) noexcept=default
Move semantics.
const_multiply_alt(const_multiply_alt &&) noexcept=default
const_multiply_alt(const pres_expression &left, const data::data_expression &right)
\brief Constructor Z14.
const data::data_expression & right() const
const_multiply_alt()
\brief Default constructor X3.
\brief The multiplication with a positive constant with the constant at the left.
const_multiply(const atermpp::aterm &term)
const_multiply(const const_multiply &) noexcept=default
Move semantics.
const_multiply()
\brief Default constructor X3.
const pres_expression & right() const
const_multiply(const_multiply &&) noexcept=default
const data::data_expression & left() const
const_multiply(const data::data_expression &left, const pres_expression &right)
\brief Constructor Z14.
\brief The indicator whether the argument is infinite
eqinf(const pres_expression &operand)
\brief Constructor Z14.
eqinf(const atermpp::aterm &term)
eqinf()
\brief Default constructor X3.
eqinf(eqinf &&) noexcept=default
eqinf(const eqinf &) noexcept=default
Move semantics.
\brief The indicator whether the argument is -infinite
eqninf(const pres_expression &operand)
\brief Constructor Z14.
eqninf(eqninf &&) noexcept=default
eqninf()
\brief Default constructor X3.
eqninf(const eqninf &) noexcept=default
Move semantics.
eqninf(const atermpp::aterm &term)
\brief The implication operator for pres expressions
imp(const pres_expression &left, const pres_expression &right)
\brief Constructor Z14.
imp()
\brief Default constructor X3.
imp(imp &&) noexcept=default
imp(const atermpp::aterm &term)
const pres_expression & right() const
imp(const imp &) noexcept=default
Move semantics.
\brief The infimum over a data type for pres expressions
infimum(infimum &&) noexcept=default
infimum(const atermpp::aterm &term)
const pres_expression & body() const
infimum(const data::variable_list &variables, const pres_expression &body)
\brief Constructor Z14.
infimum()
\brief Default constructor X3.
infimum(const infimum &) noexcept=default
Move semantics.
\brief The not operator for pres expressions
minus()
\brief Default constructor X3.
minus(minus &&) noexcept=default
minus(const atermpp::aterm &term)
minus(const pres_expression &operand)
\brief Constructor Z14.
minus(const minus &) noexcept=default
Move semantics.
\brief The or operator for pres expressions
or_(or_ &&) noexcept=default
const pres_expression & right() const
or_(const atermpp::aterm &term)
or_(const pres_expression &left, const pres_expression &right)
\brief Constructor Z14.
or_(const or_ &) noexcept=default
Move semantics.
or_()
\brief Default constructor X3.
\brief The addition operator for pres expressions
plus(plus &&) noexcept=default
plus(const pres_expression &left, const pres_expression &right)
\brief Constructor Z14.
plus(const plus &) noexcept=default
Move semantics.
plus()
\brief Default constructor X3.
const pres_expression & right() const
plus(const atermpp::aterm &term)
pres_expression(const data::untyped_data_parameter &x)
\brief Constructor Z6.
pres_expression(pres_expression &&) noexcept=default
pres_expression()
\brief Default constructor X3.
pres_expression(const data::data_expression &x)
\brief Constructor Z6.
pres_expression(const data::variable &x)
\brief Constructor Z6.
pres_expression(const pres_expression &) noexcept=default
Move semantics.
pres_expression(const atermpp::aterm &term)
\brief A propositional variable instantiation
propositional_variable_instantiation(const atermpp::aterm &term)
Constructor.
propositional_variable_instantiation(const std::string &name, const data::data_expression_list &parameters)
Constructor.
propositional_variable_instantiation(const propositional_variable_instantiation &) noexcept=default
Move semantics.
propositional_variable_instantiation(propositional_variable_instantiation &&) noexcept=default
propositional_variable_instantiation(const core::identifier_string &name, const data::data_expression_list &parameters)
Constructor.
const data::data_expression_list & parameters() const
\brief The generic sum operator for pres expressions
sum(const sum &) noexcept=default
Move semantics.
const pres_expression & body() const
sum(const atermpp::aterm &term)
sum()
\brief Default constructor X3.
sum(sum &&) noexcept=default
sum(const data::variable_list &variables, const pres_expression &body)
\brief Constructor Z14.
\brief The supremeum over a data type for pres expressions
supremum(const atermpp::aterm &term)
supremum(const supremum &) noexcept=default
Move semantics.
supremum()
\brief Default constructor X3.
supremum(supremum &&) noexcept=default
supremum(const data::variable_list &variables, const pres_expression &body)
\brief Constructor Z14.
const pres_expression & body() const
Contains term traits for data_expression.
The main namespace for the aterm++ library.
Definition algorithm.h:21
void make_term_appl(Term &target, const function_symbol &sym, ForwardIterator begin, ForwardIterator end)
Constructor an aterm in a variable based on a function symbol and an forward iterator providing the a...
Definition aterm.h:213
const atermpp::function_symbol & function_symbol_PRESAnd()
const atermpp::function_symbol & function_symbol_PRESImp()
const atermpp::function_symbol & function_symbol_PRESCondEq()
const atermpp::function_symbol & function_symbol_PRESPlus()
const atermpp::function_symbol & function_symbol_PRESSupremum()
const atermpp::function_symbol & function_symbol_PRESOr()
bool check_rule_PRExpr(const Term &t)
const atermpp::function_symbol & function_symbol_PRESSum()
const atermpp::function_symbol & function_symbol_PRESEqInf()
const atermpp::function_symbol & function_symbol_PRESEqNInf()
const atermpp::function_symbol & function_symbol_PRESConstantMultiply()
const atermpp::function_symbol & function_symbol_PRESCondSm()
const atermpp::function_symbol & function_symbol_PRESConstantMultiplyAlt()
const atermpp::function_symbol & function_symbol_PRESMinus()
const atermpp::function_symbol & function_symbol_PRESInfimum()
const atermpp::function_symbol & function_symbol_PropVarInst()
bool is_false_function_symbol(const atermpp::aterm &e)
Recogniser for function false.
Definition bool.h:119
bool is_or_application(const atermpp::aterm &e)
Recogniser for application of ||.
Definition bool.h:345
const basic_sort & bool_()
Constructor for sort expression Bool.
Definition bool.h:44
const function_symbol & false_()
Constructor for function symbol false.
Definition bool.h:109
bool is_and_application(const atermpp::aterm &e)
Recogniser for application of &&.
Definition bool.h:281
bool is_true_function_symbol(const atermpp::aterm &e)
Recogniser for function true.
Definition bool.h:87
const function_symbol & true_()
Constructor for function symbol true.
Definition bool.h:77
function_symbol times(const sort_expression &s0, const sort_expression &s1)
Definition real1.h:1237
bool is_zero(const atermpp::aterm &e)
const basic_sort & real_()
Constructor for sort expression Real.
Definition real1.h:48
bool is_larger_zero(const atermpp::aterm &e)
Functions that returns true if e is a closed real number larger than zero.
bool is_data_expression(const atermpp::aterm &x)
Test for a data_expression expression.
void optimized_or(Term &result, const Term &p, const Term &q)
Make a conjunction, and optimize if possible.
bool is_abstraction(const atermpp::aterm &x)
Returns true if the term t is an abstraction.
bool is_untyped_data_parameter(const atermpp::aterm &x)
atermpp::term_list< variable > variable_list
\brief list of variables
void optimized_and(Term &result, const Term &p, const Term &q)
Make a conjunction, and optimize if possible.
bool is_variable(const atermpp::aterm &x)
Returns true if the term t is a variable.
void make_propositional_variable(atermpp::aterm &t, const ARGUMENTS &... args)
const pres_expression & left(const pres_expression &t)
Returns the left hand side of an expression of type and, or or imp.
const pres_expression & right(const pres_expression &t)
Returns the right hand side of an expression of type and, or or imp.
void make_eqninf(atermpp::aterm &t, const ARGUMENTS &... args)
void translate_user_notation(pres_system::pres &x)
Definition pres.cpp:53
std::vector< pres_expression > pres_expression_vector
\brief vector of pres_expressions
bool is_pres_infimum(const pres_expression &t)
Returns true if the term t is a generalized minus expression.
const pres_expression & true_()
void make_sum(atermpp::aterm &t, const ARGUMENTS &... args)
void make_plus(atermpp::aterm &t, const ARGUMENTS &... args)
bool is_and(const atermpp::aterm &x)
bool is_condeq(const atermpp::aterm &x)
void find_free_variables(const T &x, OutputIterator o)
Definition find.h:87
std::vector< propositional_variable_instantiation > propositional_variable_instantiation_vector
\brief vector of propositional_variable_instantiations
bool is_pres_or(const pres_expression &t)
Returns true if the term t is an or expression.
void optimized_condsm(pres_expression &result, const pres_expression &p1, const pres_expression &p2, const pres_expression &p3)
Make an optimized condsm expression.
void optimized_const_multiply(pres_expression &result, const data::data_expression &d, const pres_expression &p)
Make an optimized const_multiply expression.
bool is_data(const pres_expression &t)
Returns true if the term t is a data expression.
bool is_sum(const atermpp::aterm &x)
bool is_pres_expression(const atermpp::aterm &x)
bool is_true(const pres_expression &t)
Test for the value true.
void make_minus(atermpp::aterm &t, const ARGUMENTS &... args)
bool is_or(const atermpp::aterm &x)
bool is_propositional_variable_instantiation(const atermpp::aterm &x)
void make_eqinf(atermpp::aterm &t, const ARGUMENTS &... args)
void make_const_multiply(atermpp::aterm &t, const ARGUMENTS &... args)
void optimized_sum(pres_expression &result, const data::variable_list &l, const pres_expression &p, const data::data_specification &data_specification, const data::rewriter &rewr)
Make an sum quantification. If l is empty, p is returned.
bool is_plus(const atermpp::aterm &x)
void find_propositional_variable_instantiations(Container const &container, OutputIterator o)
Returns all data variables that occur in a range of expressions.
Definition find.h:196
void make_const_multiply_alt(atermpp::aterm &t, const ARGUMENTS &... args)
bool is_infimum(const atermpp::aterm &x)
void make_condeq(atermpp::aterm &t, const ARGUMENTS &... args)
void optimized_infimum(pres_expression &result, const data::variable_list &l, const pres_expression &p)
Make an implication.
void optimized_and(pres_expression &result, const pres_expression &p, const pres_expression &q)
Make a conjunction.
bool is_minus(const atermpp::aterm &x)
bool is_pres_minus(const pres_expression &t)
Returns true if the term t is a minus expression.
bool is_const_multiply_alt(const atermpp::aterm &x)
void optimized_eqninf(pres_expression &result, const pres_expression &p)
Make an optimized eqinf expression.
bool is_eqninf(const atermpp::aterm &x)
bool is_supremum(const atermpp::aterm &x)
bool is_pres_imp(const pres_expression &t)
Returns true if the term t is an imp expression.
std::string pp(const pres &x)
Definition pres.cpp:45
bool is_const_multiply(const atermpp::aterm &x)
bool is_condsm(const atermpp::aterm &x)
void make_supremum(atermpp::aterm &t, const ARGUMENTS &... args)
atermpp::term_list< pres_expression > pres_expression_list
\brief list of pres_expressions
void swap(pres_equation &t1, pres_equation &t2)
\brief swap overload
atermpp::term_list< pbes_system::propositional_variable > propositional_variable_list
\brief list of propositional_variables
void make_propositional_variable(atermpp::aterm &t, const ARGUMENTS &... args)
bool is_imp(const atermpp::aterm &x)
void make_condsm(atermpp::aterm &t, const ARGUMENTS &... args)
void optimized_condeq(pres_expression &result, const pres_expression &p1, const pres_expression &p2, const pres_expression &p3)
Make an optimized condsm expression.
void optimized_eqinf(pres_expression &result, const pres_expression &p)
Make an optimized eqinf expression.
void optimized_plus(pres_expression &result, const pres_expression &p, const pres_expression &q)
Make a disjunction.
data::variable_list free_variables(const pres_expression &x)
void normalize_sorts(T &x, const data::sort_specification &sortspec, typename std::enable_if< !std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
bool is_pres_and(const pres_expression &t)
Returns true if the term t is an and expression.
void optimized_or(pres_expression &result, const pres_expression &p, const pres_expression &q)
Make a disjunction.
bool is_universal_or(const pres_expression &t)
Test for a disjunction.
bool is_universal_and(const pres_expression &t)
Test for a conjunction.
void optimized_supremum(pres_expression &result, const data::variable_list &l, const pres_expression &p)
Make a supremum. If l is empty, p is returned.
void make_propositional_variable_instantiation(atermpp::aterm &t, const ARGUMENTS &... args)
void optimized_const_multiply_alt(pres_expression &result, const data::data_expression &d, const pres_expression &p)
Make an optimized const_multiply_alt expression.
pbes_system::propositional_variable propositional_variable
The propositional variable is taken from a pbes_system.
bool search_variable(const T &x, const data::variable &v)
Returns true if the term has a given variable as subterm.
Definition find.h:217
bool is_eqinf(const atermpp::aterm &x)
bool is_false(const pres_expression &t)
Test for the value false.
void make_imp(atermpp::aterm &t, const ARGUMENTS &... args)
void find_identifiers(const T &x, OutputIterator o)
Definition find.h:131
std::vector< pbes_system::propositional_variable > propositional_variable_vector
\brief vector of propositional_variables
void optimized_minus(pres_expression &result, const pres_expression &p)
Make a negation.
bool is_constant(const pres_expression &x)
void make_infimum(atermpp::aterm &t, const ARGUMENTS &... args)
const pres_expression & false_()
void make_and_(atermpp::aterm &t, const ARGUMENTS &... args)
atermpp::aterm_ostream & operator<<(atermpp::aterm_ostream &stream, const pres &pres)
Writes the pres to a stream.
Definition io.cpp:225
void make_or_(atermpp::aterm &t, const ARGUMENTS &... args)
atermpp::term_list< propositional_variable_instantiation > propositional_variable_instantiation_list
\brief list of propositional_variable_instantiations
bool is_pres_supremum(const pres_expression &t)
Returns true if the term t is a generalized maximum expression.
T join(FwdIt first, FwdIt last, BinaryOperation op, T empty_sequence_result)
Given a sequence [t1, t2, ..., tn] of elements of type T, returns op(t1, op(t2, .....
Definition join.h:55
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
STL namespace.
add your file description here.
The class propositional_variable.
Contains a number of auxiliary functions to recognize reals.
static const atermpp::function_symbol PRESCondEq
static const atermpp::function_symbol PRESImp
static const atermpp::function_symbol PRESEqInf
static const atermpp::function_symbol PRESMinus
static const atermpp::function_symbol PRESEqNInf
static const atermpp::function_symbol PRESCondSm
static const atermpp::function_symbol PRESOr
static const atermpp::function_symbol PropVarInst
static const atermpp::function_symbol PRESSupremum
static const atermpp::function_symbol PRESPlus
static const atermpp::function_symbol PRESInfimum
static const atermpp::function_symbol PRESConstantMultiply
static const atermpp::function_symbol PRESConstantMultiplyAlt
static const atermpp::function_symbol PRESSum
static const atermpp::function_symbol PRESAnd
static term_type join_and(FwdIt first, FwdIt last)
pres_system::propositional_variable propositional_variable_decl_type
The propositional variable declaration type.
static term_type infimum(const variable_sequence_type &l, const term_type &p)
Make a generalized minimum.
static void make_or_(term_type &result, const term_type &p, const term_type &q)
Make a disjunction.
static std::string pp(const term_type &t)
Pretty print function.
static bool is_prop_var(const term_type &t)
Test for propositional variable instantiation.
pres_system::propositional_variable_instantiation propositional_variable_type
The propositional variable instantiation type.
static bool is_variable(const term_type &t)
Test if a term is a variable.
static const term_type & variable2term(const variable_type &v)
Conversion from variable to term.
data::variable_list variable_sequence_type
The variable sequence type.
static term_type join_or(FwdIt first, FwdIt last)
static term_type const_multiply_alt(const term_type &p, const data::data_expression &q)
Make a const multiply alt.
static void make_sum(term_type &result, const variable_sequence_type &l, const term_type &p)
Make a generalized sum operator.
static bool is_and(const term_type &t)
Test for a conjunction.
static bool is_supremum(const term_type &t)
Test for a max quantification.
static void make_const_multiply(term_type &result, const data::data_expression &p, const term_type &q)
Make a const multiply.
static void make_imp(term_type &result, const term_type &p, const term_type &q)
Make an implication.
static const data_term_sequence_type & param(const term_type &t)
Returns the parameter list of a propositional variable instantiation.
static term_type imp(const term_type &p, const term_type &q)
Make an implication.
static term_type plus(const term_type &p, const term_type &q)
Make a plus.
static term_type left(const term_type &t)
Returns the left argument of a term of type and, or or imp.
static bool is_minus(const term_type &t)
Test for a minus.
static void make_and_(term_type &result, const term_type &p, const term_type &q)
Make a conjunction.
static bool is_data(const term_type &t)
Test for data term.
static term_type right(const term_type &t)
Returns the right argument of a term of type and, or or imp.
static const string_type & name(const term_type &t)
Returns the name of a propositional variable instantiation.
static void make_supremum(term_type &result, const variable_sequence_type &l, const term_type &p)
Make a generalized maximum.
static bool is_infimum(const term_type &t)
Test for an infimum.
static void make_plus(term_type &result, const term_type &p, const term_type &q)
Make a plus.
static void make_const_multiply_alt(term_type &result, const term_type &p, const data::data_expression &q)
Make a const multiply alt.
static const term_type & minus_arg(const term_type &t)
Returns the argument of a term of type not.
data::data_expression_list data_term_sequence_type
The data term sequence type.
static bool is_or(const term_type &t)
Test for a disjunction.
static const variable_sequence_type & var(const term_type &t)
Returns the quantifier variables of a quantifier expression.
static term_type minus(const term_type &p)
Make a negation.
static void make_minus(term_type &result, const term_type &p)
Make a negation.
static term_type const_multiply(const data::data_expression &p, const term_type &q)
Make a const_multiply.
core::identifier_string string_type
The string type.
pres_system::pres_expression term_type
The term type.
static bool is_true(const term_type &t)
Test for the value true.
static term_type and_(const term_type &p, const term_type &q)
Make a conjunction.
static term_type sum(const variable_sequence_type &l, const term_type &p)
Make a generalized sum operator.
static void make_infimum(term_type &result, const variable_sequence_type &l, const term_type &p)
Make a generalized maximum.
static term_type or_(const term_type &p, const term_type &q)
Make a disjunction.
static bool is_imp(const term_type &t)
Test for an implication.
static term_type supremum(const variable_sequence_type &l, const term_type &p)
Make a generalized maximum.
static bool is_false(const term_type &t)
Test for the value false.
data::data_expression data_term_type
The data term type.
Contains type information for terms.
Definition term_traits.h:24
std::size_t operator()(const mcrl2::pres_system::pres_expression &x) const
std::size_t operator()(const mcrl2::pres_system::propositional_variable_instantiation &x) const
#define hash(l, r, m)
Definition tree_set.cpp:23