mirror of
https://github.com/Z3Prover/z3
synced 2025-04-06 01:24:08 +00:00
re-organizing muz
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
add96bc98f
commit
9e61820125
|
@ -57,7 +57,7 @@ def init_project_def():
|
|||
add_lib('muz', ['smt', 'sat', 'smt2parser', 'aig_tactic', 'qe'])
|
||||
add_lib('transforms', ['muz'], 'muz/transforms')
|
||||
add_lib('rel', ['muz', 'transforms'], 'muz/rel')
|
||||
add_lib('pdr', ['muz', 'transforms'], 'muz/pdr')
|
||||
add_lib('pdr', ['muz', 'transforms', 'arith_tactics', 'smt_tactic'], 'muz/pdr')
|
||||
add_lib('clp', ['muz', 'transforms'], 'muz/clp')
|
||||
add_lib('tab', ['muz', 'transforms'], 'muz/tab')
|
||||
add_lib('bmc', ['muz', 'transforms'], 'muz/bmc')
|
||||
|
|
|
@ -31,6 +31,7 @@ Revision History:
|
|||
#include "rewriter_def.h"
|
||||
#include "dl_transforms.h"
|
||||
#include "dl_mk_rule_inliner.h"
|
||||
#include "scoped_proof.h"
|
||||
|
||||
namespace datalog {
|
||||
|
||||
|
|
|
@ -19,8 +19,6 @@ Revision History:
|
|||
|
||||
#include<sstream>
|
||||
#include<limits>
|
||||
#include"arith_simplifier_plugin.h"
|
||||
#include"basic_simplifier_plugin.h"
|
||||
#include"arith_decl_plugin.h"
|
||||
#include"bv_decl_plugin.h"
|
||||
#include"dl_context.h"
|
||||
|
@ -28,6 +26,7 @@ Revision History:
|
|||
#include"ast_smt_pp.h"
|
||||
#include"ast_smt2_pp.h"
|
||||
#include"datatype_decl_plugin.h"
|
||||
#include"scoped_proof.h"
|
||||
|
||||
|
||||
namespace datalog {
|
||||
|
|
|
@ -42,6 +42,7 @@ Revision History:
|
|||
#include"bool_rewriter.h"
|
||||
#include"expr_safe_replace.h"
|
||||
#include"filter_model_converter.h"
|
||||
#include"scoped_proof.h"
|
||||
|
||||
namespace datalog {
|
||||
|
||||
|
|
|
@ -25,9 +25,10 @@ Revision History:
|
|||
#endif
|
||||
#include"ast_pp.h"
|
||||
#include"bool_rewriter.h"
|
||||
#include"for_each_expr.h"
|
||||
#include"scoped_proof.h"
|
||||
#include"dl_context.h"
|
||||
#include"dl_rule.h"
|
||||
#include"for_each_expr.h"
|
||||
#include"dl_util.h"
|
||||
|
||||
namespace datalog {
|
||||
|
|
|
@ -124,36 +124,6 @@ namespace datalog {
|
|||
*/
|
||||
void display_fact(context & ctx, app * f, std::ostream & out);
|
||||
|
||||
class scoped_proof_mode {
|
||||
ast_manager& m;
|
||||
proof_gen_mode m_mode;
|
||||
public:
|
||||
scoped_proof_mode(ast_manager& m, proof_gen_mode mode): m(m) {
|
||||
m_mode = m.proof_mode();
|
||||
m.toggle_proof_mode(mode);
|
||||
}
|
||||
~scoped_proof_mode() {
|
||||
m.toggle_proof_mode(m_mode);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class scoped_proof : public scoped_proof_mode {
|
||||
public:
|
||||
scoped_proof(ast_manager& m): scoped_proof_mode(m, PGM_FINE) {}
|
||||
};
|
||||
|
||||
class scoped_no_proof : public scoped_proof_mode {
|
||||
public:
|
||||
scoped_no_proof(ast_manager& m): scoped_proof_mode(m, PGM_DISABLED) {}
|
||||
};
|
||||
|
||||
class scoped_restore_proof : public scoped_proof_mode {
|
||||
public:
|
||||
scoped_restore_proof(ast_manager& m): scoped_proof_mode(m, m.proof_mode()) {}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class variable_intersection
|
||||
|
|
|
@ -19,11 +19,11 @@ Revision History:
|
|||
|
||||
#include "equiv_proof_converter.h"
|
||||
#include "ast_pp.h"
|
||||
#include "dl_util.h"
|
||||
#include "scoped_proof.h"
|
||||
|
||||
void equiv_proof_converter::insert(expr* fml1, expr* fml2) {
|
||||
if (fml1 != fml2) {
|
||||
datalog::scoped_proof _sp(m);
|
||||
scoped_proof _sp(m);
|
||||
proof_ref p1(m), p2(m), p3(m);
|
||||
p1 = m.mk_asserted(fml1);
|
||||
p2 = m.mk_rewrite(fml1, fml2);
|
||||
|
|
|
@ -46,6 +46,7 @@ Notes:
|
|||
#include "proof_utils.h"
|
||||
#include "dl_boogie_proof.h"
|
||||
#include "qe_util.h"
|
||||
#include "scoped_proof.h"
|
||||
|
||||
namespace pdr {
|
||||
|
||||
|
@ -1719,7 +1720,7 @@ namespace pdr {
|
|||
}
|
||||
|
||||
proof_ref context::get_proof() const {
|
||||
datalog::scoped_proof _sc(m);
|
||||
scoped_proof _sc(m);
|
||||
proof_ref proof(m);
|
||||
SASSERT(m_last_result == l_true);
|
||||
proof = m_search.get_proof_trace(*this);
|
||||
|
@ -1959,7 +1960,7 @@ namespace pdr {
|
|||
void context::create_children(model_node& n) {
|
||||
SASSERT(n.level() > 0);
|
||||
bool use_model_generalizer = m_params.use_model_generalizer();
|
||||
datalog::scoped_no_proof _sc(m);
|
||||
scoped_no_proof _sc(m);
|
||||
|
||||
pred_transformer& pt = n.pt();
|
||||
model_ref M = n.get_model_ptr();
|
||||
|
|
|
@ -31,8 +31,9 @@ Revision History:
|
|||
#include "dl_mk_slice.h"
|
||||
#include "dl_mk_unfold.h"
|
||||
#include "dl_mk_coalesce.h"
|
||||
#include "model_smt2_pp.h"
|
||||
#include "dl_transforms.h"
|
||||
#include "scoped_proof.h"
|
||||
#include "model_smt2_pp.h"
|
||||
|
||||
using namespace pdr;
|
||||
|
||||
|
@ -149,7 +150,7 @@ lbool dl_interface::query(expr * query) {
|
|||
m_ctx.reopen();
|
||||
m_ctx.replace_rules(old_rules);
|
||||
|
||||
datalog::scoped_restore_proof _sc(m); // update_rules may overwrite the proof mode.
|
||||
scoped_restore_proof _sc(m); // update_rules may overwrite the proof mode.
|
||||
|
||||
m_context->set_proof_converter(m_ctx.get_proof_converter());
|
||||
m_context->set_model_converter(m_ctx.get_model_converter());
|
||||
|
|
|
@ -45,6 +45,7 @@ Notes:
|
|||
#include "poly_rewriter.h"
|
||||
#include "poly_rewriter_def.h"
|
||||
#include "arith_rewriter.h"
|
||||
#include "scoped_proof.h"
|
||||
|
||||
|
||||
|
||||
|
@ -1072,7 +1073,7 @@ namespace pdr {
|
|||
|
||||
void hoist_non_bool_if(expr_ref& fml) {
|
||||
ast_manager& m = fml.get_manager();
|
||||
datalog::scoped_no_proof _sp(m);
|
||||
scoped_no_proof _sp(m);
|
||||
params_ref p;
|
||||
ite_hoister_star ite_rw(m, p);
|
||||
expr_ref tmp(m);
|
||||
|
@ -1419,7 +1420,7 @@ namespace pdr {
|
|||
|
||||
void normalize_arithmetic(expr_ref& t) {
|
||||
ast_manager& m = t.get_manager();
|
||||
datalog::scoped_no_proof _sp(m);
|
||||
scoped_no_proof _sp(m);
|
||||
params_ref p;
|
||||
arith_normalizer_star rw(m, p);
|
||||
expr_ref tmp(m);
|
||||
|
|
55
src/muz/scoped_proof.h
Normal file
55
src/muz/scoped_proof.h
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*++
|
||||
Copyright (c) 2013 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
scoped_proof.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Scoped proof environments. Toggles enabling proofs.
|
||||
|
||||
Author:
|
||||
|
||||
Nikolaj Bjorner (nbjorner) 2013-08-28
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
#ifndef _SCOPED_PROOF__H_
|
||||
#define _SCOPED_PROOF_H_
|
||||
|
||||
#include "ast.h"
|
||||
|
||||
class scoped_proof_mode {
|
||||
ast_manager& m;
|
||||
proof_gen_mode m_mode;
|
||||
public:
|
||||
scoped_proof_mode(ast_manager& m, proof_gen_mode mode): m(m) {
|
||||
m_mode = m.proof_mode();
|
||||
m.toggle_proof_mode(mode);
|
||||
}
|
||||
~scoped_proof_mode() {
|
||||
m.toggle_proof_mode(m_mode);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class scoped_proof : public scoped_proof_mode {
|
||||
public:
|
||||
scoped_proof(ast_manager& m): scoped_proof_mode(m, PGM_FINE) {}
|
||||
};
|
||||
|
||||
class scoped_no_proof : public scoped_proof_mode {
|
||||
public:
|
||||
scoped_no_proof(ast_manager& m): scoped_proof_mode(m, PGM_DISABLED) {}
|
||||
};
|
||||
|
||||
class scoped_restore_proof : public scoped_proof_mode {
|
||||
public:
|
||||
scoped_restore_proof(ast_manager& m): scoped_proof_mode(m, m.proof_mode()) {}
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -29,6 +29,7 @@ Revision History:
|
|||
#include "datatype_decl_plugin.h"
|
||||
#include "for_each_expr.h"
|
||||
#include "matcher.h"
|
||||
#include "scoped_proof.h"
|
||||
|
||||
namespace tb {
|
||||
|
||||
|
|
Loading…
Reference in a new issue