public override void EvalCond(PathCond evalCond, IDictionary <FullCellAddr, PathCond> evalConds, List <CGCachedExpr> caches) { if (es.Length == 3) { CachedAtom atom = new CachedAtom(es[0], caches); es[0].EvalCond(evalCond, evalConds, caches); es[0] = atom.cachedExpr; es[1].EvalCond(evalCond.And(atom), evalConds, caches); es[2].EvalCond(evalCond.AndNot(atom), evalConds, caches); } }
public override void EvalCond(PathCond evalCond, IDictionary <FullCellAddr, PathCond> evalConds, List <CGCachedExpr> caches) { for (int i = 0; i < es.Length; i++) { es[i].EvalCond(evalCond, evalConds, caches); if (SHORTCIRCUIT_EVALCONDS && i != es.Length - 1) { // Take short-circuit evaluation into account for precision CachedAtom atom = new CachedAtom(es[i], caches); evalCond = evalCond.And(atom); es[i] = atom.cachedExpr; } } }
public override void EvalCond(PathCond evalCond, IDictionary <FullCellAddr, PathCond> evalConds, List <CGCachedExpr> caches) { if (es.Length >= 1) { CachedAtom atom = new CachedAtom(es[0], caches); CGCachedExpr cached = atom.cachedExpr; es[0].EvalCond(evalCond, evalConds, caches); es[0] = cached; for (int i = 1; i < es.Length; i++) { CGExpr iConst = CGConst.Make(i); CGExpr cond = new CGEqual(new CGExpr[] { cached, iConst }); es[i].EvalCond(evalCond.And(new CachedAtom(cond, caches)), evalConds, caches); } } }