Skip to content

Commit 0415b03

Browse files
authored
closing: Adding a test while closing issue #370 as out of scope (#793)
1 parent 308f10f commit 0415b03

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

Test/git-issues/git-issue-370.dfy

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// RUN: %dafny /compile:0 "%s" > "%t"
2+
// RUN: %diff "%s.expect" "%t"
3+
4+
datatype T = T(x: int)
5+
datatype S = S(u: int, v: int, w: int, x: int, y: int, z: int)
6+
7+
predicate a(t: T)
8+
predicate b(t: T)
9+
predicate c(t: T)
10+
predicate d(t: T)
11+
predicate e(t: T)
12+
predicate f(t: T)
13+
predicate g(t: T)
14+
15+
predicate WellFormed(t: T) {
16+
&& a(t)
17+
}
18+
19+
function Func(t: T) : S
20+
requires WellFormed(t)
21+
{
22+
S(t.x, t.x, t.x, t.x, t.x, t.x)
23+
}
24+
25+
predicate Good(s: S) {
26+
&& s.u == 5
27+
&& s.v == 5
28+
&& s.w == 5
29+
&& s.x == 5
30+
&& s.y == 5
31+
&& s.z == 5
32+
}
33+
34+
function {:opaque} GetT() : T {
35+
T(5)
36+
}
37+
38+
lemma foo()
39+
ensures var t := GetT();
40+
&& WellFormed(t)
41+
&& Good(Func(t))
42+
{
43+
reveal_GetT();
44+
}
45+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
git-issue-370.dfy(42,0): Error BP5003: A postcondition might not hold on this return path.
2+
git-issue-370.dfy(40,7): Related location: This is the postcondition that might not hold.
3+
git-issue-370.dfy(16,5): Related location
4+
Execution trace:
5+
(0,0): anon0
6+
git-issue-370.dfy(42,0): Error BP5003: A postcondition might not hold on this return path.
7+
git-issue-370.dfy(41,7): Related location: This is the postcondition that might not hold.
8+
git-issue-370.dfy(26,9): Related location
9+
Execution trace:
10+
(0,0): anon0
11+
git-issue-370.dfy(42,0): Error BP5003: A postcondition might not hold on this return path.
12+
git-issue-370.dfy(41,7): Related location: This is the postcondition that might not hold.
13+
git-issue-370.dfy(27,9): Related location
14+
Execution trace:
15+
(0,0): anon0
16+
git-issue-370.dfy(42,0): Error BP5003: A postcondition might not hold on this return path.
17+
git-issue-370.dfy(41,7): Related location: This is the postcondition that might not hold.
18+
git-issue-370.dfy(28,9): Related location
19+
Execution trace:
20+
(0,0): anon0
21+
git-issue-370.dfy(42,0): Error BP5003: A postcondition might not hold on this return path.
22+
git-issue-370.dfy(41,7): Related location: This is the postcondition that might not hold.
23+
git-issue-370.dfy(29,9): Related location
24+
Execution trace:
25+
(0,0): anon0
26+
27+
Dafny program verifier finished with 3 verified, 5 errors

0 commit comments

Comments
 (0)