-
Notifications
You must be signed in to change notification settings - Fork 1
/
RefRel.v
37 lines (32 loc) · 1.07 KB
/
RefRel.v
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
26
27
28
29
30
31
32
33
34
35
36
37
Require Import RefProofDeps.
Require Import RData.
Require Import EventReplay.
Require Import MoverTypes.
Require Import Constants.
Require Import CommonLib.
Local Open Scope string_scope.
Local Open Scope Z_scope.
Local Opaque Z.add Z.mul Z.div Z.shiftl Z.shiftr Z.land Z.lor.
Section RefineRel.
Record relate_RData (hadt: RData) (ladt: RData) :=
mkrelate_RData {
id_priv: priv ladt = priv hadt;
id_share: share ladt = share hadt;
hrepl: repl hadt = replay 2;
lrepl: repl ladt = replay 1;
valid_ho: ValidOracle 2 (oracle hadt);
valid_lo: ValidOracle 1 (oracle ladt);
rel_oracle: forall st st' l l',
let lh := oracle hadt l in
let lo := oracle ladt l' in
st = st' -> repl ladt lo st = repl hadt lh st'
}.
End RefineRel.
Ltac rewrite_oracle_rel R H :=
match type of H with
| repl ?habd (oracle ?habd ?l) ?st = _ =>
match goal with
| [ |- context[repl ?labd (oracle ?labd ?l') st]] =>
rewrite (R st st l l'); [rewrite H|reflexivity]
end
end.