3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-15 15:25:26 +00:00

fixing unit tests

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2012-12-05 12:02:08 -08:00
commit 3bf86e1a49
75 changed files with 876 additions and 874 deletions

View file

@ -1,79 +0,0 @@
/*++
Copyright (c) 2011 Microsoft Corporation
Module Name:
params2smt_params.h
Abstract:
Backward compatibility utilities for parameter setting
Author:
Leonardo de Moura (leonardo) 2011-05-19.
Revision History:
--*/
#include"smt_params.h"
#include"params.h"
/**
Update smt_params using s.
Only the most frequently used options are updated.
This function is mainly used to allow smt::context to be used in
the new strategy framework.
*/
void params2smt_params(params_ref const & s, smt_params & t) {
t.m_relevancy_lvl = s.get_uint("relevancy", t.m_relevancy_lvl);
TRACE("qi_cost", s.display(tout); tout << "\n";);
t.m_qi_cost = s.get_str("qi_cost", t.m_qi_cost.c_str());
t.m_mbqi = s.get_bool("mbqi", t.m_mbqi);
t.m_mbqi_max_iterations = s.get_uint("mbqi_max_iterations", t.m_mbqi_max_iterations);
t.m_random_seed = s.get_uint("random_seed", t.m_random_seed);
t.m_model = s.get_bool("produce_models", t.m_model);
if (s.get_bool("produce_proofs", false))
t.m_proof_mode = PGM_FINE;
t.m_qi_eager_threshold = s.get_double("qi_eager_threshold", t.m_qi_eager_threshold);
t.m_qi_lazy_threshold = s.get_double("qi_lazy_threshold", t.m_qi_lazy_threshold);
t.m_preprocess = s.get_bool("preprocess", t.m_preprocess);
t.m_hi_div0 = s.get_bool("hi_div0", t.m_hi_div0);
t.m_auto_config = s.get_bool("auto_config", t.m_auto_config);
t.m_array_simplify = s.get_bool("array_old_simplifier", t.m_array_simplify);
t.m_arith_branch_cut_ratio = s.get_uint("arith_branch_cut_ratio", t.m_arith_branch_cut_ratio);
t.m_arith_expand_eqs = s.get_bool("arith_expand_eqs", t.m_arith_expand_eqs);
if (s.get_bool("arith_greatest_error_pivot", false))
t.m_arith_pivot_strategy = ARITH_PIVOT_GREATEST_ERROR;
else if (s.get_bool("arith_least_error_pivot", false))
t.m_arith_pivot_strategy = ARITH_PIVOT_LEAST_ERROR;
}
/**
\brief Copy parameters (from s) that affect the semantics of Z3 (e.g., HI_DIV0).
It also copies the model construction parameter. Thus, model construction
can be enabled at the command line.
*/
void smt_params2params(smt_params const & s, params_ref & t) {
if (s.m_model)
t.set_bool("produce_models", true);
if (!s.m_hi_div0)
t.set_bool("hi_div0", false);
}
/**
\brief Bridge for using params_ref with smt::context.
*/
void solver_smt_params_descrs(param_descrs & r) {
r.insert("hi_div0", CPK_BOOL, "(default: true) if true, then Z3 uses the usual hardware interpretation for division (rem, mod) by zero. Otherwise, these operations are considered uninterpreted");
r.insert("relevancy", CPK_UINT, "relevancy propagation heuristic: 0 - disabled, 1 - relevancy is tracked by only affects quantifier instantiation, 2 - relevancy is tracked, and an atom is only asserted if it is relevant");
r.insert("mbqi", CPK_BOOL, "model based quantifier instantiation (MBQI)");
r.insert("mbqi_max_iterations", CPK_UINT, "maximum number of rounds of MBQI");
r.insert("random_seed", CPK_UINT, "random seed for smt solver");
r.insert("qi_eager_threshold", CPK_DOUBLE, "threshold for eager quantifier instantiation");
r.insert("qi_lazy_threshold", CPK_DOUBLE, "threshold for lazy quantifier instantiation");
r.insert("auto_config", CPK_BOOL, "use heuristics to automatically configure smt solver");
r.insert("arith_branch_cut_ratio", CPK_UINT, "branch&bound / gomory cut ratio");
}

View file

@ -1,31 +0,0 @@
/*++
Copyright (c) 2011 Microsoft Corporation
Module Name:
params2smt_params.h
Abstract:
Backward compatibility utilities for parameter setting
Author:
Leonardo de Moura (leonardo) 2011-05-19.
Revision History:
--*/
#ifndef _PARAMS2SMT_PARAMS_H_
#define _PARAMS2SMT_PARAMS_H_
class params_ref;
struct smt_params;
void params2smt_params(params_ref const & s, smt_params & t);
void smt_params2params(smt_params const & s, params_ref & t);
void solver_smt_params_descrs(param_descrs & r);
#endif

View file

@ -1,50 +0,0 @@
/*++
Copyright (c) 2006 Microsoft Corporation
Module Name:
smt_params.cpp
Abstract:
<abstract>
Author:
Leonardo de Moura (leonardo) 2008-02-20.
Revision History:
--*/
#include"smt_params.h"
#include"smt_params_helper.hpp"
void smt_params::updt_local_params(params_ref const & _p) {
smt_params_helper p(_p);
m_auto_config = p.auto_config();
m_ematching = p.ematching();
m_phase_selection = static_cast<phase_selection>(p.phase_selection());
m_restart_strategy = static_cast<restart_strategy>(p.restart_strategy());
m_restart_factor = p.restart_factor();
m_case_split_strategy = static_cast<case_split_strategy>(p.case_split());
m_delay_units = p.delay_units();
m_delay_units_threshold = p.delay_units_threshold();
m_proof_mode = _p.get_bool("produce_proofs", false)? PGM_FINE : PGM_DISABLED;
}
void smt_params::updt_params(params_ref const & p) {
preprocessor_params::updt_params(p);
qi_params::updt_params(p);
theory_arith_params::updt_params(p);
theory_bv_params::updt_params(p);
updt_local_params(p);
}
void smt_params::updt_params(context_params const & p) {
m_auto_config = p.m_auto_config;
m_soft_timeout = p.m_timeout;
m_model = p.m_model;
m_model_validate = p.m_validate_model;
m_proof_mode = p.m_proof ? PGM_FINE : PGM_DISABLED;
}

View file

@ -207,7 +207,6 @@ struct smt_params : public preprocessor_params,
bool m_at_labels_cex; // only use labels which contains the @ symbol when building multiple counterexamples.
bool m_check_at_labels; // check that @ labels are inserted to generate unique counter-examples.
bool m_dump_goal_as_smt;
proof_gen_mode m_proof_mode;
bool m_auto_config;
smt_params(params_ref const & p = params_ref()):
@ -277,7 +276,6 @@ struct smt_params : public preprocessor_params,
m_at_labels_cex(false),
m_check_at_labels(false),
m_dump_goal_as_smt(false),
m_proof_mode(PGM_DISABLED),
m_auto_config(true) {
updt_local_params(p);
}

View file

@ -3,6 +3,8 @@ def_module_params(module_name='smt',
description='smt solver based on lazy smt',
export=True,
params=(('auto_config', BOOL, True, 'automatically configure solver'),
('random_seed', UINT, 0, 'random seed for the smt solver'),
('relevancy', UINT, 2, 'relevancy propagation heuristic: 0 - disabled, 1 - relevancy is tracked by only affects quantifier instantiation, 2 - relevancy is tracked, and an atom is only asserted if it is relevant'),
('macro_finder', BOOL, False, 'try to find universally quantified formulas that can be viewed as macros'),
('ematching', BOOL, True, 'E-Matching based quantifier instantiation'),
('phase_selection', UINT, 4, 'phase selection heuristic: 0 - always false, 1 - always true, 2 - phase caching, 3 - phase caching conservative, 4 - phase caching conservative 2, 5 - random, 6 - number of occurrences'),
@ -33,6 +35,7 @@ def_module_params(module_name='smt',
('arith.nl.rounds', UINT, 1024, 'threshold for number of (nested) final checks for non linear arithmetic'),
('arith.euclidean_solver', BOOL, False, 'eucliean solver for linear integer arithmetic'),
('arith.propagate_eqs', BOOL, True, 'propagate (cheap) equalities'),
('arith.propagation_mode', UINT, 2, '0 - no propagation, 1 - propagate existing literals, 2 - refine 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'),
('arith.ignore_int', BOOL, False, 'treat integer variables as real')))

View file

@ -32,6 +32,7 @@ void theory_arith_params::updt_params(params_ref const & _p) {
m_arith_branch_cut_ratio = p.arith_branch_cut_ratio();
m_arith_int_eq_branching = p.arith_int_eq_branch();
m_arith_ignore_int = p.arith_ignore_int();
m_arith_bound_prop = static_cast<bound_prop_mode>(p.arith_propagation_mode());
}