3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-20 18:20:22 +00:00

add option to control epsilon #7791

#7791 reports on using model values during lex optimization that break soft constraints.
This is an artifact of using optimization where optimal values can be arbitrarily close to a rational.
In a way it is by design, but we give the user now an option to control the starting point for epsilon when converting infinitesimals into rationals.
This commit is contained in:
Nikolaj Bjorner 2025-08-17 16:47:23 -07:00
parent d8bf0e047f
commit c75b8ec752
7 changed files with 14 additions and 4 deletions

View file

@ -86,6 +86,7 @@ def_module_params(module_name='smt',
('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.epsilon', DOUBLE, 1.0, 'initial value of epsilon used for model generation of infinitesimals'),
('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'),
('arith.int_eq_branch', BOOL, False, 'branching using derived integer equations'),

View file

@ -41,6 +41,8 @@ void theory_arith_params::updt_params(params_ref const & _p) {
m_nl_arith_propagate_linear_monomials = p.arith_nl_propagate_linear_monomials();
m_nl_arith_optimize_bounds = p.arith_nl_optimize_bounds();
m_nl_arith_cross_nested = p.arith_nl_cross_nested();
auto eps = p.arith_epsilon();
m_arith_epsilon = rational(std::max(1, (int)(100000*eps)), 100000);
arith_rewriter_params ap(_p);
m_arith_eq2ineq = ap.eq2ineq();
@ -99,4 +101,5 @@ void theory_arith_params::display(std::ostream & out) const {
DISPLAY_PARAM(m_nl_arith_cross_nested);
DISPLAY_PARAM(m_arith_validate);
DISPLAY_PARAM(m_arith_dump_lemmas);
DISPLAY_PARAM(m_arith_epsilon);
}

View file

@ -20,6 +20,7 @@ Revision History:
#include<climits>
#include "util/params.h"
#include "util/rational.h"
enum class arith_solver_id {
AS_NO_ARITH, // 0
@ -76,6 +77,7 @@ struct theory_arith_params {
unsigned m_arith_branch_cut_ratio = 2;
bool m_arith_int_eq_branching = false;
bool m_arith_enum_const_mod = false;
rational m_arith_epsilon = rational::one();
bool m_arith_gcd_test = true;
bool m_arith_eager_gcd = false;