-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtable_map3.v
61 lines (55 loc) · 2.61 KB
/
table_map3.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
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 TableDataOpsRef2.Spec.
Require Import TableDataOpsRef3.Specs.table_map3.
Require Import TableDataOpsRef3.LowSpecs.table_map3.
Require Import TableDataOpsRef3.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_map_spec
table_map2_spec
.
Lemma table_map3_spec_exists:
forall habd habd' labd g_rd map_addr level res
(Hspec: table_map3_spec g_rd map_addr level habd = Some (habd', res))
(Hrel: relate_RData habd labd),
exists labd', table_map3_spec0 g_rd map_addr level labd = Some (labd', res) /\ relate_RData habd' labd'.
Proof.
Local Opaque peq ptr_eq.
intros. duplicate Hrel. destruct D. clear hrepl lrepl. destruct g_rd.
unfold table_map3_spec, table_map3_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 C5.
repeat (grewrite; try simpl_htarget; simpl).
unfold map_table in *. simpl in *. autounfold in *. simpl in *. grewrite.
repeat simpl_hyp Hspec; simpl; inversion Hspec; clear H0; grewrite;
(eexists; split; [reflexivity| constructor; destruct Hrel; simpl; try assumption; try reflexivity]).
- rewrite_oracle_rel rel_oracle C5.
repeat (grewrite; try simpl_htarget; simpl).
unfold map_table in *. simpl in *. autounfold in *. simpl in *. grewrite.
repeat simpl_hyp Hspec; simpl; inversion Hspec; clear H0; grewrite;
(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.
- 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.