-
Notifications
You must be signed in to change notification settings - Fork 1
/
data_create_unknown1.v
84 lines (78 loc) · 4.03 KB
/
data_create_unknown1.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Require Import RefProofDeps.
Require Import RData.
Require Import EventReplay.
Require Import MoverTypes.
Require Import Constants.
Require Import CommonLib.
Require Import RefTactics.
Require Import TableDataOpsIntro.Spec.
Require Import TableDataOpsRef1.Specs.data_create_unknown1.
Require Import TableDataOpsRef1.LowSpecs.data_create_unknown1.
Require Import TableDataOpsRef1.RefProof.RefRel.
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 Refine.
Hint Unfold
data_create_spec
data_create_unknown_spec
.
Lemma data_create_unknown1_spec_exists:
forall habd habd' labd g_rd data_addr map_addr g_data res
(Hspec: data_create_unknown1_spec g_rd data_addr map_addr g_data habd = Some (habd', res))
(Hrel: relate_RData habd labd),
exists labd', data_create_unknown1_spec0 g_rd data_addr map_addr g_data labd = Some (labd', res) /\ relate_RData habd' labd'.
Proof.
Local Opaque peq ptr_eq.
intros. duplicate Hrel. destruct D. clear hrepl lrepl. destruct g_data, g_rd.
unfold data_create_unknown1_spec, data_create_unknown1_spec0 in *.
unfold Assertion in *. rm_bind Hspec; rm_bind'. simpl in *.
unfold Assertion; rm_bind'; grewrite.
repeat simpl_hyp Hspec; extract_prop_dec; simpl_query_oracle; rm_bind'; grewrite.
- rewrite_oracle_rel rel_oracle C.
repeat (grewrite; try simpl_htarget; simpl).
assert(Hwalk: repl habd (oracle habd
(EVT CPU_ID (RTT_WALK (g_rtt (gnorm (gs (share habd)) @ z1)) z2 1) :: oracle habd (log habd) ++ log habd)) s0 = Some s0).
destruct Hrel. grewrite. destruct valid_ho0. rewrite Hright_log_nil. reflexivity.
eapply RightLogMover.
apply walk_right. omega. omega. apply RightLogOracle.
rewrite_oracle_rel rel_oracle Hwalk; simpl in *.
repeat (grewrite; try simpl_htarget; simpl).
rewrite_oracle_rel rel_oracle C5; simpl in *.
repeat (grewrite; try simpl_htarget; simpl).
inversion Hspec. eexists; split. reflexivity.
constructor; destruct Hrel; simpl; try assumption; try reflexivity.
- rewrite_oracle_rel rel_oracle C.
repeat (grewrite; try simpl_htarget; simpl).
assert(Hwalk: repl habd (oracle habd
(EVT CPU_ID (RTT_WALK (g_rtt (gnorm (gs (share habd)) @ z1)) z2 1) :: oracle habd (log habd) ++ log habd)) s0 = Some s0).
destruct Hrel. grewrite. destruct valid_ho0. rewrite Hright_log_nil. reflexivity.
eapply RightLogMover.
apply walk_right. omega. omega. apply RightLogOracle.
rewrite_oracle_rel rel_oracle Hwalk; simpl in *.
repeat (grewrite; try simpl_htarget; simpl).
rewrite_oracle_rel rel_oracle C5; simpl in *.
repeat (grewrite; try simpl_htarget; simpl).
inversion Hspec. eexists; split. reflexivity.
constructor; destruct Hrel; simpl; try assumption; try reflexivity.
- rewrite_oracle_rel rel_oracle C5.
repeat (grewrite; try simpl_htarget; simpl).
assert(Hwalk: repl habd (oracle habd
(EVT CPU_ID (RTT_WALK (g_rtt (gnorm (gs (share habd)) @ z1)) z2 1) :: oracle habd (log habd) ++ log habd)) s = Some s).
destruct Hrel. grewrite. destruct valid_ho0. rewrite Hright_log_nil. reflexivity.
eapply RightLogMover.
apply walk_right. omega. omega. apply RightLogOracle.
rewrite_oracle_rel rel_oracle Hwalk; simpl in *.
repeat (grewrite; try simpl_htarget; simpl).
inversion Hspec. eexists; split. reflexivity.
constructor; destruct Hrel; simpl; try assumption; try reflexivity.
- rewrite_oracle_rel rel_oracle C5.
repeat (grewrite; try simpl_htarget; simpl).
inversion Hspec. eexists; split. reflexivity.
constructor; destruct Hrel; simpl; try assumption; try reflexivity.
- rewrite_oracle_rel rel_oracle C5.
repeat (grewrite; try simpl_htarget; simpl).
inversion Hspec. eexists; split. reflexivity.
constructor; destruct Hrel; simpl; try assumption; try reflexivity.
Qed.
End Refine.