mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
updated include directives
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
aefed78f1a
commit
2b82fd5d0c
87 changed files with 209 additions and 216 deletions
|
@ -27,7 +27,7 @@ Revision History:
|
|||
#include "ast/ast_smt2_pp.h"
|
||||
#include "ast/datatype_decl_plugin.h"
|
||||
#include "ast/scoped_proof.h"
|
||||
#include"fixedpoint_params.hpp"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
#include "ast/ast_pp_util.h"
|
||||
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ Revision History:
|
|||
#include "muz/transforms/dl_mk_rule_inliner.h"
|
||||
#include "ast/scoped_proof.h"
|
||||
|
||||
#include "fixedpoint_params.hpp"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
|
||||
namespace datalog {
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include "ast/expr_abstract.h"
|
||||
#include "model/model_smt2_pp.h"
|
||||
#include "model/model_v2_pp.h"
|
||||
#include "fixedpoint_params.hpp"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
#include "ast/used_vars.h"
|
||||
#include "ast/func_decl_dependencies.h"
|
||||
#include "muz/transforms/dl_transforms.h"
|
||||
|
|
|
@ -30,7 +30,7 @@ Notes:
|
|||
#include "util/scoped_ctrl_c.h"
|
||||
#include "util/scoped_timer.h"
|
||||
#include "util/trail.h"
|
||||
#include"fixedpoint_params.hpp"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
#include<iomanip>
|
||||
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ Revision History:
|
|||
#include "muz/transforms/dl_mk_slice.h"
|
||||
#include "tactic/filter_model_converter.h"
|
||||
#include "muz/transforms/dl_transforms.h"
|
||||
#include"fixedpoint_params.hpp"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
#include "ast/ast_util.h"
|
||||
#include "ast/rewriter/var_subst.h"
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ Revision History:
|
|||
#include "muz/pdr/pdr_manager.h"
|
||||
#include "muz/pdr/pdr_prop_solver.h"
|
||||
#include "muz/pdr/pdr_reachable_cache.h"
|
||||
#include "fixedpoint_params.hpp"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
|
||||
|
||||
namespace datalog {
|
||||
|
|
|
@ -32,7 +32,7 @@ Notes:
|
|||
#include "muz/spacer/spacer_manager.h"
|
||||
#include "muz/spacer/spacer_prop_solver.h"
|
||||
|
||||
#include "fixedpoint_params.hpp"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
|
||||
namespace datalog {
|
||||
class rule_set;
|
||||
|
@ -174,7 +174,7 @@ class pred_transformer {
|
|||
};
|
||||
|
||||
/// manager of the lemmas in all the frames
|
||||
#include "spacer_legacy_frames.h"
|
||||
#include "muz/spacer/spacer_legacy_frames.h"
|
||||
class frames {
|
||||
private:
|
||||
pred_transformer &m_pt;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "muz/base/dl_rule_set.h"
|
||||
#include "smt/tactic/unit_subsumption_tactic.h"
|
||||
#include "model/model_smt2_pp.h"
|
||||
#include "dl_mk_rule_inliner.h"
|
||||
#include "muz/transforms/dl_mk_rule_inliner.h"
|
||||
#include "ast/ast_smt2_pp.h"
|
||||
#include "ast/ast_ll_pp.h"
|
||||
#include "ast/ast_util.h"
|
||||
|
|
|
@ -22,7 +22,7 @@ Copyright (c) 2017 Arie Gurfinkel
|
|||
#include "muz/spacer/spacer_manager.h"
|
||||
#include "muz/spacer/spacer_legacy_mev.h"
|
||||
#include "muz/spacer/spacer_util.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/rewriter/expr_replacer.h"
|
||||
#include "model/model_smt2_pp.h"
|
||||
#include "ast/scoped_proof.h"
|
||||
|
|
|
@ -15,7 +15,7 @@ Revision History:
|
|||
|
||||
--*/
|
||||
#include"model/model.h"
|
||||
#include"model_evaluator_params.hpp"
|
||||
#include "model/model_evaluator_params.hpp"
|
||||
#include"ast/rewriter/rewriter_types.h"
|
||||
#include"model/model_evaluator.h"
|
||||
#include"muz/spacer/spacer_mev_array.h"
|
||||
|
|
|
@ -35,7 +35,7 @@ Revision History:
|
|||
#include "muz/spacer/spacer_farkas_learner.h"
|
||||
#include "muz/spacer/spacer_prop_solver.h"
|
||||
|
||||
#include "fixedpoint_params.hpp"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
|
||||
namespace spacer {
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ Revision History:
|
|||
#include "ast/for_each_expr.h"
|
||||
#include "ast/substitution/matcher.h"
|
||||
#include "ast/scoped_proof.h"
|
||||
#include "fixedpoint_params.hpp"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
#include "ast/ast_util.h"
|
||||
|
||||
namespace tb {
|
||||
|
|
|
@ -15,126 +15,111 @@ Revision History:
|
|||
|
||||
--*/
|
||||
|
||||
|
||||
#include "dl_mk_array_eq_rewrite.h"
|
||||
#include "dl_context.h"
|
||||
#include "pattern_inference.h"
|
||||
#include "dl_context.h"
|
||||
#include "expr_safe_replace.h"
|
||||
#include "expr_abstract.h"
|
||||
#include"fixedpoint_params.hpp"
|
||||
#include "ast/pattern/pattern_inference.h"
|
||||
#include "ast/rewriter/expr_safe_replace.h"
|
||||
#include "ast/expr_abstract.h"
|
||||
#include "muz/base/dl_context.h"
|
||||
#include "muz/base/dl_context.h"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
#include "muz/transforms/dl_mk_array_eq_rewrite.h"
|
||||
#include "../spacer/obj_equiv_class.h"
|
||||
|
||||
// NSB code review: avoid dependency on spacer inside this directory.
|
||||
// The python build system will rightfully complain if you include
|
||||
// "muz/spacer/obj_equiv_class.h".
|
||||
|
||||
namespace datalog {
|
||||
|
||||
mk_array_eq_rewrite::mk_array_eq_rewrite(
|
||||
mk_array_eq_rewrite::mk_array_eq_rewrite(
|
||||
context & ctx, unsigned priority):
|
||||
plugin(priority),
|
||||
m(ctx.get_manager()),
|
||||
m_ctx(ctx),
|
||||
m_a(m)
|
||||
{
|
||||
}
|
||||
|
||||
rule_set * mk_array_eq_rewrite::operator()(rule_set const & source)
|
||||
{
|
||||
src_set = &source;
|
||||
rule_set * result = alloc(rule_set, m_ctx);
|
||||
result->inherit_predicates(source);
|
||||
dst=result;
|
||||
unsigned nbrules = source.get_num_rules();
|
||||
src_manager = &source.get_rule_manager();
|
||||
for(unsigned i =0;i<nbrules;i++)
|
||||
{
|
||||
rule & r = *source.get_rule(i);
|
||||
instantiate_rule(r, *result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void mk_array_eq_rewrite::instantiate_rule(const rule& r, rule_set & dest)
|
||||
{
|
||||
//Reset everything
|
||||
cnt = src_manager->get_counter().get_max_rule_var(r)+1;
|
||||
|
||||
|
||||
expr_ref_vector new_tail(m);
|
||||
unsigned nb_predicates = r.get_uninterpreted_tail_size();
|
||||
unsigned tail_size = r.get_tail_size();
|
||||
for(unsigned i=0;i<nb_predicates;i++)
|
||||
{
|
||||
new_tail.push_back(r.get_tail(i));
|
||||
}
|
||||
|
||||
spacer::expr_equiv_class array_eq_classes(m);
|
||||
for(unsigned i=nb_predicates;i<tail_size;i++)
|
||||
rule_set * mk_array_eq_rewrite::operator()(rule_set const & source)
|
||||
{
|
||||
expr* cond = r.get_tail(i);
|
||||
expr* e1, *e2;
|
||||
if(m.is_eq(cond, e1, e2) && m_a.is_array(get_sort(e1)))
|
||||
{
|
||||
array_eq_classes.merge(e1, e2);
|
||||
}
|
||||
else
|
||||
{
|
||||
new_tail.push_back(cond);
|
||||
}
|
||||
}
|
||||
|
||||
for(spacer::expr_equiv_class::equiv_iterator c_eq = array_eq_classes.begin();
|
||||
c_eq != array_eq_classes.end();++c_eq)
|
||||
{
|
||||
expr* representative = *(*c_eq).begin();
|
||||
for(spacer::expr_equiv_class::iterator it = (*c_eq).begin();
|
||||
it!=(*c_eq).end(); ++it)
|
||||
{
|
||||
if(!is_var(*it))
|
||||
{
|
||||
representative = *it;
|
||||
break;
|
||||
m_src_set = &source;
|
||||
rule_set * result = alloc(rule_set, m_ctx);
|
||||
result->inherit_predicates(source);
|
||||
m_dst = result;
|
||||
m_src_manager = &source.get_rule_manager();
|
||||
for (rule * rp : source) {
|
||||
instantiate_rule(*rp, *result);
|
||||
}
|
||||
}
|
||||
for(spacer::expr_equiv_class::iterator it = (*c_eq).begin();
|
||||
it!=(*c_eq).end(); ++it)
|
||||
{
|
||||
for(unsigned i=0;i<new_tail.size();i++)
|
||||
new_tail[i] = replace(new_tail[i].get(), representative, *it);
|
||||
}
|
||||
for(spacer::expr_equiv_class::iterator it = (*c_eq).begin();
|
||||
it!=(*c_eq).end(); ++it)
|
||||
{
|
||||
new_tail.push_back(m.mk_eq(*it, representative));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
params_ref select_over_store;
|
||||
select_over_store.set_bool("expand_select_store", true);
|
||||
th_rewriter t(m, select_over_store);
|
||||
expr_ref_vector res_conjs(m);
|
||||
for(unsigned i=0;i<new_tail.size();i++)
|
||||
{
|
||||
expr_ref tmp(m);
|
||||
t(new_tail[i].get(), tmp);
|
||||
res_conjs.push_back(tmp);
|
||||
}
|
||||
proof_ref pr(m);
|
||||
src_manager->mk_rule(m.mk_implies(m.mk_and(res_conjs.size(), res_conjs.c_ptr()), r.get_head()), pr, dest, r.name());
|
||||
}
|
||||
|
||||
expr* mk_array_eq_rewrite::replace(expr* e, expr* new_val, expr* old_val)
|
||||
{
|
||||
if(e==old_val)
|
||||
return new_val;
|
||||
else if(!is_app(e))
|
||||
void mk_array_eq_rewrite::instantiate_rule(const rule& r, rule_set & dest)
|
||||
{
|
||||
return e;
|
||||
//Reset everything
|
||||
m_cnt = m_src_manager->get_counter().get_max_rule_var(r)+1;
|
||||
|
||||
|
||||
expr_ref_vector new_tail(m);
|
||||
unsigned nb_predicates = r.get_uninterpreted_tail_size();
|
||||
unsigned tail_size = r.get_tail_size();
|
||||
for (unsigned i = 0; i < nb_predicates; i++) {
|
||||
new_tail.push_back(r.get_tail(i));
|
||||
}
|
||||
|
||||
spacer::expr_equiv_class array_eq_classes(m);
|
||||
for(unsigned i = nb_predicates; i < tail_size; i++) {
|
||||
expr* cond = r.get_tail(i);
|
||||
expr* e1, *e2;
|
||||
if (m.is_eq(cond, e1, e2) && m_a.is_array(get_sort(e1))) {
|
||||
array_eq_classes.merge(e1, e2);
|
||||
}
|
||||
else {
|
||||
new_tail.push_back(cond);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto & c_eq : array_eq_classes) {
|
||||
expr* representative = *(c_eq.begin());
|
||||
for (expr * v : c_eq) {
|
||||
if (!is_var(v)) {
|
||||
representative = v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (expr * v : c_eq) {
|
||||
for (unsigned i = 0; i < new_tail.size(); i++)
|
||||
new_tail[i] = replace(new_tail[i].get(), representative, v);
|
||||
}
|
||||
for (expr * v : c_eq) {
|
||||
new_tail.push_back(m.mk_eq(v, representative));
|
||||
}
|
||||
}
|
||||
params_ref select_over_store;
|
||||
select_over_store.set_bool("expand_select_store", true);
|
||||
th_rewriter t(m, select_over_store);
|
||||
expr_ref_vector res_conjs(m);
|
||||
for (expr* e : new_tail) {
|
||||
expr_ref tmp(m);
|
||||
t(e, tmp);
|
||||
res_conjs.push_back(tmp);
|
||||
}
|
||||
proof_ref pr(m);
|
||||
m_src_manager->mk_rule(m.mk_implies(m.mk_and(res_conjs.size(), res_conjs.c_ptr()), r.get_head()), pr, dest, r.name());
|
||||
}
|
||||
app*f = to_app(e);
|
||||
ptr_vector<expr> n_args;
|
||||
for(unsigned i=0;i<f->get_num_args();i++)
|
||||
|
||||
// NSB Code review: use substitution facility, such as expr_safe_replace or expr_replacer.
|
||||
expr* mk_array_eq_rewrite::replace(expr* e, expr* new_val, expr* old_val)
|
||||
{
|
||||
n_args.push_back(replace(f->get_arg(i), new_val, old_val));
|
||||
if (e == old_val)
|
||||
return new_val;
|
||||
else if (!is_app(e)) {
|
||||
return e;
|
||||
}
|
||||
app* f = to_app(e);
|
||||
ptr_vector<expr> n_args;
|
||||
for (expr * arg : *f) {
|
||||
n_args.push_back(replace(arg, new_val, old_val));
|
||||
}
|
||||
return m.mk_app(f->get_decl(), n_args.size(), n_args.c_ptr());
|
||||
}
|
||||
return m.mk_app(f->get_decl(), n_args.size(), n_args.c_ptr());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ Revision History:
|
|||
#define DL_MK_ARRAY_EQ_REWRITE_H_
|
||||
|
||||
|
||||
#include "dl_rule_transformer.h"
|
||||
#include "muz/base/dl_rule_transformer.h"
|
||||
#include "../spacer/obj_equiv_class.h"
|
||||
|
||||
namespace datalog {
|
||||
|
@ -29,13 +29,13 @@ namespace datalog {
|
|||
//Context objects
|
||||
ast_manager& m;
|
||||
context& m_ctx;
|
||||
array_util m_a;
|
||||
array_util m_a;
|
||||
|
||||
//Rule set context
|
||||
const rule_set*src_set;
|
||||
rule_set*dst;
|
||||
rule_manager* src_manager;
|
||||
unsigned cnt;//Index for new variables
|
||||
const rule_set* m_src_set;
|
||||
rule_set* m_dst;
|
||||
rule_manager* m_src_manager;
|
||||
unsigned m_cnt;//Index for new variables
|
||||
|
||||
expr* replace(expr* e, expr* new_val, expr* old_val);
|
||||
void instantiate_rule(const rule& r, rule_set & dest);
|
||||
|
|
|
@ -17,13 +17,13 @@ Revision History:
|
|||
--*/
|
||||
|
||||
|
||||
#include "dl_mk_array_instantiation.h"
|
||||
#include "dl_context.h"
|
||||
#include "pattern_inference.h"
|
||||
#include "dl_context.h"
|
||||
#include "expr_safe_replace.h"
|
||||
#include "expr_abstract.h"
|
||||
#include"fixedpoint_params.hpp"
|
||||
#include "muz/transforms/dl_mk_array_instantiation.h"
|
||||
#include "muz/base/dl_context.h"
|
||||
#include "ast/pattern/pattern_inference.h"
|
||||
#include "muz/base/dl_context.h"
|
||||
#include "ast/rewriter/expr_safe_replace.h"
|
||||
#include "ast/expr_abstract.h"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
#include "../spacer/obj_equiv_class.h"
|
||||
|
||||
namespace datalog {
|
||||
|
|
|
@ -70,7 +70,7 @@ Revision History:
|
|||
#define DL_MK_ARRAY_INSTANTIATION_H_
|
||||
|
||||
|
||||
#include "dl_rule_transformer.h"
|
||||
#include "muz/base/dl_rule_transformer.h"
|
||||
#include "../spacer/obj_equiv_class.h"
|
||||
|
||||
namespace datalog {
|
||||
|
|
|
@ -24,7 +24,7 @@ Revision History:
|
|||
#include "ast/rewriter/expr_safe_replace.h"
|
||||
#include "tactic/filter_model_converter.h"
|
||||
#include "muz/transforms/dl_mk_interp_tail_simplifier.h"
|
||||
#include "fixedpoint_params.hpp"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
#include "ast/scoped_proof.h"
|
||||
#include "model/model_v2_pp.h"
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ Revision History:
|
|||
#include "muz/transforms/dl_mk_interp_tail_simplifier.h"
|
||||
#include "ast/ast_util.h"
|
||||
|
||||
#include "fixedpoint_params.hpp"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
namespace datalog {
|
||||
|
||||
// -----------------------------------
|
||||
|
|
|
@ -23,7 +23,7 @@ Revision History:
|
|||
#include "muz/base/dl_context.h"
|
||||
#include "ast/rewriter/expr_safe_replace.h"
|
||||
#include "ast/expr_abstract.h"
|
||||
#include"fixedpoint_params.hpp"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
|
||||
|
||||
namespace datalog {
|
||||
|
|
|
@ -52,7 +52,7 @@ Subsumption transformation (remove rule):
|
|||
#include "ast/rewriter/rewriter.h"
|
||||
#include "ast/rewriter/rewriter_def.h"
|
||||
#include "muz/transforms/dl_mk_rule_inliner.h"
|
||||
#include "fixedpoint_params.hpp"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
|
||||
namespace datalog {
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ Revision History:
|
|||
|
||||
#include "muz/transforms/dl_mk_scale.h"
|
||||
#include "muz/base/dl_context.h"
|
||||
#include"fixedpoint_params.hpp"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
|
||||
namespace datalog {
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ Revision History:
|
|||
#include "ast/rewriter/rewriter_def.h"
|
||||
#include "muz/transforms/dl_mk_subsumption_checker.h"
|
||||
|
||||
#include "fixedpoint_params.hpp"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
namespace datalog {
|
||||
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ Revision History:
|
|||
#include "muz/transforms/dl_mk_scale.h"
|
||||
#include "muz/transforms/dl_mk_array_eq_rewrite.h"
|
||||
#include "muz/transforms/dl_mk_array_instantiation.h"
|
||||
#include "fixedpoint_params.hpp"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
|
||||
namespace datalog {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue