public static ExtendedZ PositiveInfinity() { var pos = new ExtendedZ(); pos.PositiveInf = true; return(pos); }
public static ExtendedZ NegativeInfinity() { var nega = new ExtendedZ(); nega.NegativeInf = true; return(nega); }
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 Max(ExtendedZ left, ExtendedZ right) { if (left.PositiveInf || right.PositiveInf) { return(ExtendedZ.PositiveInfinity()); } if (left.NegativeInf) { return(right); } if (right.NegativeInf) { return(left); } return(new ExtendedZ(BigInteger.Max(left.Value, right.Value))); }
public Interval(ExtendedZ lower, ExtendedZ upper) { LowerBound = lower; UpperBound = upper; }