Safety Property: LimitBytesWrittenSimple

property LimitBytesWrittenSimple (limit: int) { 
   requires TrackTotalBytesWritten;

   check RFileSystem.preWrite (file: RFile, n: int) {
       if (bytes_written + n > limit) {
         violation 
           ("Attempt to write more than " + limit + 
            " bytes. Writing " + n + ".");
       }
   }
}

About this file

Naccio Home Page
David Evans
University of Virginia, Computer Science