示例#1
0
void ctx_propagate_assertions::assert_eq_core(expr * t, app * val) {
    if (m_assertions.contains(t)) {
        // This branch can only happen when m_max_depth was reached.
        // It can happen when m_assertions contains an entry t->val',
        //  but (= t val) was not simplified to (= val' val)
        //  because the simplifier stopped at depth m_max_depth
        return;
    }

    CTRACE("assert_eq_bug", m_assertions.contains(t),
           tout << "t:\n" << mk_ismt2_pp(t, m) << "\nval:\n" << mk_ismt2_pp(val, m) << "\n";
           expr * old_val = 0;
           m_assertions.find(t, old_val);
           tout << "old_val:\n" << mk_ismt2_pp(old_val, m) << "\n";);
示例#2
0
    // returns true if (hypothesis (not a)) would be reduced
    bool is_reduced(expr *a)
    {
        expr_ref e(m);
        if (m.is_not(a)) { e = to_app(a)->get_arg(0); }
        else { e = m.mk_not(a); }

        return m_units.contains(e);
    }
示例#3
0
 void cache_result(expr * t, subpaving::var x, mpz const & n, mpz const & d) {
     SASSERT(!m_cache.contains(t));
     SASSERT(m_cached_numerators.size()   == m_cached_vars.size());
     SASSERT(m_cached_denominators.size() == m_cached_vars.size());
     if (t->get_ref_count() <= 1) 
         return;
     unsigned idx = m_cached_vars.size();
     m_cache.insert(t, idx);
     m().inc_ref(t);
     m_cached_vars.push_back(x);
     m_cached_numerators.push_back(n);
     m_cached_denominators.push_back(d);
 }
pb2bv_model_converter::pb2bv_model_converter(ast_manager & _m, obj_map<func_decl, expr*> const & c2bit, bound_manager const & bm):
    m(_m) {
    obj_map<func_decl, expr*>::iterator it  = c2bit.begin();
    obj_map<func_decl, expr*>::iterator end = c2bit.end();
    for ( ; it != end; it++) {
        m_c2bit.push_back(func_decl_pair(it->m_key, to_app(it->m_value)->get_decl()));
        m.inc_ref(it->m_key);
        m.inc_ref(to_app(it->m_value)->get_decl());
    }      
    bound_manager::iterator it2  = bm.begin();
    bound_manager::iterator end2 = bm.end();
    for (; it2 != end2; ++it2) {
        expr * c = *it2;
        SASSERT(is_uninterp_const(c));
        func_decl * d = to_app(c)->get_decl();
        if (!c2bit.contains(d)) {
            SASSERT(d->get_arity() == 0);
            m.inc_ref(d);
            m_c2bit.push_back(func_decl_pair(d, static_cast<func_decl*>(nullptr)));
        }
    }
}
示例#5
0
 bool is_cached(expr * t) {
     return t->get_ref_count() > 1 && m_cache.contains(t);
 }