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


C++ cmd_context::display方法代码示例

本文整理汇总了C++中cmd_context::display方法的典型用法代码示例。如果您正苦于以下问题:C++ cmd_context::display方法的具体用法?C++ cmd_context::display怎么用?C++ cmd_context::display使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cmd_context的用法示例。


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

示例1: execute

 virtual void execute(cmd_context & ctx) {
     if (m_target == 0)
         throw cmd_exception("invalid simplify command, argument expected");
     expr_ref r(ctx.m());
     proof_ref pr(ctx.m());
     if (m_params.get_bool("som", false))
         m_params.set_bool("flat", true);
     th_rewriter s(ctx.m(), m_params);
     unsigned cache_sz;
     unsigned num_steps = 0;
     unsigned timeout   = m_params.get_uint("timeout", UINT_MAX);
     unsigned rlimit    = m_params.get_uint("rlimit", UINT_MAX);
     bool failed = false;
     cancel_eh<reslimit> eh(ctx.m().limit());
     { 
         scoped_rlimit _rlimit(ctx.m().limit(), rlimit);
         scoped_ctrl_c ctrlc(eh);
         scoped_timer timer(timeout, &eh);
         cmd_context::scoped_watch sw(ctx);
         try {
             s(m_target, r, pr);
         }
         catch (z3_error & ex) {
             throw ex;
         }
         catch (z3_exception & ex) {
             ctx.regular_stream() << "(error \"simplifier failed: " << ex.msg() << "\")" << std::endl;
             failed = true;
             r = m_target;
         }
         cache_sz  = s.get_cache_size();
         num_steps = s.get_num_steps();
         s.cleanup();
     }
     if (m_params.get_bool("print", true)) {
         ctx.display(ctx.regular_stream(), r);
         ctx.regular_stream() << std::endl; 
     }
     if (!failed && m_params.get_bool("print_proofs", false)) {
         ast_smt_pp pp(ctx.m());
         pp.set_logic(ctx.get_logic().str().c_str());
         pp.display_expr_smt2(ctx.regular_stream(), pr.get());
         ctx.regular_stream() << std::endl;
     }
     if (m_params.get_bool("print_statistics", false)) {
         shared_occs s1(ctx.m());
         if (!failed)
             s1(r);
         unsigned long long max_mem = memory::get_max_used_memory();
         unsigned long long mem = memory::get_allocation_size();
         ctx.regular_stream() << "(:time " << std::fixed << std::setprecision(2) << ctx.get_seconds() << " :num-steps " << num_steps
                              << " :memory " << std::fixed << std::setprecision(2) << static_cast<double>(mem)/static_cast<double>(1024*1024)
                              << " :max-memory " << std::fixed << std::setprecision(2) << static_cast<double>(max_mem)/static_cast<double>(1024*1024)
                              << " :cache-size: " << cache_sz
                              << " :num-nodes-before " << get_num_exprs(m_target);
         if (!failed)
             ctx.regular_stream() << " :num-shared " << s1.num_shared() << " :num-nodes " << get_num_exprs(r);
         ctx.regular_stream() << ")" << std::endl;
     }
 }
开发者ID:perillaseed,项目名称:z3,代码行数:60,代码来源:simplify_cmd.cpp

示例2: display

void assertion_set::display(cmd_context & ctx, std::ostream & out) const {
    out << "(assertion-set";
    unsigned sz = size();
    for (unsigned i = 0; i < sz; i++) {
        out << "\n  ";
        ctx.display(out, form(i), 2);
    }
    out << ")" << std::endl;
}
开发者ID:Moondee,项目名称:Artemis,代码行数:9,代码来源:assertion_set.cpp

示例3: print_answer

 void print_answer(cmd_context& ctx) {
     if (m_params.get_bool(":print-answer", false)) {
         datalog::context& dlctx = m_dl_ctx->get_dl_context();
         ast_manager& m = ctx.m();
         expr_ref query_result(dlctx.get_answer_as_formula(), m);
         sbuffer<symbol> var_names;
         unsigned num_decls = 0;
         if (is_quantifier(m_target)) {
             num_decls = to_quantifier(m_target)->get_num_decls();
         }
         ctx.display(ctx.regular_stream(), query_result, 0, num_decls, "X", var_names);
         ctx.regular_stream() << std::endl;
     }
 }
开发者ID:sukwon0709,项目名称:byterun,代码行数:14,代码来源:dl_cmds.cpp

示例4: execute

    void execute(cmd_context & ctx) override {
        proof_ref pr(ctx.m());
        qe::simplify_rewriter_star qe(ctx.m());
        expr_ref result(ctx.m());

        qe(m_target, result, pr);            

        if (m_params.get_bool("print", true)) {
            ctx.display(ctx.regular_stream(), result);
            ctx.regular_stream() << std::endl; 
        }
        if (m_params.get_bool("print_statistics", false)) {
            statistics st;
            qe.collect_statistics(st);
            st.display(ctx.regular_stream());
        }
    }
开发者ID:NikolajBjorner,项目名称:z3,代码行数:17,代码来源:qe_cmd.cpp


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