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


C++ ptr_vector::append方法代码示例

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


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

示例1: is_well_formed_vars

bool is_well_formed_vars(ptr_vector<sort>& bound, expr* e) {
    ptr_vector<expr> todo;
    ast_mark mark;
    todo.push_back(e);
    while (!todo.empty()) {
        expr* e = todo.back();
        todo.pop_back();
        if (mark.is_marked(e)) {
            continue;
        }
        mark.mark(e, true);
        if (is_quantifier(e)) {
            quantifier* q = to_quantifier(e);
            unsigned depth = q->get_num_decls();
            bound.append(depth, q->get_decl_sorts());
            if (!is_well_formed_vars(bound, q->get_expr())) {
                return false;
            }
            bound.resize(bound.size()-depth);
        }
        else if (is_app(e)) {
            app* a = to_app(e);
            for (unsigned i = 0; i < a->get_num_args(); ++i) {
                todo.push_back(a->get_arg(i));
            }
        }
        else if (is_var(e)) {
            var* v = to_var(e);
            unsigned index = v->get_idx();
            sort* s = v->get_sort();
            SASSERT(index < bound.size());
            index = bound.size()-1-index;
            if (!bound[index]) {
                bound[index] = s;
            }
            if (bound[index] != s) {
                return false;
            }
        }
        else {
            UNREACHABLE();
        }
    }
    return true;
}
开发者ID:CharudattaSChitale,项目名称:sygus-comp14,代码行数:45,代码来源:ast_util.cpp

示例2: get_unsat_core

void simple_check_sat_result::get_unsat_core(ptr_vector<expr> & r) { 
    if (m_status == l_false) 
        r.append(m_core.size(), m_core.c_ptr()); 
}
开发者ID:greatmazinger,项目名称:z3,代码行数:4,代码来源:check_sat_result.cpp


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