3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-16 19:06:17 +00:00
This commit is contained in:
Christoph M. Wintersteiger 2015-05-19 11:01:15 +01:00
parent 25f37c8a0c
commit 32fb679066
17 changed files with 141 additions and 142 deletions

View file

@ -89,7 +89,7 @@ namespace api {
m_bv_util(m()),
m_datalog_util(m()),
m_fpa_util(m()),
m_dtutil(m()),
m_dtutil(m()),
m_last_result(m()),
m_ast_trail(m()),
m_replay_stack() {

View file

@ -36,11 +36,11 @@
#include"scoped_proof.h"
static void show_interpolant_and_maybe_check(cmd_context & ctx,
ptr_vector<ast> &cnsts,
expr *t,
ptr_vector<ast> &interps,
params_ref &m_params,
bool check)
ptr_vector<ast> &cnsts,
expr *t,
ptr_vector<ast> &interps,
params_ref &m_params,
bool check)
{
if (m_params.get_bool("som", false))

View file

@ -1171,7 +1171,7 @@ namespace Duality {
new_alits.push_back(conj);
#endif
slvr().add(ctx.make(Implies, res, conj));
// std::cout << res << ": " << conj << "\n";
// std::cout << res << ": " << conj << "\n";
}
if (opt_map)
(*opt_map)[res] = conj;
@ -3056,7 +3056,7 @@ namespace Duality {
Push();
expr the_impl = is.get_implicant();
if(eq(the_impl,prev_impl)){
// std::cout << "got old implicant\n";
// std::cout << "got old implicant\n";
repeated_case_count++;
}
prev_impl = the_impl;
@ -3379,7 +3379,7 @@ namespace Duality {
int arity = f.arity();
std::vector<sort> domain;
for(int i = 0; i < arity; i++)
domain.push_back(f.domain(i));
domain.push_back(f.domain(i));
return ctx.function(name.c_str(), arity, &domain[0], f.range());
}
@ -3390,7 +3390,7 @@ namespace Duality {
int arity = f.arity();
std::vector<sort> domain;
for(int i = 0; i < arity; i++)
domain.push_back(f.domain(i));
domain.push_back(f.domain(i));
return ctx.function(name.c_str(), arity, &domain[0], f.range());
}

View file

@ -1136,7 +1136,6 @@ namespace Duality {
}
}
Node *CreateUnderapproxNode(Node *node){
// cex.get_tree()->ComputeUnderapprox(cex.get_root(),0);
RPFP::Node *under_node = CreateNodeInstance(node->map /* ,StratifiedLeafCount-- */);
@ -2250,7 +2249,7 @@ namespace Duality {
throw "stacks out of sync!";
reporter->Depth(stack.size());
// res = tree->Solve(top, 1); // incremental solve, keep interpolants for one pop
// res = tree->Solve(top, 1); // incremental solve, keep interpolants for one pop
check_result foo = Check();
res = foo == unsat ? l_false : l_true;
@ -2424,8 +2423,8 @@ namespace Duality {
hash_set<Node *> leaves_to_remove;
for(unsigned i = 0; i < expansions.size(); i++){
Node *node = expansions[i];
// if(node != top)
// tree->ConstrainParent(node->Incoming[0],node);
// if(node != top)
//tree->ConstrainParent(node->Incoming[0],node);
std::vector<Node *> &cs = node->Outgoing->Children;
for(unsigned i = 0; i < cs.size(); i++){
leaves_to_remove.insert(cs[i]);
@ -3467,7 +3466,7 @@ namespace Duality {
dnode->Bound.Formula = bound_fmla;
}
db_saved_bounds.push_back(bound_fmla);
// dnode->Annotation.Formula = ctx.make(And,node->Annotation.Formula,ctx.make(Geq,dvar,ctx.int_val(0)));
// dnode->Annotation.Formula = ctx.make(And,node->Annotation.Formula,ctx.make(Geq,dvar,ctx.int_val(0)));
}
for(unsigned i = 0; i < rpfp->edges.size(); i++){
Edge *edge = rpfp->edges[i];

View file

@ -727,7 +727,7 @@ namespace Duality {
if(!started){
sw.start();
started = true;
}
}
return sw.get_current_seconds();
}

View file

@ -292,14 +292,14 @@ bool iz3base::is_sat(const std::vector<ast> &q, ast &_proof, std::vector<ast> &v
void iz3base::find_children(const stl_ext::hash_set<ast> &cnsts_set,
const ast &tree,
std::vector<ast> &cnsts,
std::vector<int> &parents,
std::vector<ast> &conjuncts,
std::vector<int> &children,
std::vector<int> &pos_map,
bool merge
){
const ast &tree,
std::vector<ast> &cnsts,
std::vector<int> &parents,
std::vector<ast> &conjuncts,
std::vector<int> &children,
std::vector<int> &pos_map,
bool merge
){
std::vector<int> my_children;
std::vector<ast> my_conjuncts;
if(op(tree) == Interp){ // if we've hit an interpolation position...
@ -336,13 +336,13 @@ void iz3base::find_children(const stl_ext::hash_set<ast> &cnsts_set,
}
void iz3base::to_parents_vec_representation(const std::vector<ast> &_cnsts,
const ast &tree,
std::vector<ast> &cnsts,
std::vector<int> &parents,
std::vector<ast> &theory,
std::vector<int> &pos_map,
bool merge
){
const ast &tree,
std::vector<ast> &cnsts,
std::vector<int> &parents,
std::vector<ast> &theory,
std::vector<int> &pos_map,
bool merge
){
std::vector<int> my_children;
std::vector<ast> my_conjuncts;
hash_set<ast> cnsts_set;

View file

@ -192,35 +192,35 @@ std::vector<T> to_std_vector(const ::vector<T> &v){
bool iz3check(ast_manager &_m_manager,
solver *s,
std::ostream &err,
const ptr_vector<ast> &cnsts,
const ::vector<int> &parents,
const ptr_vector<ast> &interps,
const ptr_vector<ast> &theory)
solver *s,
std::ostream &err,
const ptr_vector<ast> &cnsts,
const ::vector<int> &parents,
const ptr_vector<ast> &interps,
const ptr_vector<ast> &theory)
{
iz3checker chk(_m_manager);
return chk.check(s,err,chk.cook(cnsts),to_std_vector(parents),chk.cook(interps),chk.cook(theory));
}
bool iz3check(iz3mgr &mgr,
solver *s,
std::ostream &err,
const std::vector<iz3mgr::ast> &cnsts,
const std::vector<int> &parents,
const std::vector<iz3mgr::ast> &interps,
const std::vector<iz3mgr::ast> &theory)
solver *s,
std::ostream &err,
const std::vector<iz3mgr::ast> &cnsts,
const std::vector<int> &parents,
const std::vector<iz3mgr::ast> &interps,
const std::vector<iz3mgr::ast> &theory)
{
iz3checker chk(mgr);
return chk.check(s,err,cnsts,parents,interps,theory);
}
bool iz3check(ast_manager &_m_manager,
solver *s,
std::ostream &err,
const ptr_vector<ast> &_cnsts,
ast *tree,
const ptr_vector<ast> &interps)
solver *s,
std::ostream &err,
const ptr_vector<ast> &_cnsts,
ast *tree,
const ptr_vector<ast> &interps)
{
iz3checker chk(_m_manager);
return chk.check(s,err,chk.cook(_cnsts),chk.cook(tree),chk.cook(interps));

View file

@ -420,12 +420,12 @@ public:
void iz3interpolate(ast_manager &_m_manager,
ast *proof,
const ptr_vector<ast> &cnsts,
const ::vector<int> &parents,
ptr_vector<ast> &interps,
const ptr_vector<ast> &theory,
interpolation_options_struct * options)
ast *proof,
const ptr_vector<ast> &cnsts,
const ::vector<int> &parents,
ptr_vector<ast> &interps,
const ptr_vector<ast> &theory,
interpolation_options_struct * options)
{
iz3interp itp(_m_manager);
if(options)
@ -448,12 +448,12 @@ void iz3interpolate(ast_manager &_m_manager,
}
void iz3interpolate(ast_manager &_m_manager,
ast *proof,
const ::vector<ptr_vector<ast> > &cnsts,
const ::vector<int> &parents,
ptr_vector<ast> &interps,
const ptr_vector<ast> &theory,
interpolation_options_struct * options)
ast *proof,
const ::vector<ptr_vector<ast> > &cnsts,
const ::vector<int> &parents,
ptr_vector<ast> &interps,
const ptr_vector<ast> &theory,
interpolation_options_struct * options)
{
iz3interp itp(_m_manager);
if(options)
@ -477,11 +477,11 @@ void iz3interpolate(ast_manager &_m_manager,
}
void iz3interpolate(ast_manager &_m_manager,
ast *proof,
const ptr_vector<ast> &cnsts,
ast *tree,
ptr_vector<ast> &interps,
interpolation_options_struct * options)
ast *proof,
const ptr_vector<ast> &cnsts,
ast *tree,
ptr_vector<ast> &interps,
interpolation_options_struct * options)
{
iz3interp itp(_m_manager);
if(options)
@ -506,12 +506,12 @@ void iz3interpolate(ast_manager &_m_manager,
}
lbool iz3interpolate(ast_manager &_m_manager,
solver &s,
ast *tree,
ptr_vector<ast> &cnsts,
ptr_vector<ast> &interps,
model_ref &m,
interpolation_options_struct * options)
solver &s,
ast *tree,
ptr_vector<ast> &cnsts,
ptr_vector<ast> &interps,
model_ref &m,
interpolation_options_struct * options)
{
iz3interp itp(_m_manager);
if(options)

View file

@ -107,9 +107,9 @@ public:
};
void iz3pp(ast_manager &m,
const ptr_vector<expr> &cnsts_vec,
expr *tree,
std::ostream& out) {
const ptr_vector<expr> &cnsts_vec,
expr *tree,
std::ostream& out) {
unsigned sz = cnsts_vec.size();
expr* const* cnsts = &cnsts_vec[0];

View file

@ -778,7 +778,7 @@ class iz3proof_itp_impl : public iz3proof_itp {
sum_cond_ineq(ineq2,make_int("1"),yleqx,Aproves2,Bproves2);
ast Bcond = my_implies(Bproves1,my_and(Aproves1,z3_simplify(ineq2)));
// if(!is_true(Aproves1) || !is_true(Bproves1))
// std::cout << "foo!\n";;
// std::cout << "foo!\n";;
if(y == make_int(rational(0)) && op(x) == Plus && num_args(x) == 2){
if(get_term_type(arg(x,0)) == LitA){
ast iter = z3_simplify(make(Plus,arg(x,0),get_ineq_rhs(xleqy)));
@ -2784,7 +2784,7 @@ class iz3proof_itp_impl : public iz3proof_itp {
}
else if(o == Plus || o == Times){ // don't want bound variables inside arith ops
// std::cout << "WARNING: non-local arithmetic\n";
// frng = erng; // this term will be localized
// frng = erng; // this term will be localized
}
else if(o == Select){ // treat the array term like a function symbol
prover::range srng = pv->ast_scope(arg(e,0));

View file

@ -612,7 +612,7 @@ public:
rng = range_glb(rng,ast_scope(lit));
}
if(range_is_empty(rng)) return -1;
int hi = range_max(rng);
int hi = range_max(rng);
if(hi >= frames) return frames - 1;
return hi;
}
@ -2003,10 +2003,10 @@ public:
}
iz3translation_full(iz3mgr &mgr,
iz3secondary *_secondary,
iz3secondary *_secondary,
const std::vector<std::vector<ast> > &cnsts,
const std::vector<int> &parents,
const std::vector<ast> &theory)
const std::vector<int> &parents,
const std::vector<ast> &theory)
: iz3translation(mgr, cnsts, parents, theory)
{
frames = cnsts.size();
@ -2027,10 +2027,10 @@ public:
#ifdef IZ3_TRANSLATE_FULL
iz3translation *iz3translation::create(iz3mgr &mgr,
iz3secondary *secondary,
const std::vector<std::vector<ast> > &cnsts,
const std::vector<int> &parents,
const std::vector<ast> &theory){
iz3secondary *secondary,
const std::vector<std::vector<ast> > &cnsts,
const std::vector<int> &parents,
const std::vector<ast> &theory){
return new iz3translation_full(mgr,secondary,cnsts,parents,theory);
}

View file

@ -589,7 +589,7 @@ public:
rng = range_glb(rng,ast_scope(lit));
}
if(range_is_empty(rng)) return -1;
int hi = range_max(rng);
int hi = range_max(rng);
if(hi >= frames) return frames - 1;
return hi;
}
@ -881,7 +881,7 @@ public:
|| dk == PR_QUANT_INST
//|| dk == PR_UNIT_RESOLUTION
//|| dk == PR_LEMMA
)
)
return false;
if(dk == PR_HYPOTHESIS && hyps.find(con) != hyps.end())
; //std::cout << "blif!\n";

View file

@ -584,7 +584,7 @@ namespace datalog {
m_rule_properties.check_existential_tail();
m_rule_properties.check_for_negated_predicates();
break;
case DUALITY_ENGINE:
case DUALITY_ENGINE:
m_rule_properties.collect(r);
m_rule_properties.check_existential_tail();
m_rule_properties.check_for_negated_predicates();
@ -986,12 +986,12 @@ namespace datalog {
}
}
void context::get_raw_rule_formulas(expr_ref_vector& rules, svector<symbol>& names, vector<unsigned> &bounds){
void context::get_raw_rule_formulas(expr_ref_vector& rules, svector<symbol>& names, vector<unsigned> &bounds) {
for (unsigned i = 0; i < m_rule_fmls.size(); ++i) {
expr_ref r = bind_vars(m_rule_fmls[i].get(), true);
rules.push_back(r.get());
names.push_back(m_rule_names[i]);
bounds.push_back(m_rule_bounds[i]);
expr_ref r = bind_vars(m_rule_fmls[i].get(), true);
rules.push_back(r.get());
names.push_back(m_rule_names[i]);
bounds.push_back(m_rule_bounds[i]);
}
}

View file

@ -329,7 +329,7 @@ int main(int argc, char ** argv) {
g_input_kind = IN_SMTLIB;
}
}
}
}
switch (g_input_kind) {
case IN_SMTLIB:
return_value = read_smtlib_file(g_input_file);

View file

@ -336,17 +336,17 @@ void mpz_manager<SYNCH>::set(mpz & target, unsigned sz, digit_t const * digits)
}
}
#else
mk_big(target);
// reset
mpz_set_ui(*target.m_ptr, digits[sz - 1]);
SASSERT(sz > 0);
unsigned i = sz - 1;
while (i > 0) {
--i;
mpz_mul_2exp(*target.m_ptr, *target.m_ptr, 32);
mpz_set_ui(m_tmp, digits[i]);
mpz_add(*target.m_ptr, *target.m_ptr, m_tmp);
}
mk_big(target);
// reset
mpz_set_ui(*target.m_ptr, digits[sz - 1]);
SASSERT(sz > 0);
unsigned i = sz - 1;
while (i > 0) {
--i;
mpz_mul_2exp(*target.m_ptr, *target.m_ptr, 32);
mpz_set_ui(m_tmp, digits[i]);
mpz_add(*target.m_ptr, *target.m_ptr, m_tmp);
}
#endif
}
}
@ -2037,16 +2037,16 @@ bool mpz_manager<SYNCH>::decompose(mpz const & a, svector<digit_t> & digits) {
}
return a.m_val < 0;
#else
bool r = is_neg(a);
mpz_set(m_tmp, *a.m_ptr);
mpz_abs(m_tmp, m_tmp);
while (mpz_sgn(m_tmp) != 0) {
mpz_tdiv_r_2exp(m_tmp2, m_tmp, 32);
unsigned v = mpz_get_ui(m_tmp2);
digits.push_back(v);
mpz_tdiv_q_2exp(m_tmp, m_tmp, 32);
}
return r;
bool r = is_neg(a);
mpz_set(m_tmp, *a.m_ptr);
mpz_abs(m_tmp, m_tmp);
while (mpz_sgn(m_tmp) != 0) {
mpz_tdiv_r_2exp(m_tmp2, m_tmp, 32);
unsigned v = mpz_get_ui(m_tmp2);
digits.push_back(v);
mpz_tdiv_q_2exp(m_tmp, m_tmp, 32);
}
return r;
#endif
}
}