Skip to content

Commit ce83039

Browse files
committed
Replace std::cout for errors with messaget::error()
Also replace assert(false) with throw while I'm there.
1 parent a308fb5 commit ce83039

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/solvers/flattening/arrays.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ literalt arrayst::record_array_equality(
8484
// check types
8585
if(!base_type_eq(op0.type(), op1.type(), ns))
8686
{
87-
std::cout << equality.pretty() << std::endl;
87+
prop.error() << equality.pretty() << messaget::eom;
8888
throw "record_array_equality got equality without matching types";
8989
}
9090

@@ -174,7 +174,7 @@ void arrayst::collect_arrays(const exprt &a)
174174
// check types
175175
if(!base_type_eq(array_type, a.op0().type(), ns))
176176
{
177-
std::cout << a.pretty() << std::endl;
177+
prop.error() << a.pretty() << messaget::eom;
178178
throw "collect_arrays got 'with' without matching types";
179179
}
180180

@@ -196,7 +196,7 @@ void arrayst::collect_arrays(const exprt &a)
196196
// check types
197197
if(!base_type_eq(array_type, a.op0().type(), ns))
198198
{
199-
std::cout << a.pretty() << std::endl;
199+
prop.error() << a.pretty() << messaget::eom;
200200
throw "collect_arrays got 'update' without matching types";
201201
}
202202

@@ -220,14 +220,14 @@ void arrayst::collect_arrays(const exprt &a)
220220
// check types
221221
if(!base_type_eq(array_type, a.op1().type(), ns))
222222
{
223-
std::cout << a.pretty() << std::endl;
223+
prop.error() << a.pretty() << messaget::eom;
224224
throw "collect_arrays got if without matching types";
225225
}
226226

227227
// check types
228228
if(!base_type_eq(array_type, a.op2().type(), ns))
229229
{
230-
std::cout << a.pretty() << std::endl;
230+
prop.error() << a.pretty() << messaget::eom;
231231
throw "collect_arrays got if without matching types";
232232
}
233233

@@ -678,8 +678,8 @@ void arrayst::add_array_constraints_with(
678678

679679
if(index_expr.type()!=value.type())
680680
{
681-
std::cout << expr.pretty() << std::endl;
682-
assert(false);
681+
prop.error() << expr.pretty() << messaget::eom;
682+
throw "index_expr and value types should match";
683683
}
684684

685685
lazy_constraintt lazy(
@@ -774,8 +774,8 @@ void arrayst::add_array_constraints_update(
774774

775775
if(index_expr.type()!=value.type())
776776
{
777-
std::cout << expr.pretty() << std::endl;
778-
assert(false);
777+
prop.error() << expr.pretty() << messaget::eom;
778+
throw "index_expr and value types should match";
779779
}
780780

781781
set_to_true(equal_exprt(index_expr, value));

0 commit comments

Comments
 (0)