3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 20:05:51 +00:00

add rule unfolding transformation

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2012-10-15 15:34:29 -07:00
parent 2c24f25050
commit d16db63e56
13 changed files with 160 additions and 138 deletions

View file

@ -91,7 +91,7 @@ namespace datalog {
}
void rule_unifier::apply(
rule& r, bool is_tgt, unsigned skipped_index,
rule const& r, bool is_tgt, unsigned skipped_index,
app_ref_vector& res, svector<bool>& res_neg) {
unsigned rule_len = r.get_tail_size();
for (unsigned i = 0; i < rule_len; i++) {
@ -104,7 +104,7 @@ namespace datalog {
}
}
bool rule_unifier::apply(rule& tgt, unsigned tail_index, rule& src, rule_ref& res) {
bool rule_unifier::apply(rule const& tgt, unsigned tail_index, rule const& src, rule_ref& res) {
SASSERT(m_ready);
app_ref new_head(m);
app_ref_vector tail(m);
@ -116,7 +116,7 @@ namespace datalog {
mk_rule_inliner::remove_duplicate_tails(tail, tail_neg);
SASSERT(tail.size()==tail_neg.size());
res = m_rm.mk(new_head, tail.size(), tail.c_ptr(), tail_neg.c_ptr());
res->set_accounting_parent_object(m_context, &tgt);
res->set_accounting_parent_object(m_context, const_cast<rule*>(&tgt));
res->norm_vars(m_rm);
if (m_context.fix_unbound_vars()) {
m_rm.fix_unbound_vars(res, true);