-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into quantified-magic-wand-maps
- Loading branch information
Showing
4 changed files
with
160 additions
and
5 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Any copyright is dedicated to the Public Domain. | ||
// http://creativecommons.org/publicdomain/zero/1.0/ | ||
|
||
|
||
function f1(i: Int): Int | ||
decreases i | ||
requires i > -2 | ||
{ | ||
i > 0 ? 1 + f1(i - 1) : 0 | ||
} | ||
|
||
function f2(i: Int): Int | ||
decreases i | ||
{ | ||
i > 0 ? 1 + f2(i - 1) : 0 | ||
} | ||
|
||
function f3(i: Int): Int | ||
decreases i | ||
ensures result >= 0 | ||
{ | ||
i > 0 ? 1 + f3(i - 1) : 0 | ||
} | ||
|
||
function f4(i: Int): Int | ||
ensures result >= 0 | ||
decreases _ | ||
{ | ||
i > 0 ? 1 + f4(i - 1) : 0 | ||
} | ||
|
||
function f5(i: Int): Int | ||
requires i > -2 | ||
decreases i | ||
ensures result >= 0 | ||
{ | ||
i > 0 ? 1 + f5(i - 1) : 0 | ||
} | ||
|
||
domain t { | ||
function fAlias1(Int): Int | ||
function fAlias2(Int): Int | ||
function fAlias3(Int): Int | ||
function fAlias4(Int): Int | ||
function fAlias5(Int): Int | ||
|
||
axiom { | ||
//:: ExpectedOutput(typechecker.error) | ||
forall i: Int :: f1(i) == fAlias1(i) | ||
} | ||
|
||
axiom { | ||
forall i: Int :: f2(i) == fAlias2(i) | ||
} | ||
|
||
axiom { | ||
forall i: Int :: f3(i) == fAlias3(i) | ||
} | ||
|
||
axiom { | ||
forall i: Int :: f4(i) == fAlias4(i) | ||
} | ||
|
||
axiom { | ||
//:: ExpectedOutput(typechecker.error) | ||
forall i: Int :: f5(i) == fAlias5(i) | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Any copyright is dedicated to the Public Domain. | ||
// http://creativecommons.org/publicdomain/zero/1.0/ | ||
|
||
define m1(res) { | ||
res := var_m2 | ||
} | ||
|
||
define m2(res) { | ||
var var_m2: Int | ||
|
||
var v0_1: Int | ||
{ | ||
m1(v0_1) | ||
} | ||
|
||
res := var_m2 | ||
} | ||
|
||
method caller() returns (value: Int) | ||
{ | ||
var res: Int | ||
{ | ||
m2(res) | ||
} | ||
var value2: Int | ||
{ | ||
m2(res) | ||
} | ||
value := res | ||
} |