-
Notifications
You must be signed in to change notification settings - Fork 1
/
table_create1.v
66 lines (60 loc) · 3.2 KB
/
table_create1.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
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.table_create1.
Require Import TableDataOpsRef1.LowSpecs.table_create1.
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
table_create_spec
.
Lemma table_create1_spec_exists:
forall habd habd' labd g_rd map_addr level g_rtt rtt_addr res
(Hspec: table_create1_spec g_rd map_addr level g_rtt rtt_addr habd = Some (habd', res))
(Hrel: relate_RData habd labd),
exists labd', table_create1_spec0 g_rd map_addr level g_rtt rtt_addr labd = Some (labd', res) /\ relate_RData habd' labd'.
Proof.
Local Opaque peq ptr_eq granule_fill_table.fill_table.
intros. duplicate Hrel. destruct D. clear hrepl lrepl. destruct g_rtt, g_rd.
unfold table_create1_spec, table_create1_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 C10.
repeat (grewrite; try simpl_htarget; simpl).
unfold create_table in *. simpl in *. autounfold in *. simpl in *. grewrite.
repeat simpl_hyp Hspec; simpl; inversion Hspec;
(eexists; split; [reflexivity| constructor; destruct Hrel; simpl; try assumption; try reflexivity]).
- rewrite_oracle_rel rel_oracle C10.
repeat (grewrite; try simpl_htarget; simpl).
unfold create_table in *. simpl in *. autounfold in *. simpl in *. grewrite.
repeat simpl_hyp Hspec; simpl; inversion Hspec;
(eexists; split; [reflexivity| constructor; destruct Hrel; simpl; try assumption; try reflexivity]).
- rewrite_oracle_rel rel_oracle C10.
repeat (grewrite; try simpl_htarget; simpl).
assert(Hwalk: repl habd (oracle habd
(EVT CPU_ID (RTT_WALK (g_rtt (gnorm (gs (share habd)) @ z0)) z1 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).
unfold create_table in *. simpl in *. autounfold in *. simpl in *. grewrite.
repeat simpl_hyp Hspec; simpl; inversion Hspec;
(eexists; split; [reflexivity| constructor; destruct Hrel; simpl; try assumption; try reflexivity]).
- rewrite_oracle_rel rel_oracle C10.
repeat (grewrite; try simpl_htarget; simpl).
inversion Hspec; (eexists; split; [reflexivity| constructor; destruct Hrel; simpl; try assumption; try reflexivity]).
- rewrite_oracle_rel rel_oracle C10.
repeat (grewrite; try simpl_htarget; simpl).
inversion Hspec; (eexists; split; [reflexivity| constructor; destruct Hrel; simpl; try assumption; try reflexivity]).
Qed.
End Refine.