blob: 980054ee64433bd909078c1877dded538ce8d932 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
// RUN: %dafny /compile:0 /print:"%t.print" /dprint:"%t.dprint" "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
trait T1
{
function method Plus (x:int, y:int) : int
requires x>y;
{
x + y
}
function method bb(x:int):int
requires x>10;
function method BodyLess1(a:int) : int
requires a > 0;
function method dd(a:int) : int
method Testing()
}
class C1 extends T1
{
function method dd(x:int):int
{
2
}
method Testing()
{
var x:int := 11;
x := bb(x);
}
function method bb(x:int):int
requires x >10;
{
x
}
function method BodyLess1(bda:int) : int
requires bda > (-10);
{
2
}
method CallBodyLess(x:int)
requires x > (-10);
{
var k:int := BodyLess1(x);
assert (k==2);
}
}
|