Program Verification using JML and ESC/Java2
Erik Poll
Radboud University Nijmegen
– p.1/36
Program Verification using JML and ESC/Java2 Erik Poll Radboud - - PowerPoint PPT Presentation
Program Verification using JML and ESC/Java2 Erik Poll Radboud University Nijmegen p.1/36 Outline of this tutorial formal specifcation language JML program verification using ESC/Java2 p.2/36 The Java Modeling Language JML
Radboud University Nijmegen
– p.1/36
– p.2/36
– p.3/36
– p.4/36
– p.5/36
– p.6/36
– p.7/36
– p.8/36
– p.9/36
– p.10/36
– p.11/36
– p.12/36
– p.13/36
– p.14/36
– p.15/36
– p.16/36
– p.17/36
//@ invariant 0<=getBalance() && getBalance()<=MAX_BALANCE;
– p.18/36
– p.19/36
– p.20/36
– p.21/36
Eg, “Invariant violated in line 8000” after 1 minute instead of “NullPointerException in line 2000” after 4 minutes
– p.22/36
jmlrac even checks \forall if the domain of quantification is finite.
– p.23/36
– p.24/36
– p.25/36
– p.26/36
– p.27/36
– p.28/36
– p.29/36
– p.30/36
– p.31/36
– p.32/36
– p.33/36
– p.34/36
/*@ requires 0 < n; @ ensures \result == @ (\exists int x,y,z; @ pow(x,n)+pow(y,n) == pow(z,n)); @*/ public static boolean fermat(double n) { return (n==2); }
(Typically, the theorem prover times out in complicated cases.)
– p.35/36
– p.36/36