Exemplo n.º 1
0
 expr_ref inductive_property::fixup_clauses(expr* fml) const {
     expr_ref_vector conjs(m);
     expr_ref result(m);
     flatten_and(fml, conjs);
     for (unsigned i = 0; i < conjs.size(); ++i) {
         conjs[i] = fixup_clause(conjs[i].get());
     }
     bool_rewriter(m).mk_and(conjs.size(), conjs.c_ptr(), result);
     return result;
 }
Exemplo n.º 2
0
 void table_base::to_formula(relation_signature const& sig, expr_ref& fml) const {
     // iterate over rows and build disjunction
     ast_manager & m = fml.get_manager();
     expr_ref_vector disjs(m);
     expr_ref_vector conjs(m);
     dl_decl_util util(m);
     table_fact fact;
     iterator it = begin();
     iterator iend = end();
     for(; it!=iend; ++it) {
         const row_interface & r = *it;   
         r.get_fact(fact);
         conjs.reset();
         for (unsigned i = 0; i < fact.size(); ++i) {
             conjs.push_back(m.mk_eq(m.mk_var(i, sig[i]), util.mk_numeral(fact[i], sig[i])));
         }
         switch(conjs.size()) {
         case 0: disjs.push_back(m.mk_true()); break;
         case 1: disjs.push_back(conjs[0].get()); break;
         default: disjs.push_back(m.mk_and(conjs.size(), conjs.c_ptr())); break;
         }
     }
     bool_rewriter(m).mk_or(disjs.size(), disjs.c_ptr(), fml);        
 }
Exemplo n.º 3
0
 expr_ref mk_or(expr_ref_vector const& fmls) {
     ast_manager& m = fmls.get_manager();
     expr_ref result(m);
     bool_rewriter(m).mk_or(fmls.size(), fmls.c_ptr(), result);
     return result;
 }