20
20
#include < util/ieee_float.h>
21
21
#include < util/base_type.h>
22
22
#include < util/string2int.h>
23
+ #include < util/invariant.h>
23
24
24
25
#include < ansi-c/string_constant.h>
25
26
34
35
35
36
// Mark different kinds of error condition
36
37
// General
37
- #define UNREACHABLE throw " Supposidly unreachable location reached"
38
38
#define PARSERERROR (S ) throw S
39
39
40
40
// Error checking the expression type
45
45
#define UNEXPECTEDCASE (S ) throw " Unexpected case: " S
46
46
47
47
// General todos
48
- #define TODO (S ) throw " TODO: " S
48
+ #define SMT2_TODO (S ) throw " TODO: " S
49
49
50
50
void smt2_convt::print_assignment (std::ostream &out) const
51
51
{
@@ -952,7 +952,7 @@ void smt2_convt::convert_expr(const exprt &expr)
952
952
out << " ))" ; // mk-, let
953
953
}
954
954
else
955
- TODO (" bitnot for vectors" );
955
+ SMT2_TODO (" bitnot for vectors" );
956
956
}
957
957
else
958
958
{
@@ -1017,7 +1017,7 @@ void smt2_convt::convert_expr(const exprt &expr)
1017
1017
out << " ))" ; // mk-, let
1018
1018
}
1019
1019
else
1020
- TODO (" unary minus for vector" );
1020
+ SMT2_TODO (" unary minus for vector" );
1021
1021
}
1022
1022
else
1023
1023
{
@@ -1363,7 +1363,7 @@ void smt2_convt::convert_expr(const exprt &expr)
1363
1363
assert (expr.operands ().size ()==1 );
1364
1364
1365
1365
out << " false" ; // TODO
1366
- TODO (" pointer_object_has_type not implemented" );
1366
+ SMT2_TODO (" pointer_object_has_type not implemented" );
1367
1367
}
1368
1368
else if (expr.id ()==ID_string_constant)
1369
1369
{
@@ -1432,7 +1432,7 @@ void smt2_convt::convert_expr(const exprt &expr)
1432
1432
convert_expr(tmp);
1433
1433
out << ")) bin1)"; // bvlshr, extract, =
1434
1434
#endif
1435
- TODO (" smt2: extractbits with non-constant index" );
1435
+ SMT2_TODO (" smt2: extractbits with non-constant index" );
1436
1436
}
1437
1437
}
1438
1438
else if (expr.id ()==ID_replication)
@@ -1944,7 +1944,7 @@ void smt2_convt::convert_typecast(const typecast_exprt &expr)
1944
1944
// This conversion is non-trivial as it requires creating a
1945
1945
// new bit-vector variable and then asserting that it converts
1946
1946
// to the required floating-point number.
1947
- TODO (" bit-wise floatbv to bv" );
1947
+ SMT2_TODO (" bit-wise floatbv to bv" );
1948
1948
}
1949
1949
else
1950
1950
{
@@ -2017,7 +2017,7 @@ void smt2_convt::convert_typecast(const typecast_exprt &expr)
2017
2017
out << " (_ bv" << i << " " << to_width << " )" ;
2018
2018
}
2019
2019
else
2020
- TODO (" can't convert non-constant integer to bitvector" );
2020
+ SMT2_TODO (" can't convert non-constant integer to bitvector" );
2021
2021
}
2022
2022
else if (src_type.id ()==ID_struct) // flatten a struct to a bit-vector
2023
2023
{
@@ -2207,7 +2207,7 @@ void smt2_convt::convert_typecast(const typecast_exprt &expr)
2207
2207
}
2208
2208
else if (dest_type.id ()==ID_range)
2209
2209
{
2210
- TODO (" range typecast" );
2210
+ SMT2_TODO (" range typecast" );
2211
2211
}
2212
2212
else if (dest_type.id ()==ID_floatbv)
2213
2213
{
@@ -3031,11 +3031,11 @@ void smt2_convt::convert_floatbv_plus(const ieee_float_op_exprt &expr)
3031
3031
}
3032
3032
else if (type.id ()==ID_complex)
3033
3033
{
3034
- TODO (" + for floatbv complex" );
3034
+ SMT2_TODO (" + for floatbv complex" );
3035
3035
}
3036
3036
else if (type.id ()==ID_vector)
3037
3037
{
3038
- TODO (" + for floatbv vector" );
3038
+ SMT2_TODO (" + for floatbv vector" );
3039
3039
}
3040
3040
else
3041
3041
UNEXPECTEDCASE (" unsupported type for +: " +type.id_string ());
@@ -3093,7 +3093,7 @@ void smt2_convt::convert_minus(const minus_exprt &expr)
3093
3093
}
3094
3094
else if (expr.type ().id ()==ID_pointer)
3095
3095
{
3096
- TODO (" pointer subtraction" );
3096
+ SMT2_TODO (" pointer subtraction" );
3097
3097
}
3098
3098
else if (expr.type ().id ()==ID_vector)
3099
3099
{
@@ -3527,7 +3527,7 @@ void smt2_convt::convert_with(const with_exprt &expr)
3527
3527
typecast_exprt index_tc (index , expr_type);
3528
3528
3529
3529
// TODO: SMT2-ify
3530
- TODO (" SMT2-ify" );
3530
+ SMT2_TODO (" SMT2-ify" );
3531
3531
out << " (bvor " ;
3532
3532
out << " (band " ;
3533
3533
@@ -3565,7 +3565,7 @@ void smt2_convt::convert_update(const exprt &expr)
3565
3565
{
3566
3566
assert (expr.operands ().size ()==3 );
3567
3567
3568
- TODO (" smt2_convt::convert_update to be implemented" );
3568
+ SMT2_TODO (" smt2_convt::convert_update to be implemented" );
3569
3569
}
3570
3570
3571
3571
void smt2_convt::convert_index (const index_exprt &expr)
@@ -3651,7 +3651,7 @@ void smt2_convt::convert_index(const index_exprt &expr)
3651
3651
mp_integer index_int;
3652
3652
if (to_integer (expr.index (), index_int))
3653
3653
{
3654
- TODO (" non-constant index on vectors" );
3654
+ SMT2_TODO (" non-constant index on vectors" );
3655
3655
}
3656
3656
else
3657
3657
{
@@ -3662,7 +3662,7 @@ void smt2_convt::convert_index(const index_exprt &expr)
3662
3662
}
3663
3663
else
3664
3664
{
3665
- TODO (" index on vectors" );
3665
+ SMT2_TODO (" index on vectors" );
3666
3666
}
3667
3667
}
3668
3668
else
0 commit comments