Skip to content

Replace std::cout for errors with messaget::error() #1047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/solvers/flattening/arrays.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ literalt arrayst::record_array_equality(
// check types
if(!base_type_eq(op0.type(), op1.type(), ns))
{
std::cout << equality.pretty() << '\n';
prop.error() << equality.pretty() << messaget::eom;
throw "record_array_equality got equality without matching types";
}

Expand Down Expand Up @@ -115,7 +115,7 @@ void arrayst::collect_arrays(const exprt &a)
// check types
if(!base_type_eq(array_type, a.op0().type(), ns))
{
std::cout << a.pretty() << '\n';
prop.error() << a.pretty() << messaget::eom;
throw "collect_arrays got 'with' without matching types";
}

Expand All @@ -137,7 +137,7 @@ void arrayst::collect_arrays(const exprt &a)
// check types
if(!base_type_eq(array_type, a.op0().type(), ns))
{
std::cout << a.pretty() << '\n';
prop.error() << a.pretty() << messaget::eom;
throw "collect_arrays got 'update' without matching types";
}

Expand All @@ -161,14 +161,14 @@ void arrayst::collect_arrays(const exprt &a)
// check types
if(!base_type_eq(array_type, a.op1().type(), ns))
{
std::cout << a.pretty() << '\n';
prop.error() << a.pretty() << messaget::eom;
throw "collect_arrays got if without matching types";
}

// check types
if(!base_type_eq(array_type, a.op2().type(), ns))
{
std::cout << a.pretty() << '\n';
prop.error() << a.pretty() << messaget::eom;
throw "collect_arrays got if without matching types";
}

Expand Down Expand Up @@ -535,8 +535,8 @@ void arrayst::add_array_constraints_with(

if(index_expr.type()!=value.type())
{
std::cout << expr.pretty() << '\n';
assert(false);
prop.error() << expr.pretty() << messaget::eom;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rjmunro Could this be why the pretty was dumped in the middle of the json (or is this old news?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's the purpose

throw "index_expr and value types should match";
}

lazy_constraintt lazy(
Expand Down Expand Up @@ -619,8 +619,8 @@ void arrayst::add_array_constraints_update(

if(index_expr.type()!=value.type())
{
std::cout << expr.pretty() << '\n';
assert(false);
prop.error() << expr.pretty() << messaget::eom;
throw "index_expr and value types should match";
}

set_to_true(equal_exprt(index_expr, value));
Expand Down