diff --git a/src/ast/sls/bv_sls_eval.h b/src/ast/sls/bv_sls_eval.h index 89cd3f4cf03..4384660e79a 100644 --- a/src/ast/sls/bv_sls_eval.h +++ b/src/ast/sls/bv_sls_eval.h @@ -25,6 +25,12 @@ namespace bv { class sls_fixed; + class sls_eval_plugin { + public: + virtual ~sls_eval_plugin() {} + + }; + class sls_eval { struct config { unsigned m_prob_randomize_extract = 50; @@ -40,6 +46,8 @@ namespace bv { random_gen m_rand; config m_config; + scoped_ptr_vector m_plugins; + scoped_ptr_vector m_values; // expr-id -> bv valuation diff --git a/src/math/lp/nra_solver.cpp b/src/math/lp/nra_solver.cpp index 9c9db4e4114..4c1b2b3eef8 100644 --- a/src/math/lp/nra_solver.cpp +++ b/src/math/lp/nra_solver.cpp @@ -3,6 +3,10 @@ Author: Nikolaj Bjorner, Lev Nachmanson */ +#ifndef SINGLE_THREAD +#include +#endif +#include #include "math/lp/lar_solver.h" #include "math/lp/nra_solver.h" #include "nlsat/nlsat_solver.h" @@ -11,6 +15,7 @@ #include "util/map.h" #include "util/uint_set.h" #include "math/lp/nla_core.h" +#include "smt/params/smt_params_helper.hpp" namespace nra { @@ -157,6 +162,23 @@ struct solver::imp { TRACE("nra", m_nlsat->display(tout)); + smt_params_helper p(m_params); + if (p.arith_nl_log()) { + static unsigned id = 0; + std::stringstream strm; + +#ifndef SINGLE_THREAD + std::thread::id this_id = std::this_thread::get_id(); + strm << "nla_" << this_id << "." << (++id) << ".smt2"; +#else + strm << "nla_" << (++id) << ".smt2"; +#endif + std::ofstream out(strm.str()); + m_nlsat->display_smt2(out); + out << "(check-sat)\n"; + out.close(); + } + lbool r = l_undef; try { r = m_nlsat->check(); diff --git a/src/nlsat/nlsat_solver.cpp b/src/nlsat/nlsat_solver.cpp index d99603dcddc..7a63f4e636b 100644 --- a/src/nlsat/nlsat_solver.cpp +++ b/src/nlsat/nlsat_solver.cpp @@ -3863,6 +3863,10 @@ namespace nlsat { return out; } + std::ostream& solver::display_smt2(std::ostream & out) const { + return m_imp->display_smt2(out); + } + std::ostream& solver::display_smt2(std::ostream & out, literal_vector const& ls) const { return display_smt2(out, ls.size(), ls.data()); } diff --git a/src/nlsat/nlsat_solver.h b/src/nlsat/nlsat_solver.h index c65a2b4ff79..15764150d7d 100644 --- a/src/nlsat/nlsat_solver.h +++ b/src/nlsat/nlsat_solver.h @@ -254,6 +254,8 @@ namespace nlsat { std::ostream& display_smt2(std::ostream & out, literal_vector const& ls) const; + std::ostream& display_smt2(std::ostream & out) const; + /** \brief Display variable diff --git a/src/smt/params/smt_params_helper.pyg b/src/smt/params/smt_params_helper.pyg index 4e498b2c461..1ef795e4b7d 100644 --- a/src/smt/params/smt_params_helper.pyg +++ b/src/smt/params/smt_params_helper.pyg @@ -83,6 +83,7 @@ def_module_params(module_name='smt', ('arith.nl.propagate_linear_monomials', BOOL, True, 'propagate linear monomials'), ('arith.nl.optimize_bounds', BOOL, True, 'enable bounds optimization'), ('arith.nl.cross_nested', BOOL, True, 'enable cross-nested consistency checking'), + ('arith.nl.log', BOOL, False, 'Log lemmas sent to nra solver'), ('arith.propagate_eqs', BOOL, True, 'propagate (cheap) equalities'), ('arith.propagation_mode', UINT, 1, '0 - no propagation, 1 - propagate existing literals, 2 - refine finite bounds'), ('arith.branch_cut_ratio', UINT, 2, 'branch/cut ratio for linear integer arithmetic'),