本文整理汇总了C++中ptr_vector::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ ptr_vector::push_back方法的具体用法?C++ ptr_vector::push_back怎么用?C++ ptr_vector::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ptr_vector
的用法示例。
在下文中一共展示了ptr_vector::push_back方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: for_each_parameter
bool for_each_parameter(ptr_vector<ast> & stack, ast_mark & visited, unsigned num_args, parameter const * params) {
bool result = true;
for (unsigned i = 0; i < num_args; i++) {
parameter const& p = params[i];
if (p.is_ast() && !visited.is_marked(p.get_ast())) {
stack.push_back(p.get_ast());
result = false;
}
}
return result;
}
示例2: term
term(expr_ref const& v, u_map<term*>& app2term) :
m_expr(v),
m_root(this),
m_next(this),
m_class_size(1),
m_mark(false),
m_mark2(false),
m_interpreted(false) {
if (!is_app(m_expr)) return;
for (expr* e : *to_app(m_expr)) {
term* t = app2term[e->get_id()];
t->get_root().m_parents.push_back(this);
m_children.push_back(t);
}
}
示例3: is_rel_sort
bool dl_decl_plugin::is_rel_sort(sort* r, ptr_vector<sort>& sorts) {
if (!is_sort_of(r, m_family_id, DL_RELATION_SORT)) {
m_manager->raise_exception("expected relation sort");
return false;
}
unsigned n = r->get_num_parameters();
for (unsigned i = 0; i < n; ++i) {
parameter const& p = r->get_parameter(i);
if (!p.is_ast() || !is_sort(p.get_ast())) {
m_manager->raise_exception("exptected sort parameter");
return false;
}
sorts.push_back(to_sort(p.get_ast()));
}
return true;
}
示例4: operator
/**
\brief Apply equality resolution rule on the given clause.
Store the produced clauses in new_clauses.
*/
void eq_resolution::operator()(clause * cls, ptr_vector<clause> & new_clauses) {
m_subst.reserve_vars(cls->get_num_vars());
unsigned num = cls->get_num_literals();
for (unsigned i = 0; i < num; i++) {
literal const & l = cls->get_literal(i);
expr * atom = l.atom();
if (l.sign() && m_manager.is_eq(atom)) {
expr * lhs = to_app(atom)->get_arg(0);
expr * rhs = to_app(atom)->get_arg(1);
m_subst.reset();
if (m_unifier(lhs, rhs, m_subst, false) && cls->is_eligible_for_resolution(m_order, l, 0, &m_subst)) {
m_stats.m_num_eq_resolution++;
new_clauses.push_back(mk_result(cls, i));
}
}
}
}
示例5: get_func_decls
// Store in result the func_decl that are not attached to any family id.
// That is, the uninterpreted constants and function declarations.
void symtable::get_func_decls(ptr_vector<func_decl> & result) const {
svector<ptr_vector<func_decl>*> tmp;
m_ids.get_range(tmp);
svector<ptr_vector<func_decl>*>::const_iterator it = tmp.begin();
svector<ptr_vector<func_decl>*>::const_iterator end = tmp.end();
for (; it != end; ++it) {
ptr_vector<func_decl> * curr = *it;
if (curr) {
ptr_vector<func_decl>::const_iterator it2 = curr->begin();
ptr_vector<func_decl>::const_iterator end2 = curr->end();
for (; it2 != end2; ++it2) {
func_decl * d = *it2;
if (d && d->get_family_id() == null_family_id) {
result.push_back(d);
}
}
}
}
}
示例6: reduce
void reduce(proof* pf, proof_ref &out)
{
proof *res = nullptr;
m_todo.reset();
m_todo.push_back(pf);
ptr_buffer<proof> args;
bool dirty = false;
while (!m_todo.empty()) {
proof *p, *tmp, *pp;
unsigned todo_sz;
p = m_todo.back();
if (m_cache.find(p, tmp)) {
res = tmp;
m_todo.pop_back();
continue;
}
dirty = false;
args.reset();
todo_sz = m_todo.size();
for (unsigned i = 0, sz = m.get_num_parents(p); i < sz; ++i) {
pp = m.get_parent(p, i);
if (m_cache.find(pp, tmp)) {
args.push_back(tmp);
dirty = dirty || pp != tmp;
} else {
m_todo.push_back(pp);
}
}
if (todo_sz < m_todo.size()) { continue; }
else { m_todo.pop_back(); }
if (m.is_hypothesis(p)) {
// hyp: replace by a corresponding unit
if (m_units.find(m.get_fact(p), tmp)) {
res = tmp;
} else { res = p; }
}
else if (!dirty) { res = p; }
else if (m.is_lemma(p)) {
//lemma: reduce the premise; remove reduced consequences from conclusion
SASSERT(args.size() == 1);
res = mk_lemma_core(args.get(0), m.get_fact(p));
compute_mark1(res);
} else if (m.is_unit_resolution(p)) {
// unit: reduce units; reduce the first premise; rebuild unit resolution
res = mk_unit_resolution_core(args.size(), args.c_ptr());
compute_mark1(res);
} else {
// other: reduce all premises; reapply
if (m.has_fact(p)) { args.push_back(to_app(m.get_fact(p))); }
SASSERT(p->get_decl()->get_arity() == args.size());
res = m.mk_app(p->get_decl(), args.size(), (expr * const*)args.c_ptr());
m_pinned.push_back(res);
compute_mark1(res);
}
SASSERT(res);
m_cache.insert(p, res);
if (m.has_fact(res) && m.is_false(m.get_fact(res))) { break; }
}
out = res;
}
示例7: get_formulas
void goal::get_formulas(ptr_vector<expr> & result) {
unsigned sz = size();
for (unsigned i = 0; i < sz; i++) {
result.push_back(form(i));
}
}
示例8: get_unsat_core
virtual void get_unsat_core(ptr_vector<expr> & r) {
unsigned sz = ctx().get_unsat_core_size();
for (unsigned i = 0; i < sz; i++)
r.push_back(ctx().get_unsat_core_expr(i));
}
示例9: visit
void visit(func_decl * f, bool & visited) {
if (get_color(f) != CLOSED) {
m_todo.push_back(f);
visited = false;
}
}
示例10: insert
void rule_properties::insert(ptr_vector<rule>& rules, rule* r) {
if (rules.empty() || rules.back() != r) {
rules.push_back(r);
}
}
示例11: mergeClass
static
void mergeClass(ptr_vector<VertexInfo> &infos, NGHolder &g, unsigned eq_class,
VertexInfoSet &cur_class_vertices, set<NFAVertex> *toRemove) {
DEBUG_PRINTF("Replacing %zd vertices from equivalence class %u with a "
"single vertex.\n", cur_class_vertices.size(), eq_class);
// replace equivalence class with a single vertex:
// 1. create new vertex with matching properties
// 2. wire all predecessors to new vertex
// 2a. update info for new vertex with new predecessors
// 2b. update each predecessor's successor list
// 3. wire all successors to new vertex
// 3a. update info for new vertex with new successors
// 3b. update each successor's predecessor list
// 4. remove old vertex
// any differences between vertex properties were resolved during
// initial partitioning, so we assume that every vertex in equivalence
// class has the same CharReach et al.
// so, we find the first vertex in our class and get all its properties
/* For left equivalence, if the members have different reporting behaviour
* we sometimes require two vertices to be created (one connected to accept
* and one to accepteod) */
NFAVertex old_v = (*cur_class_vertices.begin())->v;
NFAVertex new_v = clone_vertex(g, old_v); /* set up new vertex with same
* props */
g[new_v].reports.clear(); /* populated as we pull in succs */
VertexInfo *new_vertex_info = new VertexInfo(new_v, g);
// store this vertex in our global vertex list
infos.push_back(new_vertex_info);
NFAVertex new_v_eod = NGHolder::null_vertex();
VertexInfo *new_vertex_info_eod = nullptr;
if (require_separate_eod_vertex(cur_class_vertices, g)) {
new_v_eod = clone_vertex(g, old_v);
g[new_v_eod].reports.clear();
new_vertex_info_eod = new VertexInfo(new_v_eod, g);
infos.push_back(new_vertex_info_eod);
}
const unsigned edgetop = (*cur_class_vertices.begin())->edge_top;
for (VertexInfo *old_vertex_info : cur_class_vertices) {
assert(old_vertex_info->equivalence_class == eq_class);
// mark this vertex for removal
toRemove->insert(old_vertex_info->v);
// for each predecessor, add edge to new vertex and update info
for (VertexInfo *pred_info : old_vertex_info->pred) {
// update info for new vertex
new_vertex_info->pred.insert(pred_info);
if (new_vertex_info_eod) {
new_vertex_info_eod->pred.insert(pred_info);
}
// update info for predecessor
pred_info->succ.erase(old_vertex_info);
// if edge doesn't exist, create it
NFAEdge e = add_edge_if_not_present(pred_info->v, new_v, g).first;
// put edge top, if applicable
if (edgetop != (unsigned) -1) {
g[e].top = edgetop;
}
pred_info->succ.insert(new_vertex_info);
if (new_v_eod) {
NFAEdge ee = add_edge_if_not_present(pred_info->v, new_v_eod,
g).first;
// put edge top, if applicable
if (edgetop != (unsigned) -1) {
g[ee].top = edgetop;
}
pred_info->succ.insert(new_vertex_info_eod);
}
}
// for each successor, add edge from new vertex and update info
for (VertexInfo *succ_info : old_vertex_info->succ) {
NFAVertex succ_v = succ_info->v;
// update info for successor
succ_info->pred.erase(old_vertex_info);
if (new_v_eod && succ_v == g.acceptEod) {
// update info for new vertex
new_vertex_info_eod->succ.insert(succ_info);
insert(&g[new_v_eod].reports,
g[old_vertex_info->v].reports);
add_edge_if_not_present(new_v_eod, succ_v, g);
succ_info->pred.insert(new_vertex_info_eod);
//.........这里部分代码省略.........
示例12: set_next_arg
void set_next_arg(cmd_context & ctx, expr * arg) override {
m_targets.push_back(arg);
}
示例13: add_parent
void add_parent(term* p) { m_parents.push_back(p); }
示例14:
GroupUserConfigParam::GroupUserConfigParam(const char* groupName, const char* comment)
{
this->paramName = groupName;
all_params.push_back(this);
if(comment != NULL) this->comment = comment;
}
示例15: set_next_arg
virtual void set_next_arg(cmd_context & ctx, expr * arg) {
m_targets.push_back(arg);
}