Skip to content

Commit 303ec4d

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 4c48218 commit 303ec4d

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
@@ -416,5 +416,5 @@ string_constraint_generatort::combine_results(
416416
{
417417
const exprt return_code = maximum(result1.first, result2.first);
418418
merge(result2.second, std::move(result1.second));
419-
return {return_code, std::move(result2.second)};
419+
return {simplify_expr(return_code, ns), std::move(result2.second)};
420420
}

0 commit comments

Comments
 (0)