Skip to content

Commit 6bc8b1f

Browse files
committed
Implement dec_solve
1 parent f286c07 commit 6bc8b1f

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@ Sending command to SMT2 solver - \(define-fun |B1| \(\) Bool \(|=| |main::1::x!0
1010
Sending command to SMT2 solver - \(assert \(|not| \(|not| \(|=| |main::1::x!0@1#1| \(_ bv0 32\)\)\)\)\)
1111
Sending command to SMT2 solver - \(define-fun |B2| \(\) Bool \(|not| false\)\)
1212
Sending command to SMT2 solver - \(assert |B2|\)
13+
Sending command to SMT2 solver - \(check-sat\)
14+
Solver response - sat
1315
^EXIT=(0|127|134|137)$
1416
^SIGNAL=0$
15-
identifier: main::1::x
1617
--
1718
type: pointer
1819
--
1920
Test that running cbmc with the `--incremental-smt2-solver` argument causes the
2021
incremental smt2 solving to be used. Note that at the time of adding this test,
21-
an invariant violation is expected due to the unimplemented solving.
22-
Regexes matching the printing in the expected failed invariant are included in
23-
order to test that `--slice-formula` is causing the first unimplemented
24-
expression passed to `smt2_incremental_decision_proceduret` to relate to the
25-
variable `x` in function `main` and not to `cprover_initialise`.
22+
an invariant violation is expected due to the unimplemented response parsing.
23+
24+
The sliced formula is expected to use only the implemented subset of exprts.
25+
This is implementation is sufficient to send this example to the solver and
26+
receive a "sat" response.

src/solvers/smt2_incremental/smt2_incremental_decision_procedure.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,10 @@ void smt2_incremental_decision_proceduret::pop()
196196
decision_proceduret::resultt smt2_incremental_decision_proceduret::dec_solve()
197197
{
198198
++number_of_solver_calls;
199-
UNIMPLEMENTED_FEATURE("solving.");
199+
send_to_solver(smt_check_sat_commandt{});
200+
const auto result = solver_process.wait_receive();
201+
log.debug() << "Solver response - " << result << messaget::eom;
202+
UNIMPLEMENTED_FEATURE("parsing of solver response.");
200203
}
201204

202205
void smt2_incremental_decision_proceduret::send_to_solver(

0 commit comments

Comments
 (0)