summaryrefslogtreecommitdiff
path: root/Test/dafny0/ExistentialGuards.dfy.expect
blob: cf229553dfa1548231de4c2c8b504a309b7faa65 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Dafny program verifier version 1.9.5.20511, Copyright (c) 2003-2015, Microsoft.
// Command Line Options: -nologo -countVerificationErrors:0 -useBaseNameForFileName /dprint:- C:\dafny\Test\dafny0\ExistentialGuards.dfy
// ExistentialGuards.dfy

predicate P(n: int)

predicate R(r: real)

method M0()
{
  if x :| P(x) {
  }
}

method M1()
{
  if x: int :| P(x) {
  }
}

method M2()
{
  if x, y :| P(x) && R(y) {
  }
}

method M3()
{
  if x: int, y :| P(x) && R(y) {
  }
}

method M4()
{
  if x, y: real :| P(x) && R(y) {
  }
}

method M5()
{
  if x: int, y: real :| P(x) && R(y) {
  }
}

method M6()
{
  if x {:myattribute x, "hello"} :| P(x) {
  }
  if x, y {:myattribute y, "sveika"} :| P(x) && R(y) {
  }
  if x: int {:myattribute x, "chello"} :| P(x) {
  }
  if x {:myattribute x, "hola"} {:yourattribute x + x, "hej"} :| P(x) {
  }
}

method M7()
{
  if x :| P(x) {
  } else if * {
  } else if y :| R(y) {
  } else if y :| P(y) {
  }
}

method P0(m: int, n: int)
  requires m < n
{
  if {
    case x :| P(x) =>
    case x: int :| P(x) =>
    case x, y :| P(x) && R(y) =>
    case x: int, y :| P(x) && R(y) =>
    case m < n =>
    case x, y: real :| P(x) && R(y) =>
    case x: int, y: real :| P(x) && R(y) =>
  }
}

method P1(m: int, n: int)
  requires m < n
{
  if {
    case x {:myattribute x, "hello"} :| P(x) =>
    case x, y {:myattribute y, "sveika"} :| P(x) && R(y) =>
    case x: int {:myattribute x, "chello"} :| P(x) =>
    case x {:myattribute x, "hola"} {:yourattribute x + x, "hej"} :| P(x) =>
    case m < n =>
  }
}

Dafny program verifier finished with 22 verified, 0 errors
Compilation error: Function _module._default.P has no body
Compilation error: Function _module._default.R has no body