Skip to content

Commit 902389c

Browse files
committed
Simplify when combining string-refinement result constraints
Due to the improvements in constant prop we increasingly have constraints that are trivially simplified, like: if 5 >= 2 do x else y Also because of the way these conditions are combined - the resulting merged if gets added to all subsequent conditions and values - we end up with expressions like this: if 5 >= 2 then (if 5 >= 2 do x ... else y ...) else (if 5 >= 2 do x ... else y ...) Where the size of the expression increases exponentially to the complexity of the original if statement even if the entire conditional is trivial to prove right/wrong. This could likely be worked out by the SAT solver happily enough but due to the size of the resulting expressions (I've seen ones 1.34 billion nodes deep) it never gets there within a reasonable time-frame.
1 parent 56354d6 commit 902389c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/solvers/strings/string_constraint_generator_main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,5 +441,5 @@ string_constraint_generatort::combine_results(
441441
{
442442
const exprt return_code = maximum(result1.first, result2.first);
443443
merge(result2.second, std::move(result1.second));
444-
return {return_code, std::move(result2.second)};
444+
return {simplify_expr(return_code, ns), std::move(result2.second)};
445445
}

0 commit comments

Comments
 (0)