当前位置: 首页>>代码示例>>C++>>正文


C++ expr_ref_vector类代码示例

本文整理汇总了C++中expr_ref_vector的典型用法代码示例。如果您正苦于以下问题:C++ expr_ref_vector类的具体用法?C++ expr_ref_vector怎么用?C++ expr_ref_vector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了expr_ref_vector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: operator

 void operator()(expr * n, 
                 proof* p,
                 expr_ref_vector& result, 
                 proof_ref_vector& ps) {
     expr_ref fml(m);
     proof_ref pr(m);
     m_todo.reset();
     m_proofs.reset();
     m_refs.reset();
     m_memoize_disj.reset();
     m_memoize_proof.reset();
     m_fresh_predicates.reset();
     m_todo.push_back(n);
     m_proofs.push_back(p);
     m_produce_proofs = p != 0;
     while (!m_todo.empty() && !m_cancel) {
         fml = m_todo.back();
         pr = m_proofs.back();
         m_todo.pop_back();
         m_proofs.pop_back();
         mk_horn(fml, pr);
         if (fml) {
             result.push_back(fml);
             ps.push_back(pr);
         }
     }
     TRACE("hnf",
           tout << mk_pp(n, m) << "\n==>\n";
           for (unsigned i = 0; i < result.size(); ++i) {
               tout << mk_pp(result[i].get(), m) << "\n";
           });
开发者ID:CHolmes3,项目名称:z3,代码行数:31,代码来源:hnf.cpp

示例2: validate_quant_solutions

static void validate_quant_solutions(app* x, expr* fml, expr_ref_vector& guards) {
    return;
    // quant_elim option got removed...
    // verify:
    //    fml <=> guard_1 \/ guard_2 \/ ... 
    ast_manager& m = guards.get_manager();
    expr_ref tmp(m), fml2(m);
    tmp = m.mk_or(guards.size(), guards.c_ptr());
    expr* _x = x;
    std::cout << mk_pp(fml, m) << "\n";
    expr_abstract(m, 0, 1, &_x, fml, fml2);
    std::cout << mk_pp(fml2, m) << "\n";
    symbol name(x->get_decl()->get_name());
    sort* s = m.get_sort(x);
    fml2 = m.mk_exists(1, &s, &name, fml2);
    std::cout << mk_pp(fml2, m) << "\n";
    tmp = m.mk_not(m.mk_iff(fml2, tmp));
    std::cout << mk_pp(tmp, m) << "\n";
    front_end_params fp;
    smt::kernel solver(m, fp);
    solver.assert_expr(tmp);
    lbool res = solver.check();
    std::cout << "checked\n";
    SASSERT(res == l_false);
    if (res != l_false) {
        std::cout << res << "\n";
        fatal_error(0);
    }
}
开发者ID:CharudattaSChitale,项目名称:sygus-comp14,代码行数:29,代码来源:quant_solve.cpp

示例3: operator

 mbi_result prop_mbi_plugin::operator()(expr_ref_vector& lits, model_ref& mdl)  {
     lbool r = m_solver->check_sat(lits);
     switch (r) {
     case l_false:
         lits.reset();
         m_solver->get_unsat_core(lits);
         return mbi_unsat;
     case l_true:
         m_solver->get_model(mdl);
         lits.reset();
         for (unsigned i = 0, sz = mdl->get_num_constants(); i < sz; ++i) {
             func_decl* c = mdl->get_constant(i);
             if (m_shared.contains(c)) {
                 if (m.is_true(mdl->get_const_interp(c))) {
                     lits.push_back(m.mk_const(c));
                 }
                 else if (m.is_false(mdl->get_const_interp(c))) {
                     lits.push_back(m.mk_not(m.mk_const(c)));
                 }
             }
         }
         return mbi_sat;
     default:
         return mbi_undef;
     }
 }
开发者ID:levnach,项目名称:z3,代码行数:26,代码来源:qe_mbi.cpp

示例4: eval_exprs

void model_evaluator_array_util::eval_exprs(model& mdl, expr_ref_vector& es) {
    for (unsigned j = 0; j < es.size(); ++j) {
        if (m_array.is_as_array(es.get (j))) {
            expr_ref r (m);
            eval(mdl, es.get (j), r);
            es.set (j, r);
        }
    }
}
开发者ID:NikolajBjorner,项目名称:z3,代码行数:9,代码来源:spacer_mev_array.cpp

示例5: mk_proxies

bool itp_solver::mk_proxies (expr_ref_vector &v, unsigned from)
{
    bool dirty = false;
    for (unsigned i = from, sz = v.size(); i < sz; ++i) {
        app *p = mk_proxy (v.get (i));
        dirty |= (v.get (i) != p);
        v[i] = p;
    }
    return dirty;
}
开发者ID:chadbrewbaker,项目名称:z3,代码行数:10,代码来源:spacer_itp_solver.cpp

示例6: undo_proxies

void itp_solver::undo_proxies (expr_ref_vector &r)
{
    app_ref e(m);
    // expand proxies
    for (unsigned i = 0, sz = r.size (); i < sz; ++i)
        if (is_proxy(r.get(i), e)) {
            SASSERT (m.is_or (e));
            r[i] = e->get_arg (1);
        }
}
开发者ID:chadbrewbaker,项目名称:z3,代码行数:10,代码来源:spacer_itp_solver.cpp

示例7: display

void display(std::ostream & out, expr_ref_vector & r, bool ll=true) {
    ast_mark v;
    for (unsigned i = 0; i < r.size(); i++) {
        if (ll)
            ast_ll_pp(out, r.get_manager(), r.get(i), v);
        else
            out << mk_pp(r.get(i), r.get_manager());
        out << "\n";
    }
}
开发者ID:Moondee,项目名称:Artemis,代码行数:10,代码来源:bit_blaster.cpp

示例8: l

void atom2bool_var::mk_inv(expr_ref_vector & lit2expr) const {
    obj_map<expr, var>::iterator it  = m_mapping.begin();
    obj_map<expr, var>::iterator end = m_mapping.end();
    for (; it != end; ++it) {
        sat::literal l(static_cast<sat::bool_var>(it->m_value), false);
        lit2expr.set(l.index(), it->m_key);
        l.neg();
        lit2expr.set(l.index(), m().mk_not(it->m_key));
    }
}
开发者ID:sukwon0709,项目名称:byterun,代码行数:10,代码来源:atom2bool_var.cpp

示例9: extract_clauses_and_dependencies

void extract_clauses_and_dependencies(goal_ref const& g, expr_ref_vector& clauses, ptr_vector<expr>& assumptions, expr2expr_map& bool2dep, ref<filter_model_converter>& fmc) {
    expr2expr_map dep2bool;
    ptr_vector<expr> deps;
    ast_manager& m = g->m();
    expr_ref_vector clause(m);
    unsigned sz = g->size();
    for (unsigned i = 0; i < sz; i++) {
        expr * f            = g->form(i);
        expr_dependency * d = g->dep(i);
        if (d == 0 || !g->unsat_core_enabled()) {
            clauses.push_back(f);
        }
        else {
            // create clause (not d1 \/ ... \/ not dn \/ f) when the d's are the assumptions/dependencies of f.
            clause.reset();
            clause.push_back(f);
            deps.reset();
            m.linearize(d, deps);
            SASSERT(!deps.empty()); // d != 0, then deps must not be empty
            ptr_vector<expr>::iterator it  = deps.begin();
            ptr_vector<expr>::iterator end = deps.end();
            for (; it != end; ++it) {
                expr * d = *it;
                if (is_uninterp_const(d) && m.is_bool(d)) {
                    // no need to create a fresh boolean variable for d
                    if (!bool2dep.contains(d)) {
                        assumptions.push_back(d);
                        bool2dep.insert(d, d);
                    }
                    clause.push_back(m.mk_not(d));
                }
                else {
                    // must normalize assumption
                    expr * b = 0;
                    if (!dep2bool.find(d, b)) {
                        b = m.mk_fresh_const(0, m.mk_bool_sort());
                        dep2bool.insert(d, b);
                        bool2dep.insert(b, d);
                        assumptions.push_back(b);
                        if (!fmc) {
                            fmc = alloc(filter_model_converter, m);
                        }
                        fmc->insert(to_app(b)->get_decl());
                    }
                    clause.push_back(m.mk_not(b));
                }
            }
            SASSERT(clause.size() > 1);
            expr_ref cls(m);
            cls = mk_or(m, clause.size(), clause.c_ptr());
            clauses.push_back(cls);
        }
    }
}
开发者ID:ForwardFunk,项目名称:SynTree,代码行数:54,代码来源:smt_tactic.cpp

示例10: is_homogenous

bool sym_mux::is_homogenous(const expr_ref_vector & vect, unsigned idx) const
{
    expr * const * begin = vect.c_ptr();
    expr * const * end = begin + vect.size();
    for (expr * const * it = begin; it != end; it++) {
        if (!is_homogenous_formula(*it, idx)) {
            return false;
        }
    }
    return true;
}
开发者ID:chadbrewbaker,项目名称:z3,代码行数:11,代码来源:spacer_sym_mux.cpp

示例11: get_literals

 bool euf_arith_mbi_plugin::get_literals(model_ref& mdl, expr_ref_vector& lits) {
     lits.reset();
     for (expr* e : m_atoms) {
         if (mdl->is_true(e)) {
             lits.push_back(e);
         }
         else if (mdl->is_false(e)) {
             lits.push_back(m.mk_not(e));
         }
     }
     TRACE("qe", tout << "atoms from model: " << lits << "\n";);
开发者ID:levnach,项目名称:z3,代码行数:11,代码来源:qe_mbi.cpp

示例12: flush_assertions

 void flush_assertions() const {
     proof_ref proof(m);
     expr_ref fml(m);
     expr_ref_vector fmls(m);
     for (unsigned i = 0; i < m_assertions.size(); ++i) {
         m_rewriter(m_assertions[i].get(), fml, proof);
         m_solver->assert_expr(fml);
     }
     m_rewriter.flush_side_constraints(fmls);
     m_solver->assert_expr(fmls);
     m_assertions.reset();
 }
开发者ID:veleek,项目名称:z3,代码行数:12,代码来源:pb2bv_solver.cpp

示例13: test_cs

static void test_cs(app* x, expr_ref_vector& c, vector<expr_ref_vector> const& cs) {
    if (c.size() == cs.size()) {
        test_c(x, c);
        return;
    }
    expr_ref_vector const& c1 = cs[c.size()];
    for (unsigned i = 0; i < c1.size(); ++i) {
        c.push_back(c1[i]);
        test_cs(x, c, cs);
        c.pop_back();
    }
}
开发者ID:NikolajBjorner,项目名称:z3,代码行数:12,代码来源:qe_arith.cpp

示例14: filter_non_model_lits

void sym_mux::filter_non_model_lits(expr_ref_vector & vect) const
{
    unsigned i = 0;
    while (i < vect.size()) {
        if (!has_nonmodel_symbol(vect[i].get())) {
            i++;
            continue;
        }
        vect[i] = vect.back();
        vect.pop_back();
    }
}
开发者ID:chadbrewbaker,项目名称:z3,代码行数:12,代码来源:spacer_sym_mux.cpp

示例15: conv_formula_vector

void sym_mux::conv_formula_vector(const expr_ref_vector & vect, unsigned src_idx, unsigned tgt_idx,
                                  expr_ref_vector & res) const
{
    res.reset();
    expr * const * begin = vect.c_ptr();
    expr * const * end = begin + vect.size();
    for (expr * const * it = begin; it != end; it++) {
        expr_ref converted(m);
        conv_formula(*it, src_idx, tgt_idx, converted);
        res.push_back(converted);
    }
}
开发者ID:chadbrewbaker,项目名称:z3,代码行数:12,代码来源:spacer_sym_mux.cpp


注:本文中的expr_ref_vector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。