示例#1
0
        virtual relation_base * operator()(const relation_base & r0) {
            SASSERT(r0.get_plugin().is_sieve_relation());
            const sieve_relation & r = static_cast<const sieve_relation &>(r0);
            sieve_relation_plugin & plugin = r.get_plugin();

            relation_base * inner_res = (*m_inner_fun)(r.get_inner());

            return plugin.mk_from_inner(get_result_signature(), m_result_inner_cols.c_ptr(), inner_res);
        }
示例#2
0
        virtual relation_base * operator()(const relation_base & r1, const relation_base & r2) {
            bool r1_sieved = r1.get_plugin().is_sieve_relation();
            bool r2_sieved = r2.get_plugin().is_sieve_relation();
            SASSERT(r1_sieved || r2_sieved);
            const sieve_relation * sr1 = r1_sieved ? static_cast<const sieve_relation *>(&r1) : 0;
            const sieve_relation * sr2 = r2_sieved ? static_cast<const sieve_relation *>(&r2) : 0;
            const relation_base & inner1 = r1_sieved ? sr1->get_inner() : r1;
            const relation_base & inner2 = r2_sieved ? sr2->get_inner() : r2;

            relation_base * inner_res = (*m_inner_join_fun)(inner1, inner2);

            return m_plugin.mk_from_inner(get_result_signature(), m_result_inner_cols.c_ptr(), inner_res);
        }
示例#3
0
 var mk_sum(mpz const & c, unsigned sz, mpz const * as, var const * xs) override {
     try {
         m_as.reserve(sz);
         for (unsigned i = 0; i < sz; i++) {
             int2hwf(as[i], m_as[i]);
         }
         int2hwf(c, m_c);
         return m_ctx.mk_sum(m_c, sz, m_as.c_ptr(), xs);
     }
     catch (f2n<mpf_manager>::exception) {
         throw subpaving::exception();
     }
 }
示例#4
0
    virtual void execute(cmd_context & ctx) {
        if(m_arg_idx<2) {
            throw cmd_exception("at least 2 arguments expected");
        }
        ensure_domain(ctx);
        ast_manager& m = ctx.m();

        func_decl_ref pred(
            m.mk_func_decl(m_rel_name, m_domain->size(), m_domain->c_ptr(), m.mk_bool_sort()), m);
        ctx.insert(pred);
        datalog::context& dctx = m_dl_ctx->get_dl_context();
        dctx.register_predicate(pred, false);
        if(!m_kinds.empty()) {
            dctx.set_predicate_representation(pred, m_kinds.size(), m_kinds.c_ptr());
        }
        m_domain = 0;
    }