ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
std_expr.h
Go to the documentation of this file.
1#ifndef CPROVER_STD_EXPR_H
2#define CPROVER_STD_EXPR_H
3
4#include <cassert>
6#include <util/irep/expr.h>
8
9class transt : public exprt
10{
11public:
13 {
15 operands().resize(3);
16 }
17
19 {
20 return op0();
21 }
23 {
24 return op1();
25 }
27 {
28 return op2();
29 }
30
31 const exprt &invar() const
32 {
33 return op0();
34 }
35 const exprt &init() const
36 {
37 return op1();
38 }
39 const exprt &trans() const
40 {
41 return op2();
42 }
43};
44
45extern inline const transt &to_trans(const exprt &expr)
46{
47 assert(expr.id() == exprt::trans && expr.operands().size() == 3);
48 return static_cast<const transt &>(expr);
49}
50
51extern inline transt &to_trans(exprt &expr)
52{
53 assert(expr.id() == exprt::trans && expr.operands().size() == 3);
54 return static_cast<transt &>(expr);
55}
56
57class symbol_exprt : public exprt
58{
59public:
61 {
62 }
63
68
74
76 {
77 this->identifier(identifier);
78 }
79
80 const irep_idt &get_identifier() const
81 {
82 return get("identifier");
83 }
84};
85
86extern inline const symbol_exprt &to_symbol_expr(const exprt &expr)
87{
88 assert(expr.id() == exprt::symbol && !expr.has_operands());
89 return static_cast<const symbol_exprt &>(expr);
90}
91
92extern inline symbol_exprt &to_symbol_expr(exprt &expr)
93{
94 assert(expr.id() == exprt::symbol && !expr.has_operands());
95 return static_cast<symbol_exprt &>(expr);
96}
97
100class unary_exprt : public exprt
101{
102public:
103 inline unary_exprt()
104 {
105 operands().resize(1);
106 }
107
108 inline explicit unary_exprt(const irep_idt &id) : exprt(id)
109 {
110 operands().resize(1);
111 }
112
113 inline unary_exprt(const irep_idt &_id, const exprt &_op)
114 : exprt(_id, _op.type())
115 {
116 copy_to_operands(_op);
117 }
118
119 inline unary_exprt(const irep_idt &_id, const typet &_type)
120 : exprt(_id, _type)
121 {
122 operands().resize(1);
123 }
124
125 inline unary_exprt(const irep_idt &_id, const exprt &_op, const typet &_type)
126 : exprt(_id, _type)
127 {
128 copy_to_operands(_op);
129 }
130};
131
132class predicate_exprt : public exprt
133{
134public:
136 {
137 }
138
139 predicate_exprt(const irep_idt &_id) : exprt(_id, typet("bool"))
140 {
141 }
142
143 predicate_exprt(const irep_idt &_id, const exprt &_op)
144 : exprt(_id, typet("bool"))
145 {
146 copy_to_operands(_op);
147 }
148
149 predicate_exprt(const irep_idt &_id, const exprt &_op0, const exprt &_op1)
150 : exprt(_id, typet("bool"))
151 {
152 copy_to_operands(_op0, _op1);
153 }
154};
155
157{
158public:
160 {
161 operands().resize(2);
162 }
163
165 {
166 operands().resize(2);
167 }
168
170 const exprt &_lhs,
171 const irep_idt &_id,
172 const exprt &_rhs)
173 : predicate_exprt(_id, _lhs, _rhs)
174 {
175 }
176
177 inline exprt &lhs()
178 {
179 return op0();
180 }
181
182 inline const exprt &lhs() const
183 {
184 return op0();
185 }
186
187 inline exprt &rhs()
188 {
189 return op1();
190 }
191
192 inline const exprt &rhs() const
193 {
194 return op1();
195 }
196};
197
198class binary_exprt : public exprt
199{
200public:
202 {
203 operands().resize(2);
204 }
205
206 explicit binary_exprt(const irep_idt &id) : exprt(id)
207 {
208 operands().resize(2);
209 }
210
211 binary_exprt(const exprt &_lhs, const irep_idt &_id, const exprt &_rhs)
212 : exprt(_id)
213 {
214 copy_to_operands(_lhs, _rhs);
215 }
216
218 const exprt &_lhs,
219 const irep_idt &_id,
220 const exprt &_rhs,
221 const typet &_type)
222 : exprt(_id, _type)
223 {
224 copy_to_operands(_lhs, _rhs);
225 }
226};
227
229{
230public:
234
235 plus_exprt(const exprt &_lhs, const exprt &_rhs)
236 : binary_exprt(_lhs, exprt::plus, _rhs)
237 {
238 }
239};
240
242{
243public:
247
248 minus_exprt(const exprt &_lhs, const exprt &_rhs)
249 : binary_exprt(_lhs, exprt::minus, _rhs)
250 {
251 }
252};
253
255{
256public:
260
261 mult_exprt(const exprt &_lhs, const exprt &_rhs)
262 : binary_exprt(_lhs, exprt::mult, _rhs)
263 {
264 }
265};
266
268{
269public:
271 {
272 }
273
274 div_exprt(const exprt &_lhs, const exprt &_rhs)
275 : binary_exprt(_lhs, exprt::div, _rhs)
276 {
277 }
278};
279
281{
282public:
284 {
285 }
286
287 mod_exprt(const exprt &_lhs, const exprt &_rhs)
288 : binary_exprt(_lhs, exprt::mod, _rhs)
289 {
290 }
291};
292
294{
295public:
299
300 equality_exprt(const exprt &_lhs, const exprt &_rhs)
301 : binary_relation_exprt(_lhs, exprt::equality, _rhs)
302 {
303 }
304};
305
306extern inline const equality_exprt &to_equality_expr(const exprt &expr)
307{
308 assert(expr.id() == exprt::equality && expr.operands().size() == 2);
309 return static_cast<const equality_exprt &>(expr);
310}
311
313{
314 assert(expr.id() == exprt::equality && expr.operands().size() == 2);
315 return static_cast<equality_exprt &>(expr);
316}
317
318class index_exprt : public exprt
319{
320public:
322 {
323 operands().resize(2);
324 }
325
326 index_exprt(const typet &_type) : exprt(exprt::index, _type)
327 {
328 operands().resize(2);
329 }
330
331 inline index_exprt(const exprt &_array, const exprt &_index)
332 : exprt(exprt::index, _array.type().subtype())
333 {
334 copy_to_operands(_array, _index);
335 }
336
338 const exprt &_array,
339 const exprt &_index,
340 const typet &_type)
341 : exprt(exprt::index, _type)
342 {
343 copy_to_operands(_array, _index);
344 }
345
346 inline exprt &array()
347 {
348 return op0();
349 }
350
351 inline const exprt &array() const
352 {
353 return op0();
354 }
355
356 inline exprt &index()
357 {
358 return op1();
359 }
360
361 inline const exprt &index() const
362 {
363 return op1();
364 }
365
366 friend inline const index_exprt &to_index_expr(const exprt &expr)
367 {
368 assert(expr.id() == exprt::index && expr.operands().size() == 2);
369 return static_cast<const index_exprt &>(expr);
370 }
371
372 friend inline index_exprt &to_index_expr(exprt &expr)
373 {
374 assert(expr.id() == exprt::index && expr.operands().size() == 2);
375 return static_cast<index_exprt &>(expr);
376 }
377};
378
379const index_exprt &to_index_expr(const exprt &expr);
381
382inline const unary_exprt &to_unary_expr(const exprt &expr)
383{
384 const unary_exprt &ret = static_cast<const unary_exprt &>(expr);
385 assert(ret.operands().size() == 1);
386 return ret;
387}
388
389class array_of_exprt : public exprt
390{
391public:
393 {
394 }
395
396 explicit inline array_of_exprt(const exprt &_what, const typet &_type)
397 : exprt(exprt::arrayof, _type)
398 {
399 copy_to_operands(_what);
400 }
401
402 inline exprt &what()
403 {
404 return op0();
405 }
406
407 inline const exprt &what() const
408 {
409 return op0();
410 }
411
412 friend inline const array_of_exprt &to_array_of_expr(const exprt &expr)
413 {
414 assert(expr.id() == exprt::arrayof && expr.operands().size() == 1);
415 return static_cast<const array_of_exprt &>(expr);
416 }
417
419 {
420 assert(expr.id() == exprt::arrayof && expr.operands().size() == 1);
421 return static_cast<array_of_exprt &>(expr);
422 }
423};
424
425const array_of_exprt &to_array_of_expr(const exprt &expr);
427
430class union_exprt : public exprt
431{
432public:
434 {
435 }
436
437 explicit inline union_exprt(const typet &_type) : exprt(id_union, _type)
438 {
439 }
440
441 explicit inline union_exprt(
442 const irep_idt &_component_name,
443 const typet &_type)
444 : exprt(id_union, _type)
445 {
446 set_component_name(_component_name);
447 }
448
449 friend inline const union_exprt &to_union_expr(const exprt &expr)
450 {
451 assert(expr.id() == id_union && expr.operands().size() == 1);
452 return static_cast<const union_exprt &>(expr);
453 }
454
455 friend inline union_exprt &to_union_expr(exprt &expr)
456 {
457 assert(expr.id() == id_union && expr.operands().size() == 1);
458 return static_cast<union_exprt &>(expr);
459 }
460
462 {
463 return get(exprt::a_comp_name);
464 }
465
470
471 inline void set_component_number(unsigned component_number)
472 {
473 set(exprt::a_comp_name, component_number);
474 }
475};
476
487const union_exprt &to_union_expr(const exprt &expr);
492
495class struct_exprt : public exprt
496{
497public:
499 {
500 }
501
502 explicit inline struct_exprt(const typet &_type) : exprt(id_struct, _type)
503 {
504 }
505
506 friend inline const struct_exprt &to_struct_expr(const exprt &expr)
507 {
508 assert(expr.id() == id_struct);
509 return static_cast<const struct_exprt &>(expr);
510 }
511
512 friend inline struct_exprt &to_struct_expr(exprt &expr)
513 {
514 assert(expr.id() == id_struct);
515 return static_cast<struct_exprt &>(expr);
516 }
517};
518
529const struct_exprt &to_struct_expr(const exprt &expr);
534
536{
537public:
539 {
540 operands().resize(2);
541 op0().id("unknown");
542 op1().id("unknown");
543 }
544
545 inline exprt &object()
546 {
547 return op0();
548 }
549
550 inline const exprt &object() const
551 {
552 return op0();
553 }
554
555 const exprt &root_object() const
556 {
557 const exprt *p = &object();
558
559 while (p->id() == exprt::member || p->id() == exprt::index)
560 {
561 assert(p->operands().size() != 0);
562 p = &p->op0();
563 }
564
565 return *p;
566 }
567
568 inline exprt &offset()
569 {
570 return op1();
571 }
572
573 inline const exprt &offset() const
574 {
575 return op1();
576 }
577
578 friend inline const object_descriptor_exprt &
580 {
581 assert(expr.id() == exprt::objdesc && expr.operands().size() == 2);
582 return static_cast<const object_descriptor_exprt &>(expr);
583 }
584
586 {
587 assert(expr.id() == exprt::objdesc && expr.operands().size() == 2);
588 return static_cast<object_descriptor_exprt &>(expr);
589 }
590};
591
594
596{
597public:
599 {
600 operands().resize(2);
601 op0().id("unknown");
602 op1().id("unknown");
603 }
604
606 {
607 operands().resize(2);
608 op0().id("unknown");
609 op1().id("unknown");
610 }
611
612 inline exprt &instance()
613 {
614 return op0();
615 }
616
617 inline const exprt &instance() const
618 {
619 return op0();
620 }
621
622 inline exprt &valid()
623 {
624 return op1();
625 }
626
627 inline const exprt &valid() const
628 {
629 return op1();
630 }
631
632 friend inline const dynamic_object_exprt &
634 {
635 assert(expr.id() == exprt::dynobj && expr.operands().size() == 2);
636 return static_cast<const dynamic_object_exprt &>(expr);
637 }
638
640 {
641 assert(expr.id() == exprt::dynobj && expr.operands().size() == 2);
642 return static_cast<dynamic_object_exprt &>(expr);
643 }
644};
645
648
649class typecast_exprt : public exprt
650{
651public:
652 inline explicit typecast_exprt(const typet &_type)
653 : exprt(exprt::typecast, _type)
654 {
655 operands().resize(1);
656 }
657
658 inline typecast_exprt(const exprt &op, const typet &_type)
659 : exprt(exprt::typecast, _type)
660 {
662 }
663
664 inline exprt &op()
665 {
666 return op0();
667 }
668
669 inline const exprt &op() const
670 {
671 return op0();
672 }
673};
674
675extern inline const typecast_exprt &to_typecast_expr(const exprt &expr)
676{
677 assert(expr.id() == exprt::typecast && expr.operands().size() == 1);
678 return static_cast<const typecast_exprt &>(expr);
679}
680
682{
683 assert(expr.id() == exprt::typecast && expr.operands().size() == 1);
684 return static_cast<typecast_exprt &>(expr);
685}
686
687class and_exprt : public exprt
688{
689public:
691 {
692 }
693
694 and_exprt(const exprt &op0, const exprt &op1)
695 : exprt(exprt::i_and, typet("bool"))
696 {
698 }
699
701 {
702 if (op.empty())
703 make_true();
704 else if (op.size() == 1)
705 *this = static_cast<const and_exprt &>(op.front());
706 else
707 operands() = op;
708 }
709};
710
711class implies_exprt : public exprt
712{
713public:
715 {
716 operands().resize(2);
717 }
718
720 : exprt(exprt::implies, typet("bool"))
721 {
723 }
724};
725
726class or_exprt : public exprt
727{
728public:
730 {
731 }
732
733 or_exprt(const exprt &op0, const exprt &op1)
734 : exprt(exprt::i_or, typet("bool"))
735 {
737 }
738
739 or_exprt(const exprt &op0, const exprt &op1, const exprt &op2)
740 : exprt(exprt::i_or, typet("bool"))
741 {
743 }
744
746 {
747 if (op.empty())
748 make_false();
749 else if (op.size() == 1)
750 *this = static_cast<const or_exprt &>(op.front());
751 else
752 operands() = op;
753 }
754};
755
757{
758public:
759 explicit address_of_exprt(const exprt &op)
760 : exprt(exprt::addrof, typet("pointer"))
761 {
762 assert(!op.is_constant());
763 assert(op.id() != exprt::addrof);
764 type().subtype() = op.type();
766 }
767
768 explicit address_of_exprt() : exprt(exprt::addrof, typet("pointer"))
769 {
770 operands().resize(1);
771 }
772
774 {
775 return op0();
776 }
777
778 const exprt &object() const
779 {
780 return op0();
781 }
782};
783
784extern inline const address_of_exprt &to_address_of_expr(const exprt &expr)
785{
786 assert(expr.id() == exprt::addrof && expr.operands().size() == 1);
787 return static_cast<const address_of_exprt &>(expr);
788}
789
791{
792 assert(expr.id() == exprt::addrof && expr.operands().size() == 1);
793 return static_cast<address_of_exprt &>(expr);
794}
795
796class not_exprt : public exprt
797{
798public:
799 explicit not_exprt(const exprt &op) : exprt(exprt::i_not, typet("bool"))
800 {
802 }
803
805 {
806 operands().resize(1);
807 }
808};
809
811{
812public:
814 {
815 operands().resize(1);
816 }
817
818 explicit dereference_exprt(const exprt &op, const typet &tp)
819 : exprt(exprt::deref, tp.subtype())
820 {
821 // This constructor copies an exprt to op0.
822 // It uses typet's subtype.
824 }
825
827 {
828 operands().resize(1);
829 }
830};
831
832class if_exprt : public exprt
833{
834public:
835 if_exprt(const exprt &cond, const exprt &t, const exprt &f)
836 : exprt(exprt::i_if)
837 {
838 copy_to_operands(cond, t, f);
839 type() = t.type();
840 }
841
843 {
844 operands().resize(3);
845 }
846
848 {
849 return op0();
850 }
851
852 const exprt &cond() const
853 {
854 return op0();
855 }
856
858 {
859 return op1();
860 }
861
862 const exprt &true_case() const
863 {
864 return op1();
865 }
866
868 {
869 return op2();
870 }
871
872 const exprt &false_case() const
873 {
874 return op2();
875 }
876};
877
878extern inline const if_exprt &to_if_expr(const exprt &expr)
879{
880 assert(expr.id() == exprt::i_if && expr.operands().size() == 3);
881 return static_cast<const if_exprt &>(expr);
882}
883
884extern inline if_exprt &to_if_expr(exprt &expr)
885{
886 assert(expr.id() == exprt::i_if && expr.operands().size() == 3);
887 return static_cast<if_exprt &>(expr);
888}
889
890class with_exprt : public exprt
891{
892public:
893 with_exprt(const exprt &_old, const exprt &_where, const exprt &_new_value)
894 : exprt(exprt::with)
895 {
896 copy_to_operands(_old, _where, _new_value);
897 type() = _old.type();
898 }
899
901 {
902 operands().resize(3);
903 }
904
906 {
907 return op0();
908 }
909
910 const exprt &old() const
911 {
912 return op0();
913 }
914
916 {
917 return op1();
918 }
919
920 const exprt &where() const
921 {
922 return op1();
923 }
924
926 {
927 return op2();
928 }
929
930 const exprt &new_value() const
931 {
932 return op2();
933 }
934};
935
936extern inline const with_exprt &to_with_expr(const exprt &expr)
937{
938 assert(expr.id() == exprt::with && expr.operands().size() == 3);
939 return static_cast<const with_exprt &>(expr);
940}
941
942extern inline with_exprt &to_with_expr(exprt &expr)
943{
944 assert(expr.id() == exprt::with && expr.operands().size() == 3);
945 return static_cast<with_exprt &>(expr);
946}
947
948class member_exprt : public exprt
949{
950public:
951 explicit member_exprt(const exprt &op) : exprt(exprt::member)
952 {
954 }
955
957 {
958 operands().resize(1);
959 }
960
967
969 const exprt &op,
971 const typet &_type)
972 : exprt(exprt::member, _type)
973 {
976 }
977
978 inline member_exprt(const irep_idt &component_name, const typet &_type)
979 : exprt(exprt::member, _type)
980 {
982 }
983
985 {
986 operands().resize(1);
987 }
988
990 {
991 return get("component_name");
992 }
993
995 {
996 this->component_name(component_name);
997 }
998
999 inline const exprt &struct_op() const
1000 {
1001 return op0();
1002 }
1003
1005 {
1006 return op0();
1007 }
1008};
1009
1011{
1012public:
1014 {
1015 operands().resize(1);
1016 }
1017
1022
1023 inline member_ref_exprt(const irep_idt &component_name, const typet &_type)
1024 : exprt(exprt::member_ref, _type)
1025 {
1027 }
1028
1030 {
1031 operands().resize(1);
1032 }
1033
1035 {
1036 return get("component_name");
1037 }
1038
1040 {
1041 this->component_name(component_name);
1042 }
1043};
1044
1045inline const member_exprt &to_member_expr(const exprt &expr)
1046{
1047 assert(expr.id() == exprt::member);
1048 return static_cast<const member_exprt &>(expr);
1049}
1050
1052{
1053 assert(expr.id() == exprt::member);
1054 return static_cast<member_exprt &>(expr);
1055}
1056
1058{
1059 assert(expr.id() == exprt::member_ref);
1060 return static_cast<const member_ref_exprt &>(expr);
1061}
1062
1064{
1065 assert(expr.id() == exprt::member_ref);
1066 return static_cast<member_ref_exprt &>(expr);
1067}
1068
1069class type_exprt : public exprt
1070{
1071public:
1073 {
1074 }
1075
1077 {
1078 }
1079};
1080
1081class constant_exprt : public exprt
1082{
1083public:
1085 {
1086 }
1087
1088 inline explicit constant_exprt(const typet &type)
1090 {
1091 }
1092
1094 const irep_idt &_value,
1095 const irep_idt &_cformat,
1096 const typet &_type)
1097 : exprt(exprt::constant, _type)
1098 {
1099 set("#cformat", _cformat);
1100 set_value(_value);
1101 }
1102
1107 type)
1108 {
1109 }
1110
1111 inline const irep_idt &get_value() const
1112 {
1113 return get("value");
1114 }
1115
1116 inline void set_value(const irep_idt &value)
1117 {
1118 set("value", value);
1119 }
1120};
1121
1132inline const constant_exprt &to_constant_expr(const exprt &expr)
1133{
1134 assert(expr.id() == exprt::constant);
1135 return static_cast<const constant_exprt &>(expr);
1136}
1137
1142{
1143 assert(expr.id() == exprt::constant);
1144 return static_cast<constant_exprt &>(expr);
1145}
1146
1150{
1151public:
1153 {
1155 }
1156};
1157
1159{
1160public:
1162 {
1164 }
1165};
1166
1167class nil_exprt : public exprt
1168{
1169public:
1170 nil_exprt() : exprt(static_cast<const exprt &>(get_nil_irep()))
1171 {
1172 }
1173};
1174
1175#endif
unsigned bv_width(const typet &type)
Definition bitvector.cpp:4
Definition bigint.hh:58
Definition std_expr.h:757
const exprt & object() const
Definition std_expr.h:778
exprt & object()
Definition std_expr.h:773
address_of_exprt(const exprt &op)
Definition std_expr.h:759
address_of_exprt()
Definition std_expr.h:768
and_exprt(const exprt::operandst &op)
Definition std_expr.h:700
and_exprt()
Definition std_expr.h:690
and_exprt(const exprt &op0, const exprt &op1)
Definition std_expr.h:694
Definition std_expr.h:390
friend const array_of_exprt & to_array_of_expr(const exprt &expr)
Definition std_expr.h:412
friend array_of_exprt & to_array_of_expr(exprt &expr)
Definition std_expr.h:418
const exprt & what() const
Definition std_expr.h:407
array_of_exprt(const exprt &_what, const typet &_type)
Definition std_expr.h:396
array_of_exprt()
Definition std_expr.h:392
exprt & what()
Definition std_expr.h:402
binary_exprt(const exprt &_lhs, const irep_idt &_id, const exprt &_rhs)
Definition std_expr.h:211
binary_exprt()
Definition std_expr.h:201
binary_exprt(const irep_idt &id)
Definition std_expr.h:206
binary_exprt(const exprt &_lhs, const irep_idt &_id, const exprt &_rhs, const typet &_type)
Definition std_expr.h:217
const exprt & rhs() const
Definition std_expr.h:192
binary_relation_exprt()
Definition std_expr.h:159
const exprt & lhs() const
Definition std_expr.h:182
binary_relation_exprt(const exprt &_lhs, const irep_idt &_id, const exprt &_rhs)
Definition std_expr.h:169
binary_relation_exprt(const irep_idt &id)
Definition std_expr.h:164
exprt & lhs()
Definition std_expr.h:177
exprt & rhs()
Definition std_expr.h:187
Definition std_expr.h:1082
const irep_idt & get_value() const
Definition std_expr.h:1111
constant_exprt(const BigInt &value, const typet &type)
Definition std_expr.h:1103
constant_exprt(const irep_idt &_value, const irep_idt &_cformat, const typet &_type)
Definition std_expr.h:1093
void set_value(const irep_idt &value)
Definition std_expr.h:1116
constant_exprt()
Definition std_expr.h:1084
constant_exprt(const typet &type)
Definition std_expr.h:1088
dereference_exprt()
Definition std_expr.h:826
dereference_exprt(const exprt &op, const typet &tp)
Definition std_expr.h:818
dereference_exprt(const typet &type)
Definition std_expr.h:813
div_exprt()
Definition std_expr.h:270
div_exprt(const exprt &_lhs, const exprt &_rhs)
Definition std_expr.h:274
Definition std_expr.h:596
exprt & valid()
Definition std_expr.h:622
dynamic_object_exprt(const typet &type)
Definition std_expr.h:605
const exprt & instance() const
Definition std_expr.h:617
friend dynamic_object_exprt & to_dynamic_object_expr(exprt &expr)
Definition std_expr.h:639
dynamic_object_exprt()
Definition std_expr.h:598
friend const dynamic_object_exprt & to_dynamic_object_expr(const exprt &expr)
Definition std_expr.h:633
const exprt & valid() const
Definition std_expr.h:627
exprt & instance()
Definition std_expr.h:612
Definition std_expr.h:294
equality_exprt()
Definition std_expr.h:296
equality_exprt(const exprt &_lhs, const exprt &_rhs)
Definition std_expr.h:300
Definition expr.h:34
static irep_idt symbol
Definition expr.h:218
std::vector< exprt > operandst
Definition expr.h:39
static irep_idt implies
Definition expr.h:231
void make_false()
Definition expr.cpp:132
static irep_idt i_true
Definition expr.h:247
static irep_idt with
Definition expr.h:239
static irep_idt i_if
Definition expr.h:238
bool has_operands() const
Definition expr.h:52
static irep_idt equality
Definition expr.h:224
static irep_idt i_not
Definition expr.h:235
static irep_idt i_and
Definition expr.h:232
static irep_idt objdesc
Definition expr.h:228
static irep_idt addrof
Definition expr.h:236
static irep_idt arrayof
Definition expr.h:227
static irep_idt member_ref
Definition expr.h:241
void copy_to_operands(const exprt &expr)
Definition expr.cpp:41
static irep_idt mod
Definition expr.h:223
void make_true()
Definition expr.cpp:126
static irep_idt mult
Definition expr.h:221
static irep_idt minus
Definition expr.h:220
static irep_idt plus
Definition expr.h:219
static irep_idt constant
Definition expr.h:246
static irep_idt deref
Definition expr.h:237
exprt & op0()
Definition expr.h:77
exprt & op1()
Definition expr.h:82
bool is_constant() const
Definition expr.cpp:105
static irep_idt typecast
Definition expr.h:230
operandst & operands()
Definition expr.h:57
exprt()=default
static irep_idt trans
Definition expr.h:217
exprt & op2()
Definition expr.h:93
static irep_idt dynobj
Definition expr.h:229
static irep_idt i_false
Definition expr.h:248
static irep_idt i_or
Definition expr.h:234
static irep_idt index
Definition expr.h:226
static irep_idt i_type
Definition expr.h:245
static irep_idt div
Definition expr.h:222
const irep_idt & value() const
Definition expr.h:67
static irep_idt member
Definition expr.h:240
false_exprt()
Definition std_expr.h:1161
Definition std_expr.h:833
const exprt & false_case() const
Definition std_expr.h:872
exprt & cond()
Definition std_expr.h:847
const exprt & cond() const
Definition std_expr.h:852
const exprt & true_case() const
Definition std_expr.h:862
exprt & false_case()
Definition std_expr.h:867
if_exprt()
Definition std_expr.h:842
exprt & true_case()
Definition std_expr.h:857
if_exprt(const exprt &cond, const exprt &t, const exprt &f)
Definition std_expr.h:835
implies_exprt(const exprt &op0, const exprt &op1)
Definition std_expr.h:719
implies_exprt()
Definition std_expr.h:714
Definition std_expr.h:319
friend const index_exprt & to_index_expr(const exprt &expr)
Definition std_expr.h:366
exprt & index()
Definition std_expr.h:356
friend index_exprt & to_index_expr(exprt &expr)
Definition std_expr.h:372
exprt & array()
Definition std_expr.h:346
index_exprt(const exprt &_array, const exprt &_index)
Definition std_expr.h:331
index_exprt()
Definition std_expr.h:321
const exprt & index() const
Definition std_expr.h:361
index_exprt(const typet &_type)
Definition std_expr.h:326
const exprt & array() const
Definition std_expr.h:351
index_exprt(const exprt &_array, const exprt &_index, const typet &_type)
Definition std_expr.h:337
Definition irep_idt.h:12
const irep_idt & identifier() const
Definition irep.h:167
const irep_idt & get(const irep_idt &name) const
Definition irep.cpp:127
void set(const irep_idt &name, const irep_idt &value)
Definition irep.h:141
static const irep_idt a_comp_name
Definition irep.h:1287
typet & type()
Definition irep.h:153
const irep_idt & component_name() const
Definition irep.h:187
const irep_idt & id() const
Definition irep.h:109
static const irep_idt id_union
Definition irep.h:1323
static const irep_idt id_struct
Definition irep.h:1323
Definition std_expr.h:949
exprt & struct_op()
Definition std_expr.h:1004
member_exprt(const exprt &op, const irep_idt &component_name)
Definition std_expr.h:961
const exprt & struct_op() const
Definition std_expr.h:999
irep_idt get_component_name() const
Definition std_expr.h:989
member_exprt()
Definition std_expr.h:984
void set_component_name(const irep_idt &component_name)
Definition std_expr.h:994
member_exprt(const exprt &op, const irep_idt &component_name, const typet &_type)
Definition std_expr.h:968
member_exprt(const exprt &op)
Definition std_expr.h:951
member_exprt(const irep_idt &component_name, const typet &_type)
Definition std_expr.h:978
member_exprt(const typet &type)
Definition std_expr.h:956
Definition std_expr.h:1011
member_ref_exprt(const irep_idt &component_name, const typet &_type)
Definition std_expr.h:1023
member_ref_exprt(const typet &type)
Definition std_expr.h:1013
member_ref_exprt()
Definition std_expr.h:1029
irep_idt get_component_name() const
Definition std_expr.h:1034
void set_component_name(const irep_idt &component_name)
Definition std_expr.h:1039
member_ref_exprt(const irep_idt &component_name)
Definition std_expr.h:1018
minus_exprt(const exprt &_lhs, const exprt &_rhs)
Definition std_expr.h:248
minus_exprt()
Definition std_expr.h:244
mod_exprt(const exprt &_lhs, const exprt &_rhs)
Definition std_expr.h:287
mod_exprt()
Definition std_expr.h:283
mult_exprt()
Definition std_expr.h:257
mult_exprt(const exprt &_lhs, const exprt &_rhs)
Definition std_expr.h:261
nil_exprt()
Definition std_expr.h:1170
not_exprt()
Definition std_expr.h:804
not_exprt(const exprt &op)
Definition std_expr.h:799
Definition std_expr.h:536
exprt & offset()
Definition std_expr.h:568
object_descriptor_exprt()
Definition std_expr.h:538
friend const object_descriptor_exprt & to_object_descriptor_expr(const exprt &expr)
Definition std_expr.h:579
const exprt & root_object() const
Definition std_expr.h:555
friend object_descriptor_exprt & to_object_descriptor_expr(exprt &expr)
Definition std_expr.h:585
const exprt & offset() const
Definition std_expr.h:573
const exprt & object() const
Definition std_expr.h:550
exprt & object()
Definition std_expr.h:545
or_exprt()
Definition std_expr.h:729
or_exprt(const exprt::operandst &op)
Definition std_expr.h:745
or_exprt(const exprt &op0, const exprt &op1)
Definition std_expr.h:733
or_exprt(const exprt &op0, const exprt &op1, const exprt &op2)
Definition std_expr.h:739
plus_exprt(const exprt &_lhs, const exprt &_rhs)
Definition std_expr.h:235
plus_exprt()
Definition std_expr.h:231
predicate_exprt(const irep_idt &_id)
Definition std_expr.h:139
predicate_exprt(const irep_idt &_id, const exprt &_op0, const exprt &_op1)
Definition std_expr.h:149
predicate_exprt(const irep_idt &_id, const exprt &_op)
Definition std_expr.h:143
predicate_exprt()
Definition std_expr.h:135
struct constructor from list of elements
Definition std_expr.h:496
struct_exprt(const typet &_type)
Definition std_expr.h:502
friend const struct_exprt & to_struct_expr(const exprt &expr)
Cast a generic exprt to a struct_exprt.
Definition std_expr.h:506
friend struct_exprt & to_struct_expr(exprt &expr)
Cast a generic exprt to a struct_exprt.
Definition std_expr.h:512
struct_exprt()
Definition std_expr.h:498
Definition std_expr.h:58
void set_identifier(const irep_idt &identifier)
Definition std_expr.h:75
symbol_exprt()
Definition std_expr.h:60
const irep_idt & get_identifier() const
Definition std_expr.h:80
symbol_exprt(const irep_idt &identifier)
Definition std_expr.h:64
symbol_exprt(const irep_idt &identifier, const typet &type)
Definition std_expr.h:69
Definition std_expr.h:10
const exprt & init() const
Definition std_expr.h:35
exprt & init()
Definition std_expr.h:22
exprt & invar()
Definition std_expr.h:18
const exprt & trans() const
Definition std_expr.h:39
exprt & trans()
Definition std_expr.h:26
transt()
Definition std_expr.h:12
const exprt & invar() const
Definition std_expr.h:31
true_exprt()
Definition std_expr.h:1152
type_exprt()
Definition std_expr.h:1072
type_exprt(const typet &type)
Definition std_expr.h:1076
Definition std_expr.h:650
exprt & op()
Definition std_expr.h:664
typecast_exprt(const exprt &op, const typet &_type)
Definition std_expr.h:658
const exprt & op() const
Definition std_expr.h:669
typecast_exprt(const typet &_type)
Definition std_expr.h:652
Definition type.h:9
const typet & subtype() const
Definition type.h:17
Generic base class for unary expressions.
Definition std_expr.h:101
unary_exprt(const irep_idt &id)
Definition std_expr.h:108
unary_exprt(const irep_idt &_id, const exprt &_op)
Definition std_expr.h:113
unary_exprt()
Definition std_expr.h:103
unary_exprt(const irep_idt &_id, const exprt &_op, const typet &_type)
Definition std_expr.h:125
unary_exprt(const irep_idt &_id, const typet &_type)
Definition std_expr.h:119
union constructor from single element
Definition std_expr.h:431
union_exprt(const irep_idt &_component_name, const typet &_type)
Definition std_expr.h:441
void set_component_number(unsigned component_number)
Definition std_expr.h:471
union_exprt(const typet &_type)
Definition std_expr.h:437
union_exprt()
Definition std_expr.h:433
void set_component_name(const irep_idt &component_name)
Definition std_expr.h:466
friend const union_exprt & to_union_expr(const exprt &expr)
Cast a generic exprt to a union_exprt.
Definition std_expr.h:449
friend union_exprt & to_union_expr(exprt &expr)
Cast a generic exprt to a union_exprt.
Definition std_expr.h:455
irep_idt get_component_name() const
Definition std_expr.h:461
Definition std_expr.h:891
with_exprt(const exprt &_old, const exprt &_where, const exprt &_new_value)
Definition std_expr.h:893
const exprt & old() const
Definition std_expr.h:910
const exprt & where() const
Definition std_expr.h:920
exprt & new_value()
Definition std_expr.h:925
with_exprt()
Definition std_expr.h:900
exprt & where()
Definition std_expr.h:915
const exprt & new_value() const
Definition std_expr.h:930
exprt & old()
Definition std_expr.h:905
const irept & get_nil_irep()
Definition irep.cpp:18
const std::string integer2binary(const BigInt &n, std::size_t width)
Definition mp_arith.cpp:49
const std::string integer2string(const BigInt &n, unsigned base)
Definition mp_arith.cpp:86
const equality_exprt & to_equality_expr(const exprt &expr)
Definition std_expr.h:306
const struct_exprt & to_struct_expr(const exprt &expr)
Cast a generic exprt to a struct_exprt.
Definition std_expr.h:506
const array_of_exprt & to_array_of_expr(const exprt &expr)
Definition std_expr.h:412
const index_exprt & to_index_expr(const exprt &expr)
Definition std_expr.h:366
const transt & to_trans(const exprt &expr)
Definition std_expr.h:45
const object_descriptor_exprt & to_object_descriptor_expr(const exprt &expr)
Definition std_expr.h:579
const typecast_exprt & to_typecast_expr(const exprt &expr)
Definition std_expr.h:675
const unary_exprt & to_unary_expr(const exprt &expr)
Definition std_expr.h:382
const if_exprt & to_if_expr(const exprt &expr)
Definition std_expr.h:878
const member_exprt & to_member_expr(const exprt &expr)
Definition std_expr.h:1045
const address_of_exprt & to_address_of_expr(const exprt &expr)
Definition std_expr.h:784
const union_exprt & to_union_expr(const exprt &expr)
Cast a generic exprt to a union_exprt.
Definition std_expr.h:449
const constant_exprt & to_constant_expr(const exprt &expr)
Cast a generic exprt to a constant_exprt.
Definition std_expr.h:1132
const symbol_exprt & to_symbol_expr(const exprt &expr)
Definition std_expr.h:86
const with_exprt & to_with_expr(const exprt &expr)
Definition std_expr.h:936
const dynamic_object_exprt & to_dynamic_object_expr(const exprt &expr)
Definition std_expr.h:633
const member_ref_exprt & to_member_ref_expr(const exprt &expr)
Definition std_expr.h:1057