-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRewTrivial.ec
More file actions
25 lines (22 loc) · 843 Bytes
/
RewTrivial.ec
File metadata and controls
25 lines (22 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require import AllCore.
require RewBasics.
clone import RewBasics as RW with type sbits <- unit.
lemma no_globs_rew : forall (A <: Rew), (forall (x y : glob A), x = y) =>
islossless A.getState /\ islossless A.setState =>
exists (f : glob A -> unit), injective f /\
(forall &m, Pr[ A.getState() @ &m : (glob A) = ((glob A){m})
/\ res = f ((glob A){m} ) ] = 1%r) /\
(forall &m b (x: glob A), b = f x =>
Pr[A.setState() @ &m : glob A = x] = 1%r) /\
islossless A.setState.
proof. move => A. progress.
pose f := fun (x : glob A) => tt.
have finj : injective f. rewrite /injective. smt().
exists f. split. apply finj.
split.
move => &m. byphoare. proc*. call H0. skip. progress. apply H. auto. auto.
split.
progress.
byphoare. proc*. call H1. skip. progress. apply H. auto. auto.
apply H1.
qed.