Skip to content

Commit 3a1450c

Browse files
committed
Add the unimplemented exprs to INVARIANT messages
For ease of seeing what the unimplemented expression is.
1 parent c7aefa6 commit 3a1450c

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

regression/cbmc-incr-smt2/nondeterministic-int-assert/incremental_solver_called.desc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ test.c
44
Passing problem to incremental SMT2 solving via "z3"
55
^EXIT=(0|127|134|137)$
66
^SIGNAL=0$
7+
identifier: main::1::x
78
--
9+
type: pointer
810
--
911
Test that running cbmc with the `--incremental-smt2-solver` argument causes the
1012
incremental smt2 solving to be used. Note that at the time of adding this test,
1113
an invariant violation is expected due to the unimplemented solving.
14+
Regexes matching the printing in the expected failed invariant are included in
15+
order to test that `--slice-formula` is causing the first unimplemented
16+
expression passed to `smt2_incremental_decision_proceduret` to relate to the
17+
variable `x` in function `main` and not to `cprover_initialise`.

src/solvers/smt2_incremental/smt2_incremental_decision_procedure.cpp

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@ exprt smt2_incremental_decision_proceduret::handle(const exprt &expr)
1717

1818
exprt smt2_incremental_decision_proceduret::get(const exprt &expr) const
1919
{
20-
UNIMPLEMENTED;
21-
return exprt();
20+
UNIMPLEMENTED_FEATURE("`get` of:\n " + expr.pretty(2, 0));
2221
}
2322

2423
void smt2_incremental_decision_proceduret::print_assignment(
2524
std::ostream &out) const
2625
{
27-
UNIMPLEMENTED;
26+
UNIMPLEMENTED_FEATURE("printing of assignments.");
2827
}
2928

3029
std::string
@@ -41,28 +40,34 @@ smt2_incremental_decision_proceduret::get_number_of_solver_calls() const
4140

4241
void smt2_incremental_decision_proceduret::set_to(const exprt &expr, bool value)
4342
{
44-
UNIMPLEMENTED;
43+
UNIMPLEMENTED_FEATURE(
44+
"`set_to` (" + std::string{value ? "true" : "false"} + "):\n " +
45+
expr.pretty(2, 0));
4546
}
4647

4748
void smt2_incremental_decision_proceduret::push(
4849
const std::vector<exprt> &assumptions)
4950
{
50-
UNIMPLEMENTED;
51+
for(const auto &assumption : assumptions)
52+
{
53+
UNIMPLEMENTED_FEATURE(
54+
"pushing of assumption:\n " + assumption.pretty(2, 0));
55+
}
56+
UNIMPLEMENTED_FEATURE("`push` of empty assumptions.");
5157
}
5258

5359
void smt2_incremental_decision_proceduret::push()
5460
{
55-
UNIMPLEMENTED;
61+
UNIMPLEMENTED_FEATURE("`push`.");
5662
}
5763

5864
void smt2_incremental_decision_proceduret::pop()
5965
{
60-
UNIMPLEMENTED;
66+
UNIMPLEMENTED_FEATURE("`pop`.");
6167
}
6268

6369
decision_proceduret::resultt smt2_incremental_decision_proceduret::dec_solve()
6470
{
6571
++number_of_solver_calls;
66-
UNIMPLEMENTED;
67-
return decision_proceduret::resultt::D_SATISFIABLE;
72+
UNIMPLEMENTED_FEATURE("solving.");
6873
}

0 commit comments

Comments
 (0)