示例#1
0
bool
SValue::may_equal(const BaseSemantics::SValuePtr &other_, const SmtSolverPtr &solver) const 
{
    SValuePtr other = SValue::promote(other_);
    for (size_t i=0; i<subvalues.size(); ++i) {
        if (is_valid(i) && other->is_valid(i) && get_subvalue(i)->may_equal(other->get_subvalue(i), solver))
            return true;
    }
    return false;
}
示例#2
0
bool
SValue::must_equal(const BaseSemantics::SValuePtr &other_, const SmtSolverPtr &solver) const
{
    SValuePtr other = SValue::promote(other_);
    size_t nconsidered = 0;
    for (size_t i=0; i<subvalues.size(); ++i) {
        if (is_valid(i) && other->is_valid(i)) {
            if (!get_subvalue(i)->must_equal(other->get_subvalue(i), solver))
                return false;
            ++nconsidered;
        }
    }
    return nconsidered>0;
}