本文整理汇总了C++中Solver::GetBitTerms方法的典型用法代码示例。如果您正苦于以下问题:C++ Solver::GetBitTerms方法的具体用法?C++ Solver::GetBitTerms怎么用?C++ Solver::GetBitTerms使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Solver
的用法示例。
在下文中一共展示了Solver::GetBitTerms方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetTest
void CheckerPropagate::SetTest(Bit *safe_bit)
{
Assert(!m_where);
Vector<Exp*> safe_terms;
Solver *solver = m_frame->State()->GetSolver();
solver->GetBitTerms(m_frame->Id(), safe_bit, &safe_terms);
SortVector< Exp*, SortObjectsCompare<Exp> >(&safe_terms);
// setup the initial where info in a pass over the whole bit. the bit might
// be outright ignored or we might be forced to go to the caller because
// of an ExpFrame subexpression.
PropagateScanVisitor visitor;
safe_bit->DoVisit(&visitor);
if (visitor.ignore)
m_where = new WhereNone(RK_None);
else if (visitor.has_frame)
m_where = WherePrecondition::Make(m_frame->Memory(), safe_bit);
// try to find a direction which accomodates all terms in the bit.
for (size_t ind = 0; ind < safe_terms.Size(); ind++) {
Where *new_where = TryPropagate(safe_bit, safe_terms[ind]);
if (new_where) {
if (m_where) {
// replace with the new direction only if it has higher priority.
int priority = Where::PriorityCompare(new_where, m_where);
if (priority < 0) {
delete m_where;
m_where = new_where;
}
else {
delete new_where;
}
}
else {
m_where = new_where;
}
}
}
if (!m_where) {
if (!safe_terms.Empty()) {
// couldn't find a way to propagate from this point, generate Unexpected.
m_where = new WhereNone(RK_Unexpected);
}
else {
// nowhere to go from here.
m_where = new WhereNone(RK_Finished);
}
}
DecRefVector<Exp>(safe_terms, &safe_terms);
}
示例2: SetBaseBit
void CheckerPropagate::SetBaseBit(Bit *base_bit, Bit *point_bit)
{
Assert(!m_base_bit);
Assert(!m_point_bit);
base_bit->IncRef(this);
m_base_bit = base_bit;
point_bit->IncRef(this);
m_point_bit = point_bit;
Solver *solver = m_frame->State()->GetSolver();
solver->GetBitTerms(m_frame->Id(), point_bit, &m_point_terms);
SortVector< Exp*, SortObjectsCompare<Exp> >(&m_point_terms);
}