Пример #1
0
bool sls_engine::full_eval(model & mdl) {
    bool res = true;

    unsigned sz = m_assertions.size();
    for (unsigned i = 0; i < sz && res; i++) {
        checkpoint();
        expr_ref o(m_manager);

        if (!mdl.eval(m_assertions[i], o, true))
            exit(ERR_INTERNAL_FATAL);

        res = m_manager.is_true(o.get());
    }

    TRACE("sls", tout << "Evaluation: " << res << std::endl;);
Пример #2
0
        bool full_eval(goal_ref const & g, model & mdl) {
            bool res = true;

            unsigned sz = g->size();
            for (unsigned i = 0; i < sz && res; i++) {
                checkpoint();
                expr_ref o(m_manager);

                if (!mdl.eval(g->form(i), o, true))
                    exit(ERR_INTERNAL_FATAL);

                res = m_manager.is_true(o.get());
            }        

            TRACE("sls", tout << "Evaluation: " << res << std::endl;);
Пример #3
0
/**
   \brief return two terms that are equal in the model.
   The distinct term t is false in model, so there 
   are at least two arguments of t that are equal in the model.
*/
expr_ref project_plugin::pick_equality(ast_manager& m, model& model, expr* t) {
    SASSERT(m.is_distinct(t));
    expr_ref val(m);
    expr_ref_vector vals(m);
    obj_map<expr, expr*> val2expr;
    app* alit = to_app(t);
    for (unsigned i = 0; i < alit->get_num_args(); ++i) {
        expr* e1 = alit->get_arg(i), *e2;
        VERIFY(model.eval(e1, val));
        if (val2expr.find(val, e2)) {
            return expr_ref(m.mk_eq(e1, e2), m);
        }
        val2expr.insert(val, e1);
        vals.push_back(val);
    }
    UNREACHABLE();
    return expr_ref(0, m);
}
Пример #4
0
void project_plugin::partition_values(model& model, expr_ref_vector const& vals, expr_ref_vector& lits) {
    ast_manager& m = vals.get_manager();
    expr_ref val(m);
    expr_ref_vector trail(m), reps(m);
    obj_map<expr, expr*> roots;
    for (unsigned i = 0; i < vals.size(); ++i) {
        expr* v = vals[i], *root;
        VERIFY (model.eval(v, val));
        if (roots.find(val, root)) {
            lits.push_back(m.mk_eq(v, root));
        }
        else {
            roots.insert(val, v);
            trail.push_back(val);
            reps.push_back(v);
        }
    }
    if (reps.size() > 1) {                
        lits.push_back(mk_distinct(reps));
    }
}