3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-09-05 17:47:41 +00:00

fix overflow and integrality bugs reported by Phan

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-12-15 16:18:09 -08:00
parent f4dfb9ac82
commit ae3d16bc50
6 changed files with 32 additions and 23 deletions

View file

@ -26,7 +26,7 @@ Notes:
using namespace datalog;
rule_properties::rule_properties(ast_manager & m, rule_manager& rm, context& ctx, i_expr_pred& p):
m(m), rm(rm), m_ctx(ctx), m_is_predicate(p), m_dt(m), m_generate_proof(false) {}
m(m), rm(rm), m_ctx(ctx), m_is_predicate(p), m_dt(m), m_dl(m), m_generate_proof(false) {}
rule_properties::~rule_properties() {}
@ -168,7 +168,7 @@ void rule_properties::operator()(app* n) {
if (m_is_predicate(n)) {
insert(m_interp_pred, m_rule);
}
else if (is_uninterp(n)) {
else if (is_uninterp(n) && !m_dl.is_rule_sort(n->get_decl()->get_range())) {
m_uninterp_funs.insert(n->get_decl(), m_rule);
}
else if (m_dt.is_accessor(n)) {

View file

@ -32,6 +32,7 @@ namespace datalog {
context& m_ctx;
i_expr_pred& m_is_predicate;
datatype_util m_dt;
dl_decl_util m_dl;
bool m_generate_proof;
rule* m_rule;
obj_map<quantifier, rule*> m_quantifiers;

View file

@ -434,6 +434,7 @@ namespace datalog {
relation_union_fn * explanation_relation_plugin::mk_union_fn(const relation_base & tgt, const relation_base & src,
const relation_base * delta) {
std::cout << "check kind: " << check_kind(tgt) << "\n";
if (!check_kind(tgt) || (delta && !check_kind(*delta))) {
return 0;
}
@ -854,7 +855,10 @@ namespace datalog {
scoped_ptr<relation_join_fn> product_fun = rmgr.mk_join_fn(orig_rel, *m_e_fact_relation, 0, 0, 0);
SASSERT(product_fun);
scoped_rel<relation_base> aux_extended_rel = (*product_fun)(orig_rel, *m_e_fact_relation);
TRACE("dl", tout << aux_extended_rel << " " << aux_extended_rel->get_plugin().get_name() << "\n";
tout << e_rel.get_plugin().get_name() << "\n";);
scoped_ptr<relation_union_fn> union_fun = rmgr.mk_union_fn(e_rel, *aux_extended_rel);
TRACE("dl", tout << union_fun << "\n";);
SASSERT(union_fun);
(*union_fun)(e_rel, *aux_extended_rel);
}

View file

@ -45,7 +45,7 @@ namespace datalog {
{}
virtual bool can_handle_signature(const relation_signature & sig) {
return true;
return get_manager().get_context().karr();
}
static symbol get_name() { return symbol("karr_relation"); }

View file

@ -115,7 +115,7 @@ namespace datalog {
rm.register_plugin(alloc(bound_relation_plugin, rm));
rm.register_plugin(alloc(interval_relation_plugin, rm));
rm.register_plugin(alloc(karr_relation_plugin, rm));
if (m_context.karr()) rm.register_plugin(alloc(karr_relation_plugin, rm));
rm.register_plugin(alloc(product_set_plugin, rm));
rm.register_plugin(alloc(udoc_plugin, rm));
rm.register_plugin(alloc(check_relation_plugin, rm));