Exemplo n.º 1
0
  /*@Pure*/
  public /*@Nullable*/ DiscardInfo isObviousDynamically(VarInfo[] vis) {

    // Do not show x-1 = a (mod b).  There must be a different mod
    // invariant over x.  JHP: This should really find the invariant rather
    // than presuming it is true.
    VarInfo x = vis[0];
    if ((x.derived instanceof SequenceLength) && (((SequenceLength) x.derived).shift != 0)) {
      return (new DiscardInfo(
          this,
          DiscardCode.obvious,
          "The invariant "
              + format()
              + " is implied by a mod invariant "
              + "over "
              + x.name()
              + " without the offset"));
    }
    return (null);
  }