Skip to content

Commit cf39c29

Browse files
author
Joel Allred
committed
Replace asserts
asserts are to be replaced by INVARIANT, PRECONDITION, CHECK_RETURN, etc.
1 parent ef5bd4d commit cf39c29

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/solvers/refinement/string_constraint_generator_concat.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ string_exprt string_constraint_generatort::add_axioms_for_concat(
9191
const function_application_exprt &f)
9292
{
9393
const function_application_exprt::argumentst &args=f.arguments();
94-
assert(args.size()>=2);
94+
PRECONDITION(args.size()>=2);
9595
string_exprt s1=get_string_expr(args[0]);
9696
string_exprt s2=get_string_expr(args[1]);
9797
if(args.size()!=2)
9898
{
99-
assert(args.size()==4);
99+
PRECONDITION(args.size()==4);
100100
return add_axioms_for_concat_substr(s1, s2, args[2], args[3]);
101101
}
102102
return add_axioms_for_concat(s1, s2);
@@ -160,7 +160,7 @@ string_exprt string_constraint_generatort::add_axioms_for_concat_double(
160160
const function_application_exprt &f)
161161
{
162162
string_exprt s1=get_string_expr(args(f, 2)[0]);
163-
assert(refined_string_typet::is_refined_string_type(f.type()));
163+
PRECONDITION(refined_string_typet::is_refined_string_type(f.type()));
164164
refined_string_typet ref_type=to_refined_string_type(f.type());
165165
string_exprt s2=add_axioms_from_float(args(f, 2)[1], ref_type, true);
166166
return add_axioms_for_concat(s1, s2);
@@ -173,7 +173,7 @@ string_exprt string_constraint_generatort::add_axioms_for_concat_float(
173173
const function_application_exprt &f)
174174
{
175175
string_exprt s1=get_string_expr(args(f, 2)[0]);
176-
assert(refined_string_typet::is_refined_string_type(f.type()));
176+
PRECONDITION(refined_string_typet::is_refined_string_type(f.type()));
177177
refined_string_typet ref_type=to_refined_string_type(f.type());
178178
string_exprt s2=add_axioms_from_float(args(f, 2)[1], ref_type, false);
179179
return add_axioms_for_concat(s1, s2);

0 commit comments

Comments
 (0)