Skip to content

Commit b4a4122

Browse files
authored
Merge pull request #7309 from tautschnig/bugfixes/6333-solver-stats
Solver stats reporting: fix expression mapping for guards
2 parents dfdd25f + 557624c commit b4a4122

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
int main()
2+
{
3+
int a;
4+
if(a > 0)
5+
{
6+
if(a > 10)
7+
{
8+
(void)a;
9+
goto out;
10+
}
11+
}
12+
__CPROVER_assert(a > 0, "should fail");
13+
out:
14+
return 0;
15+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CORE
2+
main.c
3+
--write-solver-stats-to 'solver_hardness.json'
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\[main.assertion.1\] line 12 should fail: FAILURE$
7+
^VERIFICATION FAILED$
8+
\{"GOTO":"GOTO \d+","GOTO_ID":\d+,"SAT_hardness":\{"ClauseSet":\[\d+.*\],"Clauses":[1-9]\d*,"Literals":[1-9]\d*,"Variables":[1-9]\d*},"SSA_expr":"goto_symex::\\\\guard#1 ∧ goto_symex::\\\\guard#2","Source":\{"file":"main.c","function":"main","line":"\d+","workingDirectory":".*"\}\}
9+
--
10+
^warning: ignoring
11+
\{"GOTO":"GOTO \d+","GOTO_ID":\d+,"SAT_hardness":\{"ClauseSet":\[\d+.*\],"Clauses":[1-9]\d*,"Literals":[1-9]\d*,"Variables":[1-9]\d*},"SSA_expr":"true","Source":\{"file":"main.c","function":"main","line":"\d+","workingDirectory":".*"\}\}
12+
--
13+
"true" must not yield any clauses.

src/goto-symex/symex_target_equation.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,9 @@ void symex_target_equationt::convert_guards(
416416

417417
step.guard_handle = decision_procedure.handle(step.guard);
418418
with_solver_hardness(
419-
decision_procedure, hardness_register_ssa(step_index, step));
419+
decision_procedure, [step_index, &step](solver_hardnesst &hardness) {
420+
hardness.register_ssa(step_index, step.guard, step.source.pc);
421+
});
420422
}
421423
++step_index;
422424
}

0 commit comments

Comments
 (0)