コード例 #1
0
 void unite_with_data(const relation_fact & f) {
     if (empty()) {
         assign_data(f);
         return;
     }
     unsigned n=get_signature().size();
     SASSERT(f.size()==n);
     for (unsigned i=0; i<n; i++) {
         SASSERT(!is_undefined(i));
         m_data[i] = get_plugin().mk_union(m_data[i], f[i]);
     }
 }
コード例 #2
0
ファイル: dl_query.cpp プロジェクト: jackluo923/juxta
void dl_query_ask_ground_query(context & ctx, func_decl * pred, relation_fact & f, bool should_be_successful) {
    expr * const * q_args = reinterpret_cast<expr * const *>(f.c_ptr());
    app * query = ctx.get_manager().mk_app(pred, q_args);

    lbool is_sat = ctx.query(query);

    std::cerr << "@@ query should succeed: " << should_be_successful << "\n";
    SASSERT(is_sat != l_undef);
    if((is_sat != l_true) == should_be_successful) {
        std::cerr<<"wrong ground query answer!\n";
        UNREACHABLE();
    }
}
コード例 #3
0
 void external_relation::mk_accessor(decl_kind k, func_decl_ref& fn, const relation_fact& f, bool destructive, expr_ref& res) const {
     ast_manager& m = m_rel.get_manager();
     family_id fid = get_plugin().get_family_id();
     ptr_vector<expr> args;
     args.push_back(m_rel);
     for (unsigned i = 0; i < f.size(); ++i) {
         args.push_back(f[i]);
     }
     if (!fn.get()) {
        fn = m.mk_func_decl(fid, k, 0, 0, args.size(), args.c_ptr());
     }        
     if (destructive) {
         get_plugin().reduce_assign(fn, args.size(), args.c_ptr(), 1, args.c_ptr());
         res = m_rel;
     }
     else {
         get_plugin().reduce(fn, args.size(), args.c_ptr(), res);
     }
 }
コード例 #4
0
ファイル: dl_query.cpp プロジェクト: jackluo923/juxta
void dl_query_ask_for_last_arg(context & ctx, func_decl * pred, relation_fact & f, bool should_be_successful) {
    ast_manager & m = ctx.get_manager();
    expr_ref_vector query_args(m);
    push_into_vector(query_args, f);
    query_args.pop_back();
    query_args.push_back(m.mk_var(0, pred->get_domain(query_args.size())));
    app * query = ctx.get_manager().mk_app(pred, query_args.c_ptr());

    lbool is_sat = ctx.query(query);
    std::cerr << "@@ last arg query should succeed: " << should_be_successful << "\n";
    SASSERT(is_sat != l_undef);

    relation_fact res_fact(m);
    res_fact.push_back(f.back());

    if(ctx.result_contains_fact(res_fact)!=should_be_successful) {
        std::cerr<<"wrong arg query answer!\n";
        UNREACHABLE();
    }
}