summaryrefslogtreecommitdiff
path: root/Test/dafny0/Modules1.dfy
diff options
context:
space:
mode:
authorGravatar Rustan Leino <unknown>2013-07-29 14:35:27 -0700
committerGravatar Rustan Leino <unknown>2013-07-29 14:35:27 -0700
commit059ee1934382d1f2332b478d79b8a364ce8a002e (patch)
tree961592fb7b7c5f7e352e132034d1fb4dded021a3 /Test/dafny0/Modules1.dfy
parentfb6c171957142ce6119a7363d3cec66799b9966a (diff)
Make functions and predicates be opaque outside the defining module -- only their specifications (e.g., ensures clauses) are exported.
Diffstat (limited to 'Test/dafny0/Modules1.dfy')
-rw-r--r--Test/dafny0/Modules1.dfy5
1 files changed, 3 insertions, 2 deletions
diff --git a/Test/dafny0/Modules1.dfy b/Test/dafny0/Modules1.dfy
index 1f47f3b1..e9c432f3 100644
--- a/Test/dafny0/Modules1.dfy
+++ b/Test/dafny0/Modules1.dfy
@@ -64,6 +64,7 @@ method Botch1(x: int)
module A_Visibility {
class C {
static predicate P(x: int)
+ ensures P(x) ==> -10 <= x;
{
0 <= x
}
@@ -84,8 +85,8 @@ module B_Visibility {
method Main() {
var y;
if (A.C.P(y)) {
- assert 0 <= y; // this much is known of C.P
- assert 2 <= y; // error
+ assert -10 <= y; // this much is known of C.P
+ assert 0 <= y; // error
} else {
assert A.C.P(8); // error: C.P cannot be established outside the declaring module
}