void VisitFunction( const SymbolicFunction &v) { if (target.GetValType() == VAL_FUNCTION && cur == target) result = true; else { for (SymbolicFunction::const_iterator p = v.args_begin(); p != v.args_end(); ++p) { SymbolicVal tmp = *p; cur = tmp; cur.Visit(this); if ( result) break; } } }
void VisitExpr( const SymbolicExpr &v) { if (target.GetValType() == VAL_EXPR && cur == target) result = true; else { for (SymbolicExpr::OpdIterator iter = v.GetOpdIterator(); !iter.ReachEnd(); iter.Advance()) { SymbolicVal tmp = v.Term2Val(iter.Current()); cur = tmp; cur.Visit(this); if (result) break; } } }
void Default0( const SymbolicVal &v1, const SymbolicVal &v2) { Default1(v1,v2); if (DebugCompareVal()) std::cerr << " in CompareOperator::Default \n"; if (result == REL_UNKNOWN) { int tmp = comparetime; SymbolicVal diff = v1 - v2; comparetime = tmp; if (diff.GetValType() == VAL_CONST) { int diffval = atoi( diff.toString().c_str()); if (diffval < 0) result = REL_LT; else if (diffval > 0) result = REL_GT; else result = REL_EQ; } else if (func != 0) { int tmp = comparetime; SymbolicBound b1 = GetValBound(v1,*func), b2 = GetValBound(v2,*func); comparetime = tmp; CompareRel ge1 = (b1.lb != v1)? CompareValHelp(b1.lb,v2,func) : REL_UNKNOWN; CompareRel le2 = (b2.ub != v2)? CompareValHelp(b2.ub,v1,func) : REL_UNKNOWN; CompareRel le1 = (b1.ub != v1)? CompareValHelp(b1.ub,v2,func) : REL_UNKNOWN; CompareRel ge2 = (b2.lb != v2)? CompareValHelp(b2.lb,v1,func) : REL_UNKNOWN; if (CountGT(ge1) || CountLT(le2)) result = REL_GT; else if (CountGE(ge1) || CountLE(le2)) result = REL_GE; else if (CountLT(le1) || CountGT(ge2)) result = REL_LT; else if (CountLE(le1) || CountGE(ge2)) result = REL_LE; } } }