File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ require import Real Int.
2+
3+ module M = {
4+ var b: bool
5+
6+ proc run () = {
7+ M.b <- false ;
8+ }
9+ }.
10+
11+ lemma dep_bound : phoare[M.run : M.b ==> !M.b] = (b2i M.b)%r.
12+ proof. by proc; auto => &hr ->. qed.
13+
14+ equiv triv_equiv : M.run ~ M.run : true ==> ={M.b }.
15+ proof. proc; auto . qed.
16+
17+ lemma bad_bound : phoare[M.run : true ==> !M.b] = (b2i M.b)%r.
18+ proof.
19+ conseq triv_equiv dep_bound => // =.
20+ move => &1 .
21+ fail smt ().
22+ abort.
23+
24+ lemma dep_bound_conseq :
25+ phoare[M.run : !M.b ==> !M.b] = (1 -b2i M.b)%r.
26+ proof.
27+ conseq triv_equiv dep_bound => // =.
28+ move => &1 -> /=.
29+ by exists true => />.
30+ qed.
31+
32+ lemma nodep_bound : phoare[M.run: true ==> true] = 1%r.
33+ proof. proc; auto . qed.
34+
35+ lemma nodep_bound_conseq :
36+ phoare[M.run : !M.b ==> !M.b] = 1 %r.
37+ proof.
38+ conseq triv_equiv dep_bound => // =.
39+ move => &1 /> _.
40+ by exists true .
41+ qed.
42+
You can’t perform that action at this time.
0 commit comments