Ejemplo n.º 1
0
 subpaving::ineq * mk_ineq(expr * a) {
     bool neg = false;
     while (m().is_not(a, a))
         neg = !neg;
     bool lower;
     bool open  = false;
     if (m_autil.is_le(a)) {
         lower = false;
     }
     else if (m_autil.is_ge(a)) {
         lower = true;
     }
     else {
         throw tactic_exception("unsupported atom");
     }
     if (neg) {
         lower = !lower;
         open  = !open;
     }
     rational _k;
     if (!m_autil.is_numeral(to_app(a)->get_arg(1), _k))
         throw tactic_exception("use simplify tactic with option :arith-lhs true");
     scoped_mpq k(m_qm);
     k = _k.to_mpq();
     scoped_mpz n(m_qm), d(m_qm);
     subpaving::var x = m_e2s->internalize_term(to_app(a)->get_arg(0), n, d);
     m_qm.mul(d, k, k);
     m_qm.div(k, n, k);
     if (is_neg(n))
         lower = !lower;
     TRACE("subpaving_tactic", tout << x << " " << k << " " << lower << " " << open << "\n";);
Ejemplo n.º 2
0
        void operator()(goal_ref const & g, 
                        goal_ref_buffer & result, 
                        model_converter_ref & mc, 
                        proof_converter_ref & pc,
                        expr_dependency_ref & core) {
            mc = 0; pc = 0; core = 0;
            bool proofs_enabled = g->proofs_enabled();

            if (proofs_enabled && m_blast_quant)
                throw tactic_exception("quantified variable blasting does not support proof generation");
            
            tactic_report report("bit-blaster", *g);
            
            TRACE("before_bit_blaster", g->display(tout););
Ejemplo n.º 3
0
        void operator()(goal_ref const & g, 
                        goal_ref_buffer & result, 
                        model_converter_ref & mc, 
                        proof_converter_ref & pc,
                        expr_dependency_ref & core) {
            SASSERT(g->is_well_sorted());
            mc = 0; pc = 0; core = 0;
            tactic_report report("horn", *g);
            bool produce_proofs = g->proofs_enabled();

            if (produce_proofs) {                
                if (!m_ctx.get_params().generate_proof_trace()) {
                    params_ref params = m_ctx.get_params().p;
                    params.set_bool("generate_proof_trace", true);
                    updt_params(params);
                }
            }

            unsigned sz = g->size();
            expr_ref q(m), f(m);
            expr_ref_vector queries(m);
            std::stringstream msg;

            m_ctx.reset();
            m_ctx.ensure_opened();

            for (unsigned i = 0; i < sz; i++) {
                f = g->form(i);
                formula_kind k = get_formula_kind(f);
                switch(k) {
                case IS_RULE:
                    m_ctx.add_rule(f, symbol::null);
                    break;
                case IS_QUERY:
                    queries.push_back(f);
                    break;
                default: 
                    msg << "formula is not in Horn fragment: " << mk_pp(g->form(i), m) << "\n";
                    TRACE("horn", tout << msg.str(););
                    throw tactic_exception(msg.str().c_str());
                }
            }
Ejemplo n.º 4
0
    virtual void operator()(
        goal_ref const & g, 
        goal_ref_buffer & result, 
        model_converter_ref & mc, 
        proof_converter_ref & pc,
        expr_dependency_ref & core) {
        SASSERT(g->is_well_sorted());
        pc = 0; core = 0;

        if (g->proofs_enabled()) {
            throw tactic_exception("pb-preprocess does not support proofs");
        }

        pb_preproc_model_converter* pp = alloc(pb_preproc_model_converter, m);
        mc = pp;

        g->inc_depth();        
        result.push_back(g.get());       
        while (simplify(g, *pp));
        // decompose(g);
    }
Ejemplo n.º 5
0
 void operator()(goal_ref const & g, 
                 goal_ref_buffer & result, 
                 model_converter_ref & mc, 
                 proof_converter_ref & pc,
                 expr_dependency_ref & core) {
     mc = 0; pc = 0; core = 0;
     
     if (!is_target(*g))
         throw tactic_exception("bv1 blaster cannot be applied to goal");
     
     tactic_report report("bv1-blaster", *g);
     m_num_steps = 0;
     
     bool proofs_enabled = g->proofs_enabled();
     expr_ref   new_curr(m());
     proof_ref  new_pr(m());
     unsigned   size = g->size();
     for (unsigned idx = 0; idx < size; idx++) {
         if (g->inconsistent())
             break;
         expr * curr = g->form(idx);
         m_rw(curr, new_curr, new_pr);
         m_num_steps += m_rw.get_num_steps();
         if (proofs_enabled) {
             proof * pr = g->pr(idx);
             new_pr     = m().mk_modus_ponens(pr, new_pr);
         }
         g->update(idx, new_curr, new_pr, g->dep(idx));
     }
     
     if (g->models_enabled())
         mc = mk_bv1_blaster_model_converter(m(), m_rw.cfg().m_const2bits);
     g->inc_depth();
     result.push_back(g.get());
     m_rw.cfg().cleanup();
 }
Ejemplo n.º 6
0
 bool max_steps_exceeded(unsigned num_steps) const { 
     cooperate("max bv sharing");
     if (memory::get_allocation_size() > m_max_memory)
         throw tactic_exception(TACTIC_MAX_MEMORY_MSG);
     return num_steps > m_max_steps;
 }
Ejemplo n.º 7
0
 void checkpoint() {
     if (m_cancel) {
         throw tactic_exception(TACTIC_CANCELED_MSG);
     }
 }
Ejemplo n.º 8
0
 void throw_op_not_handled(std::string const& s) {
     std::string s0 = "operator " + s + " not supported, apply simplifier before invoking translator";
     throw tactic_exception(s0.c_str());
 }
Ejemplo n.º 9
0
 void checkpoint() {
     if (m_cancel)
         throw tactic_exception(TACTIC_CANCELED_MSG);
     cooperate("qe");
 }
Ejemplo n.º 10
0
 void throw_not_supported() {
     throw tactic_exception("goal is not diff neq");
 }
Ejemplo n.º 11
0
 void throw_op_not_handled() {
     throw tactic_exception("operator not supported, apply simplifier before invoking this strategy");
 }
Ejemplo n.º 12
0
void sls_engine::checkpoint() {
    if (m_manager.canceled())
        throw tactic_exception(m_manager.limit().get_cancel_msg());
    cooperate("sls");
}
Ejemplo n.º 13
0
 void checkpoint() {
     if (m.canceled())
         throw tactic_exception(m.limit().get_cancel_msg());
     cooperate("qe");
 }
Ejemplo n.º 14
0
 void checkpoint() {
     if (m.canceled()) {
         throw tactic_exception(m.limit().get_cancel_msg());
     }
 }