@@ -151,7 +151,7 @@ class unary_exprt:public exprt
151
151
operands ().resize (1 );
152
152
}
153
153
154
- inline explicit unary_exprt (const irep_idt &id ):exprt(id )
154
+ inline explicit unary_exprt (const irep_idt &_id ):exprt(_id )
155
155
{
156
156
operands ().resize (1 );
157
157
}
@@ -164,6 +164,13 @@ class unary_exprt:public exprt
164
164
copy_to_operands (_op);
165
165
}
166
166
167
+ inline unary_exprt (
168
+ const irep_idt &_id,
169
+ const typet &_type):exprt(_id, _type)
170
+ {
171
+ operands ().resize (1 );
172
+ }
173
+
167
174
inline unary_exprt (
168
175
const irep_idt &_id,
169
176
const exprt &_op,
@@ -172,6 +179,16 @@ class unary_exprt:public exprt
172
179
{
173
180
copy_to_operands (_op);
174
181
}
182
+
183
+ inline const exprt &op () const
184
+ {
185
+ return op0 ();
186
+ }
187
+
188
+ inline exprt &op ()
189
+ {
190
+ return op0 ();
191
+ }
175
192
};
176
193
177
194
/* ! \brief absolute value
@@ -977,18 +994,16 @@ vector_exprt &to_vector_expr(exprt &expr);
977
994
978
995
/* ! \brief union constructor from single element
979
996
*/
980
- class union_exprt :public exprt
997
+ class union_exprt :public unary_exprt
981
998
{
982
999
public:
983
- inline union_exprt ():exprt (ID_union)
1000
+ inline union_exprt ():unary_exprt (ID_union)
984
1001
{
985
- operands ().resize (1 );
986
1002
}
987
1003
988
1004
explicit inline union_exprt (const typet &_type):
989
- exprt (ID_union, _type)
1005
+ unary_exprt (ID_union, _type)
990
1006
{
991
- operands ().resize (1 );
992
1007
}
993
1008
994
1009
friend inline const union_exprt &to_union_expr (const exprt &expr)
@@ -1022,16 +1037,6 @@ class union_exprt:public exprt
1022
1037
{
1023
1038
set (ID_component_number, component_number);
1024
1039
}
1025
-
1026
- inline const exprt &op () const
1027
- {
1028
- return op0 ();
1029
- }
1030
-
1031
- inline exprt &op ()
1032
- {
1033
- return op0 ();
1034
- }
1035
1040
};
1036
1041
1037
1042
/* ! \brief Cast a generic exprt to a \ref union_exprt
@@ -2561,6 +2566,71 @@ class ieee_float_equal_exprt:public binary_relation_exprt
2561
2566
}
2562
2567
};
2563
2568
2569
+ /* ! \brief Cast a generic exprt to an \ref ieee_float_equal_exprt
2570
+ *
2571
+ * This is an unchecked conversion. \a expr must be known to be \ref
2572
+ * ieee_float_equal_exprt.
2573
+ *
2574
+ * \param expr Source expression
2575
+ * \return Object of type \ref ieee_float_equal_exprt
2576
+ *
2577
+ * \ingroup gr_std_expr
2578
+ */
2579
+ extern inline const ieee_float_equal_exprt &to_ieee_float_equal_expr (const exprt &expr)
2580
+ {
2581
+ assert (expr.id ()==ID_ieee_float_equal && expr.operands ().size ()==2 );
2582
+ return static_cast <const ieee_float_equal_exprt &>(expr);
2583
+ }
2584
+
2585
+ /* ! \copydoc to_ieee_float_equal_expr(const exprt &)
2586
+ * \ingroup gr_std_expr
2587
+ */
2588
+ extern inline ieee_float_equal_exprt &to_ieee_float_equal_expr (exprt &expr)
2589
+ {
2590
+ assert (expr.id ()==ID_ieee_float_equal && expr.operands ().size ()==2 );
2591
+ return static_cast <ieee_float_equal_exprt &>(expr);
2592
+ }
2593
+
2594
+ /* ! \brief IEEE-floating-point disequality
2595
+ */
2596
+ class ieee_float_notequal_exprt :public binary_relation_exprt
2597
+ {
2598
+ public:
2599
+ inline ieee_float_notequal_exprt ():binary_relation_exprt(ID_ieee_float_notequal)
2600
+ {
2601
+ }
2602
+
2603
+ inline ieee_float_notequal_exprt (const exprt &_lhs, const exprt &_rhs):
2604
+ binary_relation_exprt(_lhs, ID_ieee_float_notequal, _rhs)
2605
+ {
2606
+ }
2607
+ };
2608
+
2609
+ /* ! \brief Cast a generic exprt to an \ref ieee_float_notequal_exprt
2610
+ *
2611
+ * This is an unchecked conversion. \a expr must be known to be \ref
2612
+ * ieee_float_notequal_exprt.
2613
+ *
2614
+ * \param expr Source expression
2615
+ * \return Object of type \ref ieee_float_notequal_exprt
2616
+ *
2617
+ * \ingroup gr_std_expr
2618
+ */
2619
+ extern inline const ieee_float_notequal_exprt &to_ieee_float_notequal_expr (const exprt &expr)
2620
+ {
2621
+ assert (expr.id ()==ID_ieee_float_notequal && expr.operands ().size ()==2 );
2622
+ return static_cast <const ieee_float_notequal_exprt &>(expr);
2623
+ }
2624
+
2625
+ /* ! \copydoc to_ieee_float_notequal_expr(const exprt &)
2626
+ * \ingroup gr_std_expr
2627
+ */
2628
+ extern inline ieee_float_notequal_exprt &to_ieee_float_notequal_expr (exprt &expr)
2629
+ {
2630
+ assert (expr.id ()==ID_ieee_float_notequal && expr.operands ().size ()==2 );
2631
+ return static_cast <ieee_float_notequal_exprt &>(expr);
2632
+ }
2633
+
2564
2634
/* ! \brief An expression denoting a type
2565
2635
*/
2566
2636
class type_exprt :public exprt
@@ -2808,6 +2878,112 @@ class infinity_exprt:public exprt
2808
2878
}
2809
2879
};
2810
2880
2881
+ /* ! \brief A let expression
2882
+ */
2883
+ class let_exprt :public exprt
2884
+ {
2885
+ public:
2886
+ inline let_exprt ():exprt(ID_let)
2887
+ {
2888
+ operands ().resize (3 );
2889
+ op0 ()=symbol_exprt ();
2890
+ }
2891
+
2892
+ symbol_exprt &symbol ()
2893
+ {
2894
+ return static_cast <symbol_exprt &>(op0 ());
2895
+ }
2896
+
2897
+ const symbol_exprt &symbol () const
2898
+ {
2899
+ return static_cast <const symbol_exprt &>(op0 ());
2900
+ }
2901
+
2902
+ exprt &value ()
2903
+ {
2904
+ return op1 ();
2905
+ }
2906
+
2907
+ const exprt &value () const
2908
+ {
2909
+ return op1 ();
2910
+ }
2911
+
2912
+ exprt &where ()
2913
+ {
2914
+ return op2 ();
2915
+ }
2916
+
2917
+ const exprt &where () const
2918
+ {
2919
+ return op2 ();
2920
+ }
2921
+ };
2922
+
2923
+ /* ! \brief A forall expression
2924
+ */
2925
+ class forall_exprt :public exprt
2926
+ {
2927
+ public:
2928
+ inline forall_exprt ():exprt(ID_forall)
2929
+ {
2930
+ operands ().resize (2 );
2931
+ op0 ()=symbol_exprt ();
2932
+ }
2933
+
2934
+ symbol_exprt &symbol ()
2935
+ {
2936
+ return static_cast <symbol_exprt &>(op0 ());
2937
+ }
2938
+
2939
+ const symbol_exprt &symbol () const
2940
+ {
2941
+ return static_cast <const symbol_exprt &>(op0 ());
2942
+ }
2943
+
2944
+ exprt &where ()
2945
+ {
2946
+ return op1 ();
2947
+ }
2948
+
2949
+ const exprt &where () const
2950
+ {
2951
+ return op1 ();
2952
+ }
2953
+ };
2954
+
2955
+ /* ! \brief An exists expression
2956
+ */
2957
+ class exists_exprt :public exprt
2958
+ {
2959
+ public:
2960
+ inline exists_exprt ():exprt(ID_exists)
2961
+ {
2962
+ operands ().resize (2 );
2963
+ op0 ()=symbol_exprt ();
2964
+ }
2965
+
2966
+ symbol_exprt &symbol ()
2967
+ {
2968
+ return static_cast <symbol_exprt &>(op0 ());
2969
+ }
2970
+
2971
+ const symbol_exprt &symbol () const
2972
+ {
2973
+ return static_cast <const symbol_exprt &>(op0 ());
2974
+ }
2975
+
2976
+ exprt &where ()
2977
+ {
2978
+ return op1 ();
2979
+ }
2980
+
2981
+ const exprt &where () const
2982
+ {
2983
+ return op1 ();
2984
+ }
2985
+ };
2986
+
2811
2987
/* ! \brief Expression providing an SSA-renamed symbol of expressions
2812
2988
*/
2813
2989
class ssa_exprt :public symbol_exprt
0 commit comments