summaryrefslogtreecommitdiff
path: root/Test/dafny0/DirtyLoops.dfy
blob: 5d356f0a51ed632f57be7acd50c7cfde000845fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// RUN: %dafny /compile:0 /dprint:"%t.dprint.dfy" "%s" > "%t"; %dafny /noVerify /compile:0 "%t.dprint.dfy" >> "%t"
// RUN: %diff "%s.expect" "%t"

method M0(S: set<int>) {
  forall s | s in S ensures s < 0;
}

method M1(x: int)
{
  var i := x;
  while (0 < i)
    invariant i <= x;
}

method M2(x: int)
{
  var i := x;
  while (0 < i)
    invariant i <= x;
    decreases i;
}