blob: 5ac432870f97c3fbf9229545e34298db7df0e126 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// types
type Color;
const unique red: Color;
const unique blue: Color;
const unique green: Color;
axiom (forall ce:Color :: ce==red || ce==blue || ce==green);
var myColor: Color;
// procedure
procedure SetTo(c: Color);
modifies myColor
;
ensures myColor==c;
implementation SetTo(c: Color) {
assert (blue==green);
myColor:=blue;
}
|