[Wing95], which provides several hints to specifiers.
Topics
Specifying and verifying programs in high-level programming languages.
Introduction to Dafny. Main features.
Method contracts in Dafny.
Specifying pre and post-conditions.
Compositional verification of methods through the use of contracts.
Example: Absolute value
methodabs(x:int)returns(y:int)ensures0<=x==>x==yensures0>x==>-x==y{ifx<0{return-x;}else{returnx;}}methodMain(){varx:=-3;varn:=abs(x);assertn>=0;print"Absolute value of ",x,": ",n,"\n";}