3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-19 10:52:02 +00:00

refining model update rules for del_rule #5865 #5866

This commit is contained in:
Nikolaj Bjorner 2022-02-25 08:03:46 -08:00
parent 30a2f2fd9d
commit 7f149a36d7
3 changed files with 19 additions and 13 deletions

View file

@ -281,14 +281,19 @@ namespace datalog {
return get_max_var(has_var);
}
void del_rule(horn_subsume_model_converter* mc, rule& r, bool unreachable) {
void del_rule(horn_subsume_model_converter* mc, rule& r, lbool unreachable) {
if (mc) {
ast_manager& m = mc->get_manager();
expr_ref_vector body(m);
if (unreachable) {
TRACE("dl", tout << "unreachable: " << unreachable << " " << r.get_decl()->get_name() << "\n");
switch (unreachable) {
case l_true:
body.push_back(m.mk_true());
}
else {
break;
case l_false:
body.push_back(m.mk_false());
break;
default:
for (unsigned i = 0; i < r.get_tail_size(); ++i) {
if (r.is_neg_tail(i)) {
body.push_back(m.mk_not(r.get_tail(i)));
@ -297,11 +302,12 @@ namespace datalog {
body.push_back(r.get_tail(i));
}
}
break;
}
TRACE("dl_dr",
TRACE("dl",
tout << mk_pp(r.get_head(), m) << " :- \n";
for (unsigned i = 0; i < body.size(); ++i) {
tout << mk_pp(body[i].get(), m) << "\n";
tout << mk_pp(body.get(i), m) << "\n";
});
mc->insert(r.get_head(), body.size(), body.data());