Safety Property: TarLimitReadWrite



property TarLimitReadWrite {
   requires TrackTotalBytesReadTrackTotalBytesWritten;
   check RFileSystem.preWrite (file: RFile, n: int) {
     if (RFileSystem.bytes_written + n 
         > ((RFileSystem.bytes_read * 2) + 12000)) {
       violation 
         ("Write limit exceeded. Should not be more than 2 * read + 12000. " +
          "Read: " + RFileSystem.bytes_read + ", attempting to write " +
          n + ", already written " + RFileSystem.bytes_written + ".");
     }
   }
}

About this file

Naccio Home Page
David Evans
University of Virginia, Computer Science