Skip to content

Implement sending commands to solver in incremental SMT2 backend #6357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "smt2_incremental_decision_procedure.h"

#include <solvers/smt2_incremental/smt_commands.h>
#include <solvers/smt2_incremental/smt_to_smt2_string.h>
#include <util/expr.h>
#include <util/string_utils.h>
Expand All @@ -12,6 +13,9 @@ smt2_incremental_decision_proceduret::smt2_incremental_decision_proceduret(
number_of_solver_calls{0},
solver_process{split_string(solver_command, ' ', false, true)}
{
send_to_solver(smt_set_option_commandt{smt_option_produce_modelst{true}});
send_to_solver(smt_set_logic_commandt{
smt_logic_quantifier_free_uninterpreted_functions_bit_vectorst{}});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to send these at solver construction time, or do we want to send/update these per query? I don't have a good answer now, but there was comment on another issue/PR that the logic could vary for different calls/inputs. Also do we want to be able to change these later (and is this allowed/easy to do)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to section 4.1 of the SMTLIB standard version 2.6, the set-logic command can only be issued whilst the solver is in "Start mode" and the only way to return to this mode is to issue the reset command. The actions of the reset command include undefining all functions and assertions we have sent to the solver. Therefore if we were reseting and setting different logics for different rounds of solving, then we would no longer be carrying out incremental solving.

TLDR; We should be sending these commands at construction time.

}

exprt smt2_incremental_decision_proceduret::handle(const exprt &expr)
Expand Down