Skip to content

Commit fba0629

Browse files
committed
Add namespace access to smt2_incremental_decision_proceduret
So that instances of `symbol_exprt` can be handled correctly.
1 parent 9027d98 commit fba0629

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/goto-checker/solver_factory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ solver_factoryt::get_incremental_smt2(std::string solver_command)
333333

334334
return util_make_unique<solvert>(
335335
util_make_unique<smt2_incremental_decision_proceduret>(
336-
std::move(solver_command), message_handler));
336+
ns, std::move(solver_command), message_handler));
337337
}
338338

339339
std::unique_ptr<solver_factoryt::solvert>

src/solvers/smt2_incremental/smt2_incremental_decision_procedure.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
#include <solvers/smt2_incremental/smt_commands.h>
66
#include <solvers/smt2_incremental/smt_to_smt2_string.h>
77
#include <util/expr.h>
8+
#include <util/namespace.h>
89
#include <util/string_utils.h>
910

1011
smt2_incremental_decision_proceduret::smt2_incremental_decision_proceduret(
12+
const namespacet &_ns,
1113
std::string _solver_command,
1214
message_handlert &message_handler)
13-
: solver_command(std::move(_solver_command)),
15+
: ns{_ns},
16+
solver_command(std::move(_solver_command)),
1417
number_of_solver_calls{0},
1518
solver_process{split_string(solver_command, ' ', false, true)},
1619
log{message_handler}

src/solvers/smt2_incremental/smt2_incremental_decision_procedure.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,20 @@
1212

1313
class smt_commandt;
1414
class message_handlert;
15+
class namespacet;
1516

1617
class smt2_incremental_decision_proceduret final
1718
: public stack_decision_proceduret
1819
{
1920
public:
21+
/// \param _ns: Namespace for looking up the expressions which symbol_exprts
22+
/// relate to.
2023
/// \param solver_command:
2124
/// The command and arguments for invoking the smt2 solver.
2225
/// \param message_handler:
2326
/// The messaging system to be used for logging purposes.
2427
explicit smt2_incremental_decision_proceduret(
28+
const namespacet &_ns,
2529
std::string solver_command,
2630
message_handlert &message_handler);
2731

@@ -45,6 +49,8 @@ class smt2_incremental_decision_proceduret final
4549
/// solver process.
4650
void send_to_solver(const smt_commandt &command);
4751

52+
const namespacet &ns;
53+
4854
/// This is where we store the solver command for reporting the solver used.
4955
std::string solver_command;
5056
size_t number_of_solver_calls;

0 commit comments

Comments
 (0)