Example #1
0
void rule_properties::collect(rule_set const& rules) {
    reset();
    rule_set::iterator it = rules.begin(), end = rules.end();
    expr_sparse_mark visited;
    for (; it != end; ++it) {
        rule* r = *it;
        m_rule = r;
        unsigned ut_size = r->get_uninterpreted_tail_size();
        unsigned t_size  = r->get_tail_size();  
        if (r->has_negation()) {
            m_negative_rules.push_back(r);            
        }
        for (unsigned i = ut_size; i < t_size; ++i) {
            for_each_expr_core<rule_properties,expr_sparse_mark, true, false>(*this, visited, r->get_tail(i));
        }
        if (m_generate_proof && !r->get_proof()) {
            rm.mk_rule_asserted_proof(*r);
        }
        for (unsigned i = 0; m_inf_sort.empty() && i < r->get_decl()->get_arity(); ++i) {
            sort* d = r->get_decl()->get_domain(i);
            if (!m.is_bool(d) && !m_dl.is_finite_sort(d) && !m_bv.is_bv_sort(d)) {
                m_inf_sort.push_back(m_rule);
            }
        }
    }     
}
 void mk_subsumption_checker::scan_for_total_rules(const rule_set & rules) {
     bool new_discovered;
     //we cycle through the rules until we keep discovering new total relations
     //(discovering a total relation migh reveal other total relations)
     do {
         new_discovered = false;
         rule_set::iterator rend = rules.end();
         for(rule_set::iterator rit = rules.begin(); rit!=rend; ++rit) {
             rule * r = *rit;
             func_decl * head_pred = r->get_decl();
             if(is_total_rule(r) && !m_total_relations.contains(head_pred)) {
                 on_discovered_total_relation(head_pred, r);
                 new_discovered = true;
             }
         }
     } while(new_discovered);
 }