-
Notifications
You must be signed in to change notification settings - Fork 0
/
globals.v
88 lines (73 loc) · 2.32 KB
/
globals.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
84
85
86
87
88
Require Import syntax.
Require Import partial.
Require Import namesAndTypes.
Require Import heap.
Require Import classTable.
Require Import wf_env.
Import ConcreteEverything.
Section Globals.
Variable P : Program.
Require Import Coq.Lists.List.
Print sig.
Definition global_heap_lst (lst: varDefs) : (* Heap_type * *)Gamma_type * Env_type.
induction lst.
exact ((* p_heap.emptyPartFunc, *)p_gamma.emptyPartFunc, p_env.emptyPartFunc).
destruct IHlst.
(* destruct p. *)
destruct a.
rename c into C.
(* rename h into H. *)
rename e into L.
rename p into Gamma.
(* set (o_fresh := ConcreteNamesAndTypes.vn.constructFresh (p_heap.domain H)). *)
(* destruct o_fresh as [o o_fresh_proof]. *)
(* set (flds := fieldsList P C). *)
(* set (FM := p_FM.newPartFunc flds FM_null). *)
(* set (heapVal := obj C FM). *)
split.
(* split. *)
(* exact (p_heap.updatePartFunc H o heapVal ). *)
exact (p_gamma.updatePartFunc Gamma v (typt_class C)).
exact (p_env.updatePartFunc L v envNull).
Defined.
Definition globalEnv (P: Program) : (* Heap_type * *)Gamma_type * Env_type :=
global_heap_lst (globals P).
(* Theorem WF_globals: *)
(* let (p, L) := globalEnv P in let (H, Gamma) := p in WF_Env P H Gamma L. *)
(* destruct P. *)
(* set (P' := {| *)
(* classDecls := classDecls; *)
(* globals := globals; *)
(* programBody := programBody; *)
(* programBodyIsTerm := programBodyIsTerm |}). *)
(* unfold globalEnv. *)
(* induction (syntax.globals P'). *)
(* simpl. *)
(* split. *)
(* intro. *)
(* intro. *)
(* simpl in H. *)
(* elim H. *)
(* intros. *)
(* simpl in H. *)
(* simplify_eq H. *)
(* case_eq (global_heap_lst v). *)
(* intros. *)
(* destruct p. *)
(* rename H into hyp. *)
(* rename h into H; rename p into Gamma; rename e into L. *)
(* simpl. *)
(* rewrite hyp. *)
(* destruct a. *)
(* rename c into C. *)
(* rename v0 into x. *)
(* rename v into rest. *)
(* case_eq (ConcreteNamesAndTypes.vn.constructFresh (p_heap.domain H)). *)
(* intros o o_fresh. *)
(* intro dummy; clear dummy. *)
(* split. *)
(* rewrite hyp in IHv. *)
(* destruct IHv. *)
(* apply subset_preserved. *)
(* assumption. *)
End Globals.