void operator()(func_decl * f) {
            for (unsigned i = 0; i < f->get_arity(); i++)
                this->operator()(f->get_domain()[i]);
            this->operator()(f->get_range());

            if (f->get_family_id() == null_family_id) {
                if (!m_seen_func_decls.contains(f)) {
                    if (f->get_arity() == 0)
                        m_stats["uninterpreted-constants"]++;
                    else
                        m_stats["uninterpreted-functions"]++;
                    m_seen_func_decls.insert(f);
                }

                if (f->get_arity() > 0)
                    m_stats["uninterpreted-function-occurrences"]++;
            }
            else {
                params_ref prms;
                prms.set_bool("pp.single_line", true);
                std::stringstream ss;
                ss << mk_ismt2_pp(f, m, prms);
                m_stats[ss.str()]++;

                std::stringstream ssfname;
                if (f->get_num_parameters() > 0)
                    ssfname << "(declare-fun (_ " << f->get_name() << " *) *)";
                else
                    ssfname << "(declare-fun " << f->get_name() << " *)";
                m_stats[ssfname.str()]++;
            }

            m_stats["function-applications"]++;
        }
Exemple #2
0
    /**
       \brief Assert in m_aux_context, the constraint

         sk = e_1 OR ... OR sk = e_n

         where {e_1, ..., e_n} is the universe.
     */
    void model_checker::restrict_to_universe(expr * sk, obj_hashtable<expr> const & universe) {
        SASSERT(!universe.empty());
        ptr_buffer<expr> eqs;
        obj_hashtable<expr>::iterator it  = universe.begin();
        obj_hashtable<expr>::iterator end = universe.end();
        for (; it != end; ++it) {
            expr * e = *it;
            eqs.push_back(m_manager.mk_eq(sk, e));
        }
        m_aux_context->assert_expr(m_manager.mk_or(eqs.size(), eqs.c_ptr()));
    }
Exemple #3
0
    proof *mk_lemma_core(proof *pf, expr *fact)
    {
        ptr_buffer<expr> args;
        expr_ref lemma(m);

        if (m.is_or(fact)) {
            for (unsigned i = 0, sz = to_app(fact)->get_num_args(); i < sz; ++i) {
                expr *a = to_app(fact)->get_arg(i);
                if (!is_reduced(a))
                { args.push_back(a); }
            }
        } else if (!is_reduced(fact))
        { args.push_back(fact); }


        if (args.size() == 0) { return pf; }
        else if (args.size() == 1) {
            lemma = args.get(0);
        } else {
            lemma = m.mk_or(args.size(), args.c_ptr());
        }
        proof* res = m.mk_lemma(pf, lemma);
        m_pinned.push_back(res);

        if (m_hyps.contains(lemma))
        { m_units.insert(lemma, res); }
        return res;
    }
Exemple #4
0
 void operator()(app * n)        {
   m_funcs.insert(n->get_decl());
   class sort* s = m.get_sort(n);
   if (s->get_family_id() == null_family_id) {
     m_sorts.insert(s);
   }
 }
Exemple #5
0
 void reset()
 {
     m_cache.reset();
     m_units.reset();
     m_hyps.reset();
     m_hypmark.reset();
     m_pinned.reset();
 }
Exemple #6
0
 void compute_marks(proof* pr)  {
     proof *p;
     proof_post_order pit(pr, m);
     while (pit.hasNext()) {
         p = pit.next();
         if (m.is_hypothesis(p)) {
             m_hypmark.mark(p, true);
             m_hyps.insert(m.get_fact(p));
         } 
         else {
             bool hyp_mark = compute_mark1(p);
             // collect units that are hyp-free and are used as hypotheses somewhere
             if (!hyp_mark && m.has_fact(p) && m_hyps.contains(m.get_fact(p))) { 
                 m_units.insert(m.get_fact(p), p); 
             }
         }
     }
 }
    /**
       \brief Assert in m_aux_context, the constraint

         sk = e_1 OR ... OR sk = e_n

         where {e_1, ..., e_n} is the universe.
     */
    void model_checker::restrict_to_universe(expr * sk, obj_hashtable<expr> const & universe) {
        SASSERT(!universe.empty());
        ptr_buffer<expr> eqs;
        for (expr * e : universe) {
            eqs.push_back(m.mk_eq(sk, e));
        }
        expr_ref fml(m.mk_or(eqs.size(), eqs.c_ptr()), m);
        m_aux_context->assert_expr(fml);
    }
Exemple #8
0
        void operator()(app* a) {
            if (is_arith_op(a) || a->get_family_id() == m.get_basic_family_id()) {
                return;
            }

            if (m_arith.is_int_real(a)) {
                m_avars.push_back(a);
                if (!m_seen.contains(a)) {
                    m_proxies.push_back(a);
                    m_seen.insert(a);
                }
            }
            for (expr* arg : *a) {
                if (is_app(arg) && !m_seen.contains(arg) && m_arith.is_int_real(arg)) {
                    m_proxies.push_back(to_app(arg));
                    m_seen.insert(arg);
                }
            }
        }
        void operator()(sort * s) {
            if (m.is_uninterp(s)) {
                if (!m_seen_sorts.contains(s)) {
                    m_stats["uninterpreted-sorts"]++;
                    m_seen_sorts.insert(s);
                }
                m_stats["uninterpreted-sort-occurrences"]++;
            }
            else {
                params_ref prms;
                prms.set_bool("pp.single_line", true);
                std::stringstream ss;
                ss << "(declare-sort " << mk_ismt2_pp(s, m, prms) << ")";
                m_stats[ss.str()]++;

                if (s->get_info()->get_num_parameters() > 0) {
                    std::stringstream ssname;
                    ssname << "(declare-sort (_ " << s->get_name() << " *))";
                    m_stats[ssname.str()]++;
                }
            }
        }