class C { method M(x: T, u: U) returns (y: T) ensures x == y && u == u; { y := x; } function F(x: X, u: U): bool { x == x && u == u } method Main(u: U) { var t := F(3,u) && F(this,u); call kz := M(t,u); assert kz && (G() || !G()); } function G(): Y; } class SetTest { method Add(s: set, x: T) returns (t: set) ensures t == s + {x}; { t := s + {x}; } method Good() { var s := {2, 5, 3}; call t := Add(s, 7); assert {5,7,2,3} == t; } method Bad() { var s := {2, 50, 3}; call t := Add(s, 7); assert {5,7,2,3} == t; // error } } class SequenceTest { method Add(s: seq, x: T) returns (t: seq) ensures t == s + [x]; { t := s + [x]; } method Good() { var s := [2, 5, 3]; call t := Add(s, 7); assert [2,5,3,7] == t; } method Bad() { var s := [2, 5, 3]; call t := Add(s, 7); assert [2,5,7,3] == t || [2,5,3] == t; } }