7 function to_int byte : int
8 meta "model_projection" function to_int
9 predicate in_range (x : int) = -128 <= x <= 127
10 axiom range_axiom : forall x:byte. in_range (to_int x)
13 val of_int (x:int) : byte
14 requires { in_range x }
15 ensures { to_int result = x }
17 val add (x y : byte) : byte
18 requires { [@expl:integer overflow] in_range (to_int x + to_int y) }
19 ensures { to_int result = to_int x + to_int y }
28 let p3 (a : byte) : byte =
35 module AbstractWithRef
41 let p3 (a : ref byte) =
42 a := add !a (of_int 1)
51 type r = {mutable f : byte; mutable g : bool}
54 if b.g then b.f <- add b.f (of_int 1)