private IADomain ReadTransfer(ReadStmt readStmt, IADomain domain) { var newDomain = CopyDomain(domain); if (domain.IsBottom()) { return(newDomain); } var ident = readStmt.Left switch { VarAccess varAccess => varAccess.Left, ArrayAccess arrayAccess => arrayAccess.Left, RecordAccess recordAccess => recordAccess.Right, }; if (readStmt.Left is ArrayAccess) { var ra = readStmt.Left as ArrayAccess; var indexInterval = IAUtil.Arithmetic(ra.Right, domain); if (indexInterval.IsBottom) { return(Bottom().GetDomain()); } } newDomain[ident] = new Interval(ExtendedZ.NegativeInfinity(), ExtendedZ.PositiveInfinity()).ToIntervalK(_program); return(newDomain); }
public static ExtendedZ Min(ExtendedZ left, ExtendedZ right) { if (left.NegativeInf || right.NegativeInf) { return(ExtendedZ.NegativeInfinity()); } if (left.PositiveInf) { return(right); } if (right.PositiveInf) { return(left); } return(new ExtendedZ(BigInteger.Min(left.Value, right.Value))); }