mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
fixes to cuts
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
7d8b56027f
commit
dcd4fff284
18 changed files with 75 additions and 50 deletions
|
@ -202,7 +202,7 @@ extern "C" {
|
|||
SET_ERROR_CODE(Z3_INVALID_ARG, "If this is not what you want, then preprocess by optional bit-blasting and applying tseitin-cnf");
|
||||
RETURN_Z3(nullptr);
|
||||
}
|
||||
to_goal_ref(g)->display_dimacs(buffer);
|
||||
to_goal_ref(g)->display_dimacs(buffer, true);
|
||||
// Hack for removing the trailing '\n'
|
||||
std::string result = buffer.str();
|
||||
SASSERT(result.size() > 0);
|
||||
|
|
|
@ -695,13 +695,13 @@ extern "C" {
|
|||
Z3_CATCH_RETURN("");
|
||||
}
|
||||
|
||||
Z3_string Z3_API Z3_solver_to_dimacs_string(Z3_context c, Z3_solver s) {
|
||||
Z3_string Z3_API Z3_solver_to_dimacs_string(Z3_context c, Z3_solver s, bool include_names) {
|
||||
Z3_TRY;
|
||||
LOG_Z3_solver_to_string(c, s);
|
||||
RESET_ERROR_CODE();
|
||||
init_solver(c, s);
|
||||
std::ostringstream buffer;
|
||||
to_solver_ref(s)->display_dimacs(buffer);
|
||||
to_solver_ref(s)->display_dimacs(buffer, include_names);
|
||||
return mk_c(c)->mk_external_string(buffer.str());
|
||||
Z3_CATCH_RETURN("");
|
||||
}
|
||||
|
|
|
@ -2422,7 +2422,7 @@ namespace z3 {
|
|||
fml));
|
||||
}
|
||||
|
||||
std::string dimacs() const { return std::string(Z3_solver_to_dimacs_string(ctx(), m_solver)); }
|
||||
std::string dimacs(bool include_names = true) const { return std::string(Z3_solver_to_dimacs_string(ctx(), m_solver, include_names)); }
|
||||
|
||||
param_descrs get_param_descrs() { return param_descrs(ctx(), Z3_solver_get_param_descrs(ctx(), m_solver)); }
|
||||
|
||||
|
|
|
@ -6907,9 +6907,9 @@ class Solver(Z3PPObject):
|
|||
"""
|
||||
return Z3_solver_to_string(self.ctx.ref(), self.solver)
|
||||
|
||||
def dimacs(self):
|
||||
def dimacs(self, include_names=True):
|
||||
"""Return a textual representation of the solver in DIMACS format."""
|
||||
return Z3_solver_to_dimacs_string(self.ctx.ref(), self.solver)
|
||||
return Z3_solver_to_dimacs_string(self.ctx.ref(), self.solver, include_names)
|
||||
|
||||
def to_smt2(self):
|
||||
"""return SMTLIB2 formatted benchmark for solver's assertions"""
|
||||
|
|
|
@ -6633,9 +6633,9 @@ extern "C" {
|
|||
\brief Convert a solver into a DIMACS formatted string.
|
||||
\sa Z3_goal_to_diamcs_string for requirements.
|
||||
|
||||
def_API('Z3_solver_to_dimacs_string', STRING, (_in(CONTEXT), _in(SOLVER)))
|
||||
def_API('Z3_solver_to_dimacs_string', STRING, (_in(CONTEXT), _in(SOLVER), _in(BOOL)))
|
||||
*/
|
||||
Z3_string Z3_API Z3_solver_to_dimacs_string(Z3_context c, Z3_solver s);
|
||||
Z3_string Z3_API Z3_solver_to_dimacs_string(Z3_context c, Z3_solver s, bool include_names);
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue