本文整理汇总了C++中rule::get_tail_size方法的典型用法代码示例。如果您正苦于以下问题:C++ rule::get_tail_size方法的具体用法?C++ rule::get_tail_size怎么用?C++ rule::get_tail_size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rule
的用法示例。
在下文中一共展示了rule::get_tail_size方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_max_var
unsigned var_counter::get_max_var(const rule & r) {
m_todo.push_back(r.get_head());
m_scopes.push_back(0);
unsigned n = r.get_tail_size();
bool has_var = false;
for (unsigned i = 0; i < n; i++) {
m_todo.push_back(r.get_tail(i));
m_scopes.push_back(0);
}
return get_max_var(has_var);
}
示例2: check_subsumes
bool context::check_subsumes(rule const& stronger_rule, rule const& weaker_rule) {
if (stronger_rule.get_head() != weaker_rule.get_head()) {
return false;
}
for (unsigned i = 0; i < stronger_rule.get_tail_size(); ++i) {
app* t = stronger_rule.get_tail(i);
bool found = false;
for (unsigned j = 0; j < weaker_rule.get_tail_size(); ++j) {
app* s = weaker_rule.get_tail(j);
if (s == t) {
found = true;
break;
}
}
if (!found) {
return false;
}
}
return true;
}
示例3: del_rule
void del_rule(horn_subsume_model_converter* mc, rule& r) {
if (mc) {
app* head = r.get_head();
ast_manager& m = mc->get_manager();
expr_ref_vector body(m);
for (unsigned i = 0; i < r.get_tail_size(); ++i) {
if (r.is_neg_tail(i)) {
body.push_back(m.mk_not(r.get_tail(i)));
}
else {
body.push_back(r.get_tail(i));
}
}
mc->insert(r.get_head(), body.size(), body.c_ptr());
}
}
示例4: instantiate_rule
void mk_array_instantiation::instantiate_rule(const rule& r, rule_set & dest)
{
//Reset everything
selects.reset();
eq_classes.reset();
cnt = src_manager->get_counter().get_max_rule_var(r)+1;
done_selects.reset();
ownership.reset();
expr_ref_vector phi(m);
expr_ref_vector preds(m);
expr_ref new_head = create_head(to_app(r.get_head()));
unsigned nb_predicates = r.get_uninterpreted_tail_size();
unsigned tail_size = r.get_tail_size();
for(unsigned i=0;i<nb_predicates;i++)
{
preds.push_back(r.get_tail(i));
}
for(unsigned i=nb_predicates;i<tail_size;i++)
{
phi.push_back(r.get_tail(i));
}
//Retrieve selects
for(unsigned i=0;i<phi.size();i++)
retrieve_selects(phi[i].get());
//Rewrite the predicates
expr_ref_vector new_tail(m);
for(unsigned i=0;i<preds.size();i++)
{
new_tail.append(instantiate_pred(to_app(preds[i].get())));
}
new_tail.append(phi);
for(obj_map<expr, var*>::iterator it = done_selects.begin(); it!=done_selects.end(); ++it)
{
expr_ref tmp(m);
tmp = &it->get_key();
new_tail.push_back(m.mk_eq(it->get_value(), tmp));
}
proof_ref pr(m);
src_manager->mk_rule(m.mk_implies(m.mk_and(new_tail.size(), new_tail.c_ptr()), new_head), pr, dest, r.name());
}