Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/language-annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ To make the definition of an opaque function available at a *specific* applicati
```viper,editable,playground
@opaque()
function fac(i: Int): Int
ensures result >= 1
{
i <= 1 ? 1 : i * fac(i - 1)
}

method opaqueClient()
{
var x: Int := fac(3)
// The postcondition of fac is known, so the following assertion succeeds.
assert x >= 1
// The definition of fac is hidden, so the following assertion
// fails, even though it is true.
assert x == 6
assert x == 3 * fac(2)
}

method revealClient()
Expand Down
Loading