summaryrefslogtreecommitdiff
path: root/Test/dafny0/AutoReq.dfy
diff options
context:
space:
mode:
authorGravatar leino <unknown>2014-12-12 20:46:48 -0800
committerGravatar leino <unknown>2014-12-12 20:46:48 -0800
commit91c4d57eb84d5d15e011902a1da1b70131e5a222 (patch)
tree6794bafdc71f6bc31c8d09496c3435658bbfc144 /Test/dafny0/AutoReq.dfy
parent62a3e97eb61cbee0d523297ccad1f2d3bcf871c3 (diff)
Language change: All functions and methods declared lexically outside any class are now
automatically static, and fields are no longer allowed to be declared there. Stated differently, all heap state must now be declared inside an explicitly declared class, and functions and methods declared outside any class can be viewed as belonging to the module. The motivating benefit of this change is to no longer need the 'static' keyword when declaring a module of functions and methods.
Diffstat (limited to 'Test/dafny0/AutoReq.dfy')
-rw-r--r--Test/dafny0/AutoReq.dfy16
1 files changed, 8 insertions, 8 deletions
diff --git a/Test/dafny0/AutoReq.dfy b/Test/dafny0/AutoReq.dfy
index 9e0d3b63..99e8298e 100644
--- a/Test/dafny0/AutoReq.dfy
+++ b/Test/dafny0/AutoReq.dfy
@@ -270,44 +270,44 @@ module Matches {
// Make sure :autoReq works with static functions
module StaticTest {
- static function f(x:int) : bool
+ function f(x:int) : bool
requires x > 3;
{
x > 7
}
- static function {:autoReq} g(z:int) : bool
+ function {:autoReq} g(z:int) : bool
requires f(z);
{
true
}
// Should succeed thanks to auto-generation based on f's requirements
- static function {:autoReq} h(y:int) : bool
+ function {:autoReq} h(y:int) : bool
{
g(y)
}
- static predicate IsEven(x:int)
+ predicate IsEven(x:int)
- static function EvenDoubler(x:int) : int
+ function EvenDoubler(x:int) : int
requires IsEven(x);
// Should succeed thanks to auto-generated requirement of IsEven
- static function {:autoReq} test(y:int) : int
+ function {:autoReq} test(y:int) : int
{
EvenDoubler(y)
}
}
module OpaqueTest {
- static function bar(x:int) : int
+ function bar(x:int) : int
requires x>7;
{
x-2
}
- static function {:autoReq} {:opaque} foo(x:int) : int
+ function {:autoReq} {:opaque} foo(x:int) : int
{
bar(x)
}