本文整理汇总了C++中datalog::context::get_rel_context方法的典型用法代码示例。如果您正苦于以下问题:C++ context::get_rel_context方法的具体用法?C++ context::get_rel_context怎么用?C++ context::get_rel_context使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类datalog::context
的用法示例。
在下文中一共展示了context::get_rel_context方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: display_statistics
static void display_statistics(
std::ostream& out,
datalog::context& ctx,
datalog::rule_set& orig_rules,
datalog::instruction_block& code,
datalog::execution_context& ex_ctx,
bool verbose
)
{
g_piece_timer.stop();
unsigned t_other = static_cast<int>(g_piece_timer.get_seconds()*1000);
g_overall_time.stop();
code.process_all_costs();
{
params_ref p;
p.set_bool("output_profile", true);
p.set_uint("profile_milliseconds_threshold", 100);
ctx.updt_params(p);
out << "--------------\n";
out << "original rules\n";
orig_rules.display(out);
out << "---------------\n";
out << "generated rules\n";
ctx.display_rules(out);
out << "--------------\n";
out << "instructions \n";
code.display(*ctx.get_rel_context(), out);
out << "--------------\n";
out << "big relations \n";
ex_ctx.report_big_relations(1000, out);
}
out << "--------------\n";
out << "relation sizes\n";
ctx.get_rel_context()->get_rmanager().display_relation_sizes(out);
if (verbose) {
out << "--------------\n";
out << "rules\n";
ctx.display_rules(out);
}
out << "Time: " << static_cast<int>(g_overall_time.get_seconds()*1000) << "ms\n";
out << "Parsing: " << t_parsing << "ms, other: " << t_other << "ms\n";
}
示例2: set_state
void set_state(void* state) {
SASSERT(!m_state);
m_state = state;
symbol name("datalog_relation");
ast_manager& m = m_context.get_manager();
if (!m.has_plugin(name)) {
m.register_plugin(name, alloc(datalog::dl_decl_plugin));
}
datalog::rel_context_base* rel = m_context.get_rel_context();
if (rel) {
datalog::relation_manager& r = rel->get_rmanager();
r.register_plugin(alloc(datalog::external_relation_plugin, *this, r));
}
}