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
|
// RUN: %dafny /compile:3 "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method M1()
{
var m := map [{10, 20} := 33];
assert {10, 20} in m; // succeeds
print {10, 20} in m, "\n"; // prints False
}
method M1'()
{
var m := map [{10, 20} := 33];
assert {10, 20} == {20, 10};
assert {20, 10} in m; // succeeds
print {20, 10} in m, "\n"; // prints False
}
method M2()
{
var m := map [(map [1 := 10, 2 := 20]) := 33];
assert (map [1 := 10, 2 := 20]) in m; // succeeds
print (map [1 := 10, 2 := 20]) in m, "\n"; // prints False
}
method M2'()
{
var m := map [(map [1 := 10, 2 := 20]) := 33];
assert (map [1 := 10, 2 := 20] == map [2 := 20, 1 := 10]);
assert (map [2 := 20, 1 := 10]) in m; // succeeds
print (map [2 := 20, 1 := 10]) in m, "\n"; // prints False
}
method M3()
{
var m := map [(multiset{10, 20}) := 33];
assert (multiset{10, 20}) in m; // succeeds
print (multiset{10, 20}) in m, "\n"; // prints False
}
method M3'()
{
var m := map [(multiset{10, 20}) := 33];
assert multiset{10, 20} == multiset{20, 10};
assert (multiset{20, 10}) in m; // succeeds
print (multiset{20, 10}) in m, "\n"; // prints False
}
method M4()
{
var m := map [[10, 20] := 33];
assert [10, 20] in m; // succeeds
print [10, 20] in m, "\n"; // prints False
}
method Main()
{
M1();
M1'();
M2();
M2'();
M3();
M3'();
M4();
}
|