Created
March 11, 2013 01:09
-
-
Save jbranchaud/5131286 to your computer and use it in GitHub Desktop.
Exercise 0 from Microsoft's Dafny tutorial on Rise4Fun.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Write a method Max that takes two integer parameters and returns | |
* their maximum. Add appropriate annotations and make sure your code | |
* verifies. | |
*/ | |
method Max(a: int, b:int) returns (c: int) | |
ensures c >= a && c >= b; | |
{ | |
if (a > b) { | |
return a; | |
} | |
else { | |
return b; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment