Merge branch 'minimum-excludant-other-versions' into 'master'
[why3.git] / bench / infer / support3.mlw
blob0d9cafade93d2e27927f497b03b1f2d863d2fc11
1 module Example_scan
4 use export ref.Ref
5 use export bool.Bool
6 use export int.Int
9 val foo (input : bool) (tgt : ref int) : unit
10 writes { tgt }
11 (* This does not work *)
12 ensures { andb input (old !tgt = 42) -> (!tgt = 0) }
13 (* But this is OK
14 ensures { (old !tgt = 42) -> (!tgt = 0) }
15 and this also
16 ensures { input && (old !tgt = 42) -> (!tgt = 0) }
19 (**********************************************************************************)
21 val d0 [@model] [@model_trace:D0] : ref int
23 let example_scan [@bddinfer] ()
24   diverges
25   =
26   while True do
27         foo true d0
28   done
30 end