3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 11:55:51 +00:00

merge with master branch

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-09-19 09:39:22 -07:00
commit 651587ce01
1602 changed files with 40496 additions and 27837 deletions

View file

@ -13,7 +13,6 @@ z3_add_component(smt_params
ast
bit_blaster
pattern
simplifier
PYG_FILES
smt_params_helper.pyg
)

View file

@ -16,8 +16,8 @@ Author:
Revision History:
--*/
#include"dyn_ack_params.h"
#include"smt_params_helper.hpp"
#include "smt/params/dyn_ack_params.h"
#include "smt/params/smt_params_helper.hpp"
void dyn_ack_params::updt_params(params_ref const & _p) {
smt_params_helper p(_p);

View file

@ -19,7 +19,7 @@ Revision History:
#ifndef DYN_ACK_PARAMS_H_
#define DYN_ACK_PARAMS_H_
#include"params.h"
#include "util/params.h"
enum dyn_ack_strategy {
DACK_DISABLED,

View file

@ -16,20 +16,20 @@ Author:
Revision History:
--*/
#include"preprocessor_params.h"
#include"smt_params_helper.hpp"
#include "smt/params/preprocessor_params.h"
#include "smt/params/smt_params_helper.hpp"
void preprocessor_params::updt_local_params(params_ref const & _p) {
smt_params_helper p(_p);
m_macro_finder = p.macro_finder();
m_quasi_macros = p.quasi_macros();
m_restricted_quasi_macros = p.restricted_quasi_macros();
m_pull_nested_quantifiers = p.pull_nested_quantifiers();
m_refine_inj_axiom = p.refine_inj_axioms();
}
void preprocessor_params::updt_params(params_ref const & p) {
pattern_inference_params::updt_params(p);
bv_simplifier_params::updt_params(p);
arith_simplifier_params::updt_params(p);
updt_local_params(p);
}
@ -38,15 +38,12 @@ void preprocessor_params::updt_params(params_ref const & p) {
void preprocessor_params::display(std::ostream & out) const {
pattern_inference_params::display(out);
bit_blaster_params::display(out);
bv_simplifier_params::display(out);
arith_simplifier_params::display(out);
DISPLAY_PARAM(m_lift_ite);
DISPLAY_PARAM(m_ng_lift_ite);
DISPLAY_PARAM(m_pull_cheap_ite_trees);
DISPLAY_PARAM(m_pull_nested_quantifiers);
DISPLAY_PARAM(m_eliminate_term_ite);
DISPLAY_PARAM(m_eliminate_and);
DISPLAY_PARAM(m_macro_finder);
DISPLAY_PARAM(m_propagate_values);
DISPLAY_PARAM(m_propagate_booleans);

View file

@ -19,10 +19,8 @@ Revision History:
#ifndef PREPROCESSOR_PARAMS_H_
#define PREPROCESSOR_PARAMS_H_
#include"pattern_inference_params.h"
#include"bit_blaster_params.h"
#include"bv_simplifier_params.h"
#include"arith_simplifier_params.h"
#include "ast/pattern/pattern_inference_params.h"
#include "ast/rewriter/bit_blaster/bit_blaster_params.h"
enum lift_ite_kind {
LI_NONE,
@ -31,15 +29,12 @@ enum lift_ite_kind {
};
struct preprocessor_params : public pattern_inference_params,
public bit_blaster_params,
public bv_simplifier_params,
public arith_simplifier_params {
public bit_blaster_params {
lift_ite_kind m_lift_ite;
lift_ite_kind m_ng_lift_ite; // lift ite for non ground terms
bool m_pull_cheap_ite_trees;
bool m_pull_nested_quantifiers;
bool m_eliminate_term_ite;
bool m_eliminate_and; // represent (and a b) as (not (or (not a) (not b)))
bool m_macro_finder;
bool m_propagate_values;
bool m_propagate_booleans;
@ -62,7 +57,6 @@ public:
m_pull_cheap_ite_trees(false),
m_pull_nested_quantifiers(false),
m_eliminate_term_ite(false),
m_eliminate_and(true),
m_macro_finder(false),
m_propagate_values(true),
m_propagate_booleans(false), // TODO << check peformance

View file

@ -16,8 +16,8 @@ Author:
Revision History:
--*/
#include"qi_params.h"
#include"smt_params_helper.hpp"
#include "smt/params/qi_params.h"
#include "smt/params/smt_params_helper.hpp"
void qi_params::updt_params(params_ref const & _p) {
smt_params_helper p(_p);

View file

@ -19,8 +19,8 @@ Revision History:
#ifndef QI_PARAMS_H_
#define QI_PARAMS_H_
#include"util.h"
#include"params.h"
#include "util/util.h"
#include "util/params.h"
enum quick_checker_mode {
MC_NO, // do not use (cheap) model checking based instantiation

View file

@ -16,10 +16,10 @@ Author:
Revision History:
--*/
#include"smt_params.h"
#include"smt_params_helper.hpp"
#include"model_params.hpp"
#include"gparams.h"
#include "smt/params/smt_params.h"
#include "smt/params/smt_params_helper.hpp"
#include "model/model_params.hpp"
#include "util/gparams.h"
void smt_params::updt_local_params(params_ref const & _p) {
smt_params_helper p(_p);
@ -49,6 +49,9 @@ void smt_params::updt_local_params(params_ref const & _p) {
else if (_p.get_bool("arith.least_error_pivot", false))
m_arith_pivot_strategy = ARITH_PIVOT_LEAST_ERROR;
theory_array_params::updt_params(_p);
m_dump_benchmarks = false;
m_dump_min_time = 0.5;
m_dump_recheck = false;
}
void smt_params::updt_params(params_ref const & p) {

View file

@ -19,19 +19,19 @@ Revision History:
#ifndef SMT_PARAMS_H_
#define SMT_PARAMS_H_
#include"ast.h"
#include"dyn_ack_params.h"
#include"qi_params.h"
#include"theory_arith_params.h"
#include"theory_array_params.h"
#include"theory_bv_params.h"
#include"theory_str_params.h"
#include"theory_pb_params.h"
#include"theory_datatype_params.h"
#include"preprocessor_params.h"
#include"context_params.h"
#include "ast/ast.h"
#include "smt/params/dyn_ack_params.h"
#include "smt/params/qi_params.h"
#include "smt/params/theory_arith_params.h"
#include "smt/params/theory_array_params.h"
#include "smt/params/theory_bv_params.h"
#include "smt/params/theory_str_params.h"
#include "smt/params/theory_pb_params.h"
#include "smt/params/theory_datatype_params.h"
#include "smt/params/preprocessor_params.h"
#include "cmd_context/context_params.h"
enum phase_selection {
enum phase_selection {
PS_ALWAYS_FALSE,
PS_ALWAYS_TRUE,
PS_CACHING,
@ -52,7 +52,8 @@ enum restart_strategy {
enum lemma_gc_strategy {
LGC_FIXED,
LGC_GEOMETRIC,
LGC_AT_RESTART
LGC_AT_RESTART,
LGC_NONE
};
enum initial_activity {
@ -71,11 +72,11 @@ enum case_split_strategy {
CS_ACTIVITY_THEORY_AWARE_BRANCHING // activity-based case split, but theory solvers can manipulate activity
};
struct smt_params : public preprocessor_params,
public dyn_ack_params,
public qi_params,
public theory_arith_params,
public theory_array_params,
struct smt_params : public preprocessor_params,
public dyn_ack_params,
public qi_params,
public theory_arith_params,
public theory_array_params,
public theory_bv_params,
public theory_str_params,
public theory_pb_params,
@ -153,12 +154,12 @@ struct smt_params : public preprocessor_params,
unsigned m_lemma_gc_initial;
double m_lemma_gc_factor;
unsigned m_new_old_ratio; //!< the ratio of new and old clauses.
unsigned m_new_clause_activity;
unsigned m_new_clause_activity;
unsigned m_old_clause_activity;
unsigned m_new_clause_relevancy; //!< Max. number of unassigned literals to be considered relevant.
unsigned m_old_clause_relevancy; //!< Max. number of unassigned literals to be considered relevant.
double m_inv_clause_decay; //!< clause activity decay
// -----------------------------------
//
// SMT-LIB (debug) pretty printer
@ -166,7 +167,7 @@ struct smt_params : public preprocessor_params,
// -----------------------------------
bool m_smtlib_dump_lemmas;
symbol m_logic;
// -----------------------------------
//
// Statistics for Profiling
@ -179,10 +180,10 @@ struct smt_params : public preprocessor_params,
// -----------------------------------
//
// Model generation
// Model generation
//
// -----------------------------------
bool m_model;
bool m_model;
bool m_model_compact;
bool m_model_on_timeout;
bool m_model_on_final_check;
@ -213,10 +214,19 @@ struct smt_params : public preprocessor_params,
unsigned m_timeout;
unsigned m_rlimit;
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_check_at_labels; // check that @ labels are inserted to generate unique counter-examples.
bool m_dump_goal_as_smt;
bool m_auto_config;
// -----------------------------------
//
// Spacer hacking
//
// -----------------------------------
bool m_dump_benchmarks;
double m_dump_min_time;
bool m_dump_recheck;
// -----------------------------------
//
// Solver selection
@ -228,7 +238,7 @@ struct smt_params : public preprocessor_params,
m_display_proof(false),
m_display_dot_proof(false),
m_display_unsat_core(false),
m_check_proof(false),
m_check_proof(false),
m_eq_propagation(true),
m_binary_clause_opt(true),
m_relevancy_lvl(2),
@ -270,7 +280,7 @@ struct smt_params : public preprocessor_params,
m_new_old_ratio(16),
m_new_clause_activity(10),
m_old_clause_activity(500),
m_new_clause_relevancy(45),
m_new_clause_relevancy(45),
m_old_clause_relevancy(6),
m_inv_clause_decay(1),
m_smtlib_dump_lemmas(false),

View file

@ -7,6 +7,8 @@ def_module_params(module_name='smt',
('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'),
('quasi_macros', BOOL, False, 'try to find universally quantified formulas that are quasi-macros'),
('restricted_quasi_macros', BOOL, False, 'try to find universally quantified formulas that are restricted quasi-macros'),
('ematching', BOOL, True, 'E-Matching based quantifier instantiation'),
('phase_selection', UINT, 3, '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'),
('restart_strategy', UINT, 1, '0 - geometric, 1 - inner-outer-geometric, 2 - luby, 3 - fixed, 4 - arithmetic'),
@ -80,5 +82,6 @@ def_module_params(module_name='smt',
('core.minimize', BOOL, False, 'minimize unsat core produced by SMT context'),
('core.extend_patterns', BOOL, False, 'extend unsat core with literals that trigger (potential) quantifier instances'),
('core.extend_patterns.max_distance', UINT, UINT_MAX, 'limits the distance of a pattern-extended unsat core'),
('core.extend_nonlocal_patterns', BOOL, False, 'extend unsat cores with literals that have quantifiers with patterns that contain symbols which are not in the quantifier\'s body')
('core.extend_nonlocal_patterns', BOOL, False, 'extend unsat cores with literals that have quantifiers with patterns that contain symbols which are not in the quantifier\'s body'),
('lemma_gc_strategy', UINT, 0, 'lemma garbage collection strategy: 0 - fixed, 1 - geometric, 2 - at restart, 3 - none')
))

View file

@ -16,8 +16,9 @@ Author:
Revision History:
--*/
#include"theory_arith_params.h"
#include"smt_params_helper.hpp"
#include "smt/params/theory_arith_params.h"
#include "smt/params/smt_params_helper.hpp"
#include "ast/rewriter/arith_rewriter_params.hpp"
void theory_arith_params::updt_params(params_ref const & _p) {
smt_params_helper p(_p);
@ -36,12 +37,16 @@ void theory_arith_params::updt_params(params_ref const & _p) {
m_arith_bound_prop = static_cast<bound_prop_mode>(p.arith_propagation_mode());
m_arith_dump_lemmas = p.arith_dump_lemmas();
m_arith_reflect = p.arith_reflect();
arith_rewriter_params ap(_p);
m_arith_eq2ineq = ap.eq2ineq();
}
#define DISPLAY_PARAM(X) out << #X"=" << X << std::endl;
void theory_arith_params::display(std::ostream & out) const {
DISPLAY_PARAM(m_arith_eq2ineq);
DISPLAY_PARAM(m_arith_process_all_eqs);
DISPLAY_PARAM(m_arith_mode);
DISPLAY_PARAM(m_arith_auto_config_simplex); //!< force simplex solver in auto_config
DISPLAY_PARAM(m_arith_blands_rule_threshold);

View file

@ -20,7 +20,7 @@ Revision History:
#define THEORY_ARITH_PARAMS_H_
#include<limits.h>
#include"params.h"
#include "util/params.h"
enum arith_solver_id {
AS_NO_ARITH, // 0
@ -50,6 +50,8 @@ enum arith_pivot_strategy {
};
struct theory_arith_params {
bool m_arith_eq2ineq;
bool m_arith_process_all_eqs;
arith_solver_id m_arith_mode;
bool m_arith_auto_config_simplex; //!< force simplex solver in auto_config
unsigned m_arith_blands_rule_threshold;
@ -109,6 +111,8 @@ struct theory_arith_params {
theory_arith_params(params_ref const & p = params_ref()):
m_arith_eq2ineq(false),
m_arith_process_all_eqs(false),
m_arith_mode(AS_ARITH),
m_arith_auto_config_simplex(false),
m_arith_blands_rule_threshold(1000),

View file

@ -16,8 +16,8 @@ Author:
Revision History:
--*/
#include"theory_array_params.h"
#include"smt_params_helper.hpp"
#include "smt/params/theory_array_params.h"
#include "smt/params/smt_params_helper.hpp"
void theory_array_params::updt_params(params_ref const & _p) {
smt_params_helper p(_p);

View file

@ -19,7 +19,7 @@ Revision History:
#ifndef THEORY_ARRAY_PARAMS_H_
#define THEORY_ARRAY_PARAMS_H_
#include"array_simplifier_params.h"
#include "util/params.h"
enum array_solver_id {
AR_NO_ARRAY,
@ -28,7 +28,9 @@ enum array_solver_id {
AR_FULL
};
struct theory_array_params : public array_simplifier_params {
struct theory_array_params {
bool m_array_canonize_simplify;
bool m_array_simplify; // temporary hack for disabling array simplifier plugin.
array_solver_id m_array_mode;
bool m_array_weak;
bool m_array_extensional;
@ -40,6 +42,8 @@ struct theory_array_params : public array_simplifier_params {
unsigned m_array_lazy_ieq_delay;
theory_array_params():
m_array_canonize_simplify(false),
m_array_simplify(true),
m_array_mode(AR_FULL),
m_array_weak(false),
m_array_extensional(true),

View file

@ -16,11 +16,14 @@ Author:
Revision History:
--*/
#include"theory_bv_params.h"
#include"smt_params_helper.hpp"
#include "smt/params/theory_bv_params.h"
#include "smt/params/smt_params_helper.hpp"
#include "ast/rewriter/bv_rewriter_params.hpp"
void theory_bv_params::updt_params(params_ref const & _p) {
smt_params_helper p(_p);
bv_rewriter_params rp(_p);
m_hi_div0 = rp.hi_div0();
m_bv_reflect = p.bv_reflect();
m_bv_enable_int2bv2int = p.bv_enable_int2bv();
}
@ -29,9 +32,10 @@ void theory_bv_params::updt_params(params_ref const & _p) {
void theory_bv_params::display(std::ostream & out) const {
DISPLAY_PARAM(m_bv_mode);
DISPLAY_PARAM(m_hi_div0);
DISPLAY_PARAM(m_bv_reflect);
DISPLAY_PARAM(m_bv_lazy_le);
DISPLAY_PARAM(m_bv_cc);
DISPLAY_PARAM(m_bv_blast_max_size);
DISPLAY_PARAM(m_bv_enable_int2bv2int);
}
}

View file

@ -19,7 +19,7 @@ Revision History:
#ifndef THEORY_BV_PARAMS_H_
#define THEORY_BV_PARAMS_H_
#include"params.h"
#include "util/params.h"
enum bv_solver_id {
BS_NO_BV,
@ -28,6 +28,7 @@ enum bv_solver_id {
struct theory_bv_params {
bv_solver_id m_bv_mode;
bool m_hi_div0; //!< if true, uses the hardware interpretation for div0, mod0, ... if false, div0, mod0, ... are considered uninterpreted.
bool m_bv_reflect;
bool m_bv_lazy_le;
bool m_bv_cc;
@ -35,6 +36,7 @@ struct theory_bv_params {
bool m_bv_enable_int2bv2int;
theory_bv_params(params_ref const & p = params_ref()):
m_bv_mode(BS_BLASTER),
m_hi_div0(false),
m_bv_reflect(true),
m_bv_lazy_le(false),
m_bv_cc(false),

View file

@ -16,8 +16,8 @@ Author:
Revision History:
--*/
#include"theory_pb_params.h"
#include"smt_params_helper.hpp"
#include "smt/params/theory_pb_params.h"
#include "smt/params/smt_params_helper.hpp"
void theory_pb_params::updt_params(params_ref const & _p) {
smt_params_helper p(_p);

View file

@ -19,7 +19,7 @@ Revision History:
#ifndef THEORY_PB_PARAMS_H_
#define THEORY_PB_PARAMS_H_
#include"params.h"
#include "util/params.h"
struct theory_pb_params {

View file

@ -15,8 +15,8 @@ Revision History:
--*/
#include"theory_str_params.h"
#include"smt_params_helper.hpp"
#include "smt/params/theory_str_params.h"
#include "smt/params/smt_params_helper.hpp"
void theory_str_params::updt_params(params_ref const & _p) {
smt_params_helper p(_p);

View file

@ -18,7 +18,7 @@ Revision History:
#ifndef THEORY_STR_PARAMS_H
#define THEORY_STR_PARAMS_H
#include"params.h"
#include "util/params.h"
struct theory_str_params {
/*