Complete this form and hit the "Save Changes" button!
4 ratings
Are you sure you want to delete this code? Please type DELETE in the box below to confirm.
Are you sure you want to verify this code?
Are you sure you want to publish this code?
Are you sure you want to unpublish this code?
Are you sure you want to autogenerate the summary + description for this code?
xxxxxxxxxx
function Average (a: int, b: int): int
{
(a + b) / 2
}
method TripleConditions(x: int) returns (r: int)
ensures r == 3 * x
r := 3 * x;
assert r == 3 * x;
method Triple' (x: int) returns (r: int)
ensures Average(r, 3 * x) == 3 * x
r:= 3 * x;
method ProveSpecificationsEquivalent(x: int) {
var result1 := TripleConditions(x);
var result2 := Triple'(x);
assert result1 == result2;