Esempio n. 1
0
    void context::display_lemma_as_smt_problem(std::ostream & out, unsigned num_antecedents, literal const * antecedents,
                                               unsigned num_eq_antecedents, enode_pair const * eq_antecedents,
                                               literal consequent, symbol const& logic) const {
        ast_pp_util visitor(m_manager);
        expr_ref_vector fmls(m_manager);
        visitor.collect(fmls);
        expr_ref n(m_manager);
        for (unsigned i = 0; i < num_antecedents; i++) {
            literal l = antecedents[i];
            literal2expr(l, n);
            fmls.push_back(n);
        }
        for (unsigned i = 0; i < num_eq_antecedents; i++) {
            enode_pair const & p = eq_antecedents[i];
            n = m_manager.mk_eq(p.first->get_owner(), p.second->get_owner());
            fmls.push_back(n);
        }
        if (consequent != false_literal) {
            literal2expr(~consequent, n);
            fmls.push_back(n);
        }

        if (logic != symbol::null) out << "(set-logic " << logic << ")\n";
        visitor.collect(fmls);
        visitor.display_decls(out);
        visitor.display_asserts(out, fmls, true);
        out << "(check-sat)\n";
    }
Esempio n. 2
0
    void context::display_binary_clauses(std::ostream & out) const {
        bool first = true;
        unsigned l_idx = 0;
        for (watch_list const& wl : m_watches) {
            literal l1 = to_literal(l_idx++);
            literal neg_l1 = ~l1;
            literal const * it2  = wl.begin_literals();
            literal const * end2 = wl.end_literals();
            for (; it2 != end2; ++it2) {
                literal l2 = *it2;
                if (l1.index() < l2.index()) {
                    if (first) {
                        out << "binary clauses:\n";
                        first = false;
                    }
                    expr_ref t1(m_manager), t2(m_manager);
                    literal2expr(neg_l1, t1);
                    literal2expr(l2, t2);
                    expr_ref disj(m_manager.mk_or(t1, t2), m_manager);
                    out << disj << "\n";
#if 0
                    out << "(clause ";
                    display_literal(out, neg_l1);
                    out << " ";
                    display_literal(out, l2);
                    out << ")\n";
#endif
                }
            }
        }
    }
Esempio n. 3
0
 void context::display_lemma_as_smt_problem(std::ostream & out, unsigned num_antecedents, literal const * antecedents, literal consequent, const char * logic) const {
     ast_smt_pp pp(m_manager);
     pp.set_benchmark_name("lemma");
     pp.set_status("unsat");
     pp.set_logic(logic);
     for (unsigned i = 0; i < num_antecedents; i++) {
         literal l = antecedents[i];
         expr_ref n(m_manager);
         literal2expr(l, n);
         pp.add_assumption(n);
     }
     expr_ref n(m_manager);
     literal2expr(~consequent, n);
     pp.display_smt2(out, n);
 }
Esempio n. 4
0
 void context::display_assignment_as_smtlib2(std::ostream& out, symbol const&  logic) const {
     ast_smt_pp pp(m_manager);
     pp.set_benchmark_name("lemma");
     pp.set_status("unknown");
     pp.set_logic(logic);
     for (literal lit : m_assigned_literals) {
         expr_ref n(m_manager);
         literal2expr(lit, n);
         pp.add_assumption(n);
     }
     pp.display_smt2(out, m_manager.mk_true());
 }
Esempio n. 5
0
 void context::display_lemma_as_smt_problem(std::ostream & out, unsigned num_antecedents, literal const * antecedents,
                                            unsigned num_eq_antecedents, enode_pair const * eq_antecedents,
                                            literal consequent, const char * logic) const {
     ast_smt_pp pp(m_manager);
     pp.set_benchmark_name("lemma");
     pp.set_status("unsat");
     pp.set_logic(logic);
     for (unsigned i = 0; i < num_antecedents; i++) {
         literal l = antecedents[i];
         expr_ref n(m_manager);
         literal2expr(l, n);
         pp.add_assumption(n);
     }
     for (unsigned i = 0; i < num_eq_antecedents; i++) {
         enode_pair const & p = eq_antecedents[i];
         expr_ref eq(m_manager);
         eq = m_manager.mk_eq(p.first->get_owner(), p.second->get_owner());
         pp.add_assumption(eq);
     }
     expr_ref n(m_manager);
     literal2expr(~consequent, n);
     pp.display_smt2(out, n);
 }
Esempio n. 6
0
 void context::display_assignment_as_smtlib2(std::ostream& out, char const* logic) const {
     ast_smt_pp pp(m_manager);
     pp.set_benchmark_name("lemma");
     pp.set_status("unknown");
     pp.set_logic(logic);
     literal_vector::const_iterator it  = m_assigned_literals.begin();
     literal_vector::const_iterator end = m_assigned_literals.end();
     for (; it != end; ++it) {
         expr_ref n(m_manager);
         literal2expr(*it, n);
         pp.add_assumption(n);
     }
     pp.display_smt2(out, m_manager.mk_true());
 }