Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
175 commits
Select commit Hold shift + click to select a range
c539a39
WIP
dongjaelee1 Mar 28, 2023
8661f90
resolved admit
dongjaelee1 Mar 29, 2023
5811d57
proved switch related lemmas
dongjaelee1 Mar 30, 2023
7fe40a5
WIP
dongjaelee1 Mar 30, 2023
aa0d40b
WIP
dongjaelee1 Mar 30, 2023
88902bc
WIP - program from trace
dongjaelee1 Mar 31, 2023
362f9d9
WIP
dongjaelee1 Apr 4, 2023
2cabda2
WIP
dongjaelee1 Apr 4, 2023
cd10e4a
WIP
dongjaelee1 Apr 5, 2023
bcac812
WIP
dongjaelee1 Apr 6, 2023
f28df8a
WIP
dongjaelee1 Apr 6, 2023
7daf49e
backtranslation: proved step lemmas
dongjaelee1 Apr 12, 2023
4ab80d8
WIP
dongjaelee1 Apr 13, 2023
62c65f7
WIP
dongjaelee1 Apr 17, 2023
bc2603c
major changes - non-public global vars for counters, use Asm.program
dongjaelee1 Apr 18, 2023
5cd629d
WIP: bt code gen
dongjaelee1 Apr 19, 2023
bbabb22
WIP: defined code gen
dongjaelee1 Apr 19, 2023
23a5051
WIP
dongjaelee1 Apr 20, 2023
8f52c1f
WIP
dongjaelee1 Apr 20, 2023
57b2026
WIP
dongjaelee1 Apr 20, 2023
b656d24
WIP
dongjaelee1 Apr 20, 2023
d928562
WIP
dongjaelee1 Apr 21, 2023
d07f49f
WIP: invariant for cl
dongjaelee1 Apr 21, 2023
4040d4c
WIP
dongjaelee1 Apr 23, 2023
57dca08
WIP
dongjaelee1 Apr 23, 2023
d5c0532
WIP
dongjaelee1 Apr 23, 2023
8a5cad7
WIP
dongjaelee1 Apr 23, 2023
d2a4ef2
WIP
dongjaelee1 Apr 24, 2023
cff1d64
WIP
dongjaelee1 Apr 25, 2023
58e1fed
WIP
dongjaelee1 Apr 26, 2023
03c29fb
WIP: informative sem
dongjaelee1 Apr 28, 2023
c67a7ac
WIP
dongjaelee1 Apr 29, 2023
03826f6
WIP: bt informative asm
dongjaelee1 May 2, 2023
33e2a02
WIP
dongjaelee1 May 3, 2023
f95a9f2
WIP
dongjaelee1 May 3, 2023
ffa5d06
WIP; proved prefix <-> cut
dongjaelee1 May 3, 2023
2c07cd7
WIP; proved asm -> info asm
dongjaelee1 May 4, 2023
0ceafcd
WIP
dongjaelee1 May 4, 2023
4ba0e26
WIP: upgrade step lemmas
dongjaelee1 May 5, 2023
05d9ff2
WIP
dongjaelee1 May 6, 2023
391615c
WIP
dongjaelee1 May 6, 2023
5f36255
fixed rettype to type; proved step lemmas
dongjaelee1 May 7, 2023
5d7a2e7
WIP
dongjaelee1 May 8, 2023
494bc59
WIP
dongjaelee1 May 8, 2023
fa9267b
WIP: start proving from_asm_wf
dongjaelee1 May 9, 2023
7adb5cd
WIP: fixing...
dongjaelee1 May 10, 2023
697e3cc
WIP
dongjaelee1 May 12, 2023
762fa56
WIP
dongjaelee1 May 12, 2023
f159907
WIP
dongjaelee1 May 12, 2023
5d87590
WIP
dongjaelee1 May 14, 2023
3c2442c
WIP; updated info asm to invoke virtual events
dongjaelee1 May 15, 2023
ce5592c
WIP
dongjaelee1 May 15, 2023
2534c82
WIP
dongjaelee1 May 16, 2023
9e53032
WIP; extcall has a problem - without event, can change memory
dongjaelee1 May 16, 2023
15d1893
WIP; revising semantics
dongjaelee1 May 18, 2023
b7cb91e
WIP: define bundle event
dongjaelee1 May 19, 2023
65df1ce
WIP
dongjaelee1 May 19, 2023
df64b5e
defined asm step fixed - TODO replace old def
dongjaelee1 May 29, 2023
c606699
WIP
dongjaelee1 May 29, 2023
7b91b8d
WIP
dongjaelee1 May 31, 2023
6510425
WIP
dongjaelee1 Jun 2, 2023
8d61db5
WIP
dongjaelee1 Jun 2, 2023
270dfd0
WIP; defined inv
dongjaelee1 Jun 4, 2023
0c6d21d
WIP
dongjaelee1 Jun 29, 2023
30da85a
WIP
dongjaelee1 Jun 30, 2023
37e0e44
WIP
dongjaelee1 Jul 1, 2023
6597668
fix ir
dongjaelee1 Jul 2, 2023
9810dc9
WIP
dongjaelee1 Jul 12, 2023
349d14b
WIP
dongjaelee1 Jul 13, 2023
2b36ac0
WIP
dongjaelee1 Jul 13, 2023
a19966d
WIP
dongjaelee1 Jul 13, 2023
2c0e056
WIP
dongjaelee1 Jul 14, 2023
850de52
WIP
dongjaelee1 Jul 14, 2023
1dc963c
WIP; mem relation
dongjaelee1 Jul 19, 2023
49f636c
WIP
dongjaelee1 Jul 19, 2023
d3609dd
WIP
dongjaelee1 Jul 19, 2023
a33c208
WIP
dongjaelee1 Jul 20, 2023
883f7d1
mem delta done
dongjaelee1 Jul 21, 2023
a3de035
WIP
dongjaelee1 Jul 21, 2023
d8c0f1f
WIP
dongjaelee1 Jul 24, 2023
8b2acba
Merge branch 'secure-compilation' of github.com:secure-compilation/Co…
dongjaelee1 Jul 25, 2023
f4fd9e4
WIP
dongjaelee1 Jul 25, 2023
7b6e32b
WIP
dongjaelee1 Jul 26, 2023
94a555e
WIP
dongjaelee1 Jul 27, 2023
f2746a6
WIP
dongjaelee1 Jul 27, 2023
7985b39
WIP
dongjaelee1 Jul 28, 2023
6be8314
WIP
dongjaelee1 Jul 29, 2023
5ef0aee
WIP
dongjaelee1 Jul 29, 2023
5a712ac
WIP
dongjaelee1 Jul 29, 2023
e5a9f20
WIP
dongjaelee1 Jul 30, 2023
20c7542
WIP
dongjaelee1 Jul 30, 2023
4a6044e
WIP
dongjaelee1 Jul 31, 2023
76fd635
WIP
dongjaelee1 Jul 31, 2023
299d1ee
WIP
dongjaelee1 Jul 31, 2023
15b8641
WIP --- need to add more clases and instances for is_external class
dongjaelee1 Aug 1, 2023
64fea52
Implements instances of is_external, etc. everywhere
jeremyThibault Aug 1, 2023
1ebf634
WIP
dongjaelee1 Aug 1, 2023
243742b
WIP
dongjaelee1 Aug 2, 2023
ca5fa46
WIP; also some minor fixes
dongjaelee1 Aug 2, 2023
8704e9f
WIP
dongjaelee1 Aug 3, 2023
2a1c371
WIP
dongjaelee1 Aug 3, 2023
aaffcad
proved asm to ir
dongjaelee1 Aug 4, 2023
f20c4b0
proved asm2ir init conds
dongjaelee1 Aug 4, 2023
c2845ce
some cleanups
dongjaelee1 Aug 4, 2023
245cd35
WIP
dongjaelee1 Aug 6, 2023
695af1f
WIP
dongjaelee1 Aug 7, 2023
e74ca1e
WIP
dongjaelee1 Aug 7, 2023
162cacd
WIP
dongjaelee1 Aug 8, 2023
8bebec3
WIP; start changing mem delta store to storev
dongjaelee1 Aug 9, 2023
fd81116
WIP; major change in mem_delta
dongjaelee1 Aug 9, 2023
f96b1fc
WIP-new mem delta
dongjaelee1 Aug 10, 2023
00e0ed7
WIP
dongjaelee1 Aug 10, 2023
ef7eb9b
WIP
dongjaelee1 Aug 11, 2023
6c1db3d
WIP
dongjaelee1 Aug 12, 2023
daf1891
fixed
dongjaelee1 Aug 12, 2023
f4062cc
WIP
dongjaelee1 Aug 13, 2023
2a6f736
WIP
dongjaelee1 Aug 13, 2023
597dd4f
WIP
dongjaelee1 Aug 13, 2023
8ceb058
WIP
dongjaelee1 Aug 14, 2023
2f99503
WIP
dongjaelee1 Aug 15, 2023
9ca5670
WIP
dongjaelee1 Aug 15, 2023
ca40ff4
WIP
dongjaelee1 Aug 15, 2023
a4a405b
WIP
dongjaelee1 Aug 16, 2023
c37bd50
WIP
dongjaelee1 Aug 16, 2023
df9782c
WIP
dongjaelee1 Aug 17, 2023
f090138
WIP
dongjaelee1 Aug 17, 2023
3b45437
WIP
dongjaelee1 Aug 28, 2023
0569ffd
WIP
dongjaelee1 Aug 29, 2023
72810ed
WIP
dongjaelee1 Aug 29, 2023
2fcbdd9
WIP
dongjaelee1 Sep 4, 2023
1222542
WIP
dongjaelee1 Sep 4, 2023
aa46319
WIP
dongjaelee1 Sep 5, 2023
2dad7c0
WIP
dongjaelee1 Sep 6, 2023
af8b1a7
WIP
dongjaelee1 Sep 6, 2023
b73bef6
WIP
dongjaelee1 Sep 7, 2023
d959c16
WIP
dongjaelee1 Sep 8, 2023
914c6b5
WIP
dongjaelee1 Sep 8, 2023
9c1281c
WIP
dongjaelee1 Sep 10, 2023
b4b3724
WIP
dongjaelee1 Sep 11, 2023
2b66207
defined wunchanged_on
dongjaelee1 Sep 13, 2023
acbf32e
WIP
dongjaelee1 Sep 13, 2023
cc44ee8
defined some admits
dongjaelee1 Sep 14, 2023
95d27fa
WIP
dongjaelee1 Sep 14, 2023
b3e9867
cleanup
dongjaelee1 Sep 16, 2023
12801ff
WIP
dongjaelee1 Sep 16, 2023
a1b0f71
WIP
dongjaelee1 Sep 17, 2023
3f66833
WIP
dongjaelee1 Sep 18, 2023
4011a27
WIP
dongjaelee1 Sep 19, 2023
5321bbc
WIP
dongjaelee1 Sep 20, 2023
2bd4c5a
vstore semantics strengthened; WIP
dongjaelee1 Sep 20, 2023
94d52bd
WIP
dongjaelee1 Sep 21, 2023
6b9f443
WIP
dongjaelee1 Sep 21, 2023
af25dd1
WIP
dongjaelee1 Sep 22, 2023
78f682c
WIP
dongjaelee1 Sep 22, 2023
b0452b2
WIP
dongjaelee1 Sep 22, 2023
f86cd70
WIP
dongjaelee1 Sep 22, 2023
bbbdd9f
WIP
dongjaelee1 Sep 22, 2023
042a877
WIP
dongjaelee1 Sep 22, 2023
d92d9de
refactor files
dongjaelee1 Sep 22, 2023
c4ec336
WIP
dongjaelee1 Sep 23, 2023
06987c6
WIP
dongjaelee1 Sep 23, 2023
a1a4bda
proved bt sim
dongjaelee1 Sep 23, 2023
a4817d9
start init inv proof
dongjaelee1 Sep 24, 2023
f53e32c
start proof 2
dongjaelee1 Sep 25, 2023
b658f16
WIP
dongjaelee1 Sep 26, 2023
0b91f4a
WIP
dongjaelee1 Sep 26, 2023
94a477c
WIP
dongjaelee1 Sep 27, 2023
fbc78e0
WIP
dongjaelee1 Sep 27, 2023
a78f72d
WIP
dongjaelee1 Sep 27, 2023
3b48228
WIP; modify inv
dongjaelee1 Sep 28, 2023
9158bcd
fixed inv
dongjaelee1 Sep 28, 2023
c03df01
WIP
dongjaelee1 Sep 28, 2023
28fb7f0
done except for the axioms
dongjaelee1 Sep 28, 2023
5c7ec23
WIP
dongjaelee1 Sep 29, 2023
2190d5b
cleanup
dongjaelee1 Sep 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ CFRONTEND=Ctypes.v Cop.v Csyntax.v Csem.v Ctyping.v Cstrategy.v Cexec.v \

# Security proof (in security/)

SECURITY=RSC.v Split.v Blame.v Recomposition.v
SECURITY=RSC.v Split.v Blame.v Recomposition.v Tactics.v MemoryWeak.v MemoryDelta.v BtBasics.v BtInfoAsm.v BtInfoAsmBound.v Backtranslation.v BacktranslationAux.v BacktranslationProof.v

# Parser

Expand Down
15 changes: 15 additions & 0 deletions backend/Allocproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ Proof.
- now inv H.
Qed.

Instance external_transf_fundef: is_external_transl_partial transf_fundef.
Proof.
unfold transf_fundef, transf_partial_fundef, transf_function, check_function.
intros f ? ? H.
destruct f.
- destruct type_function; try easy.
destruct regalloc; try easy.
destruct analyze; try easy.
destruct eq_compartment as [e|?]; try easy.
monadInv H. monadInv EQ.
monadInv EQ0.
destruct check_entrypoints_aux; try easy.
- now inv H.
Qed.

Lemma transf_program_match:
forall p tp, transf_program p = OK tp -> match_prog p tp.
Proof.
Expand Down
10 changes: 10 additions & 0 deletions backend/CSEproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ Proof.
now inv H.
Qed.

Instance external_transf_function rm:
is_external_transl_partial (transf_fundef rm).
Proof.
unfold transf_fundef, transf_function.
intros [f | ef] ? ? H; try now inv H.
simpl in *.
destruct analyze; try easy.
now inv H.
Qed.

Lemma transf_program_match:
forall prog tprog, transf_program prog = OK tprog -> match_prog prog tprog.
Proof.
Expand Down
3 changes: 3 additions & 0 deletions backend/CleanupLabelsproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ Definition match_prog (p tp: Linear.program) :=
Instance comp_match_prog: has_comp_transl transf_function.
Proof. now intros f. Qed.

Instance external_transf_fundef: is_external_transl transf_fundef.
Proof. now intros ? [f | ef]. Qed.

Lemma transf_program_match:
forall p, match_prog p (transf_program p).
Proof.
Expand Down
3 changes: 3 additions & 0 deletions backend/Constpropproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ Definition match_prog (prog tprog: program) :=
Instance comp_transf_function rm: has_comp_transl (transf_function rm).
Proof. now intro. Qed.

Instance external_transf_function rm: is_external_transl (transf_fundef rm).
Proof. now intros ? []. Qed.

Lemma transf_program_match:
forall prog, match_prog prog (transf_program prog).
Proof.
Expand Down
9 changes: 9 additions & 0 deletions backend/Deadcodeproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ Proof.
now inv H.
Qed.

Instance external_transf_function rm: is_external_transl_partial (transf_fundef rm).
Proof.
unfold transf_fundef, transf_function.
intros [f | ef] ? ? H; try now inv H.
simpl in *.
destruct analyze; try easy.
now inv H.
Qed.

Lemma transf_program_match:
forall prog tprog, transf_program prog = OK tprog -> match_prog prog tprog.
Proof.
Expand Down
8 changes: 8 additions & 0 deletions backend/Debugvarproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ Proof.
now destruct ana_function; inv H.
Qed.

Instance external_transf_function: is_external_transl_partial transf_fundef.
Proof.
unfold transf_fundef, transf_function.
intros [f | ef] ? ? H; simpl in *.
now destruct ana_function; inv H.
now inv H.
Qed.

Lemma transf_program_match:
forall p tp, transf_program p = OK tp -> match_prog p tp.
Proof.
Expand Down
11 changes: 11 additions & 0 deletions backend/Inliningproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ Proof.
now inv H.
Qed.

Instance external_transl_fundef fenv: is_external_transl_partial (transf_fundef fenv).
Proof.
unfold transf_fundef, transf_function.
intros [f | ef] tf ? H; try now inv H.
unfold transf_partial_fundef in H.
destruct (expand_function _ _ _).
destruct (zlt _ _); try easy.
simpl in *.
now inv H.
Qed.

Lemma transf_program_match:
forall prog tprog, transf_program prog = OK tprog -> match_prog prog tprog.
Proof.
Expand Down
6 changes: 6 additions & 0 deletions backend/Linearizeproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ Proof.
intros f ? H; now monadInv H.
Qed.

Instance external_transf_fundef: is_external_transl_partial transf_fundef.
Proof.
unfold transf_fundef, transf_function.
intros [f | ef] ? ? H; now monadInv H.
Qed.

Lemma transf_program_match:
forall p tp, transf_program p = OK tp -> match_prog p tp.
Proof.
Expand Down
9 changes: 9 additions & 0 deletions backend/RTLgenproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,15 @@ Proof.
now inv H.
Qed.

Instance external_transl_fundef: is_external_transl_partial transl_fundef.
Proof.
unfold transl_fundef, transl_function.
intros [f | ef] tf ? H; simpl in *.
- destruct (transl_fun _ _) as [|[??] ? ?]; try discriminate.
now inv H.
- now inv H.
Qed.

Lemma transf_program_match:
forall p tp, transl_program p = OK tp -> match_prog p tp.
Proof.
Expand Down
3 changes: 3 additions & 0 deletions backend/Renumberproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ Definition match_prog (p tp: RTL.program) :=
Instance comp_transf_function: has_comp_transl transf_function.
Proof. now intros. Qed.

Instance is_external_transf_function: is_external_transl transf_fundef.
Proof. unfold transf_fundef. intros ? [f | ef]; reflexivity. Qed.

Lemma transf_program_match:
forall p, match_prog p (transf_program p).
Proof.
Expand Down
5 changes: 5 additions & 0 deletions backend/Selectionproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ Proof.
exact (comp_transl_partial _ EQ).
Qed.

Instance is_external_match_fundef: is_external_match match_fundef.
Proof.
intros cunit f tf cp (hf & hf_c & G & _ & H).
destruct f as [f|ef]; monadInv H; simpl; reflexivity.
Qed.
(** Processing of helper functions *)

Lemma record_globdefs_sound:
Expand Down
6 changes: 6 additions & 0 deletions backend/Stackingproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ Proof.
now monadInv H.
Qed.

Instance external_transf_fundef: is_external_transl_partial transf_fundef.
Proof.
unfold transf_fundef.
intros [f | ef] tf ? H; try now monadInv H.
Qed.

Lemma transf_program_match:
forall p tp, transf_program p = OK tp -> match_prog p tp.
Proof.
Expand Down
6 changes: 6 additions & 0 deletions backend/Tailcallproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ Proof.
now destruct zeq.
Qed.

Instance external_transf_fundef cenv: is_external_transl (transf_fundef cenv).
Proof.
unfold transf_fundef, transf_function, RTL.transf_function.
intros ? [f | ef]; simpl; reflexivity.
Qed.

Lemma transf_program_match:
forall p, match_prog p (transf_program p).
Proof.
Expand Down
3 changes: 3 additions & 0 deletions backend/Tunnelingproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ Definition match_prog (p tp: program) :=
Instance comp_tunnel_fundef: has_comp_transl tunnel_function.
Proof. now intro. Qed.

Instance external_tunnel_fundef: is_external_transl tunnel_fundef.
Proof. now intros ? []. Qed.

Lemma transf_program_match:
forall p, match_prog p (tunnel_program p).
Proof.
Expand Down
20 changes: 14 additions & 6 deletions backend/Unusedglobproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ Proof.
simpl. rewrite A. rewrite H0. subst; now destruct Ptrofs.eq_dec.
+ right.
unfold Genv.allowed_cross_call in *.
destruct H2 as [i [cp' [H21 [H22 [H23 H24]]]]].
destruct H2 as [i [cp' [H21 [H22 [H23 [H24 H25]]]]]].
exists i. exists cp'.
repeat split.
* apply Genv.find_invert_symbol.
Expand All @@ -875,16 +875,20 @@ Proof.
specialize (E j H). unfold symbols_inject in E.
destruct E as [E1 [E2 [E3 E4]]].
specialize (E2 i _ _ _ H6). simpl in E2. specialize (E2 H21). destruct E2. auto.
* rewrite <- H22. unfold Genv.find_comp.
* intros. unfold Genv.find_funct in *.
destruct (Ptrofs.eq_dec (Ptrofs.add Ptrofs.zero (Ptrofs.repr delta)) Ptrofs.zero); try congruence.
assert (fd0 = fd) by congruence; subst fd0.
apply H22. eauto.
* rewrite <- H23. unfold Genv.find_comp.
simpl. rewrite A. rewrite H0. subst; now destruct Ptrofs.eq_dec.
* apply match_prog_pol in TRANSF.
unfold tge, Genv.globalenv. rewrite TRANSF.
rewrite Genv.genv_pol_add_globals. simpl.
unfold ge, Genv.globalenv in H23. now rewrite Genv.genv_pol_add_globals in H23.
unfold ge, Genv.globalenv in H24. now rewrite Genv.genv_pol_add_globals in H24.
* apply match_prog_pol in TRANSF.
unfold tge, Genv.globalenv. rewrite TRANSF.
rewrite Genv.genv_pol_add_globals. simpl.
unfold ge, Genv.globalenv in H24. now rewrite Genv.genv_pol_add_globals in H24. }
unfold ge, Genv.globalenv in H25. now rewrite Genv.genv_pol_add_globals in H25. }
{ unfold Genv.type_of_call. unfold Genv.find_comp, Genv.find_funct.
rewrite R, H0, A, B. now destruct Ptrofs.eq_dec. }
{ unfold Genv.find_comp, Genv.find_funct. rewrite R, H0, A, B. reflexivity. }
Expand Down Expand Up @@ -913,12 +917,16 @@ Proof.
specialize (E j H). unfold symbols_inject in E.
destruct E as [E1 [E2 [E3 E4]]].
specialize (E2 i _ _ _ Q). simpl in E2. specialize (E2 H21). destruct E2. auto.
* rewrite <- H22. unfold Genv.find_comp.
* intros. unfold Genv.find_funct in *.
destruct Ptrofs.eq_dec; try congruence.
assert (fd0 = fd) by congruence; subst fd0.
apply H22. eauto.
* rewrite <- H23. unfold Genv.find_comp.
simpl. rewrite A. rewrite H0. reflexivity.
* apply match_prog_pol in TRANSF.
unfold tge, Genv.globalenv. rewrite TRANSF.
rewrite Genv.genv_pol_add_globals. simpl.
unfold ge, Genv.globalenv in H23. now rewrite Genv.genv_pol_add_globals in H23.
unfold ge, Genv.globalenv in H24. now rewrite Genv.genv_pol_add_globals in H24.
* apply match_prog_pol in TRANSF.
unfold tge, Genv.globalenv. rewrite TRANSF.
rewrite Genv.genv_pol_add_globals. simpl.
Expand Down
10 changes: 10 additions & 0 deletions cfrontend/Cminorgenproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ Proof.
now monadInv H.
Qed.

Instance external_transl_fundef: is_external_transl_partial transl_fundef.
Proof.
unfold transl_fundef, transl_function, transl_funbody.
intros [f | ef] tf ? H; simpl in H.
destruct build_compilenv.
destruct zle; try easy.
now monadInv H.
now monadInv H.
Qed.

Lemma transf_program_match:
forall p tp, transl_program p = OK tp -> match_prog p tp.
Proof.
Expand Down
1 change: 1 addition & 0 deletions cfrontend/Csem.v
Original file line number Diff line number Diff line change
Expand Up @@ -884,3 +884,4 @@ Proof.
inv H; simpl; try lia. eapply external_call_trace_length; eauto.
inv EV; simpl; try lia.
Qed.

5 changes: 5 additions & 0 deletions cfrontend/Cshmgenproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ Proof.
exact (comp_transl_partial _ H).
Qed.

Instance external_match_fundef: is_external_match match_fundef.
Proof.
intros cu ? ? ? [f tf H|]; reflexivity.
Qed.

Lemma transf_program_match:
forall p tp, transl_program p = OK tp -> match_prog p tp.
Proof.
Expand Down
3 changes: 2 additions & 1 deletion cfrontend/Csyntax.v
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
(** Abstract syntax for the Compcert C language *)

Require Import Coqlib Maps Integers Floats Errors.
Require Import AST Linking Values.
Require Import AST Linking Values Builtins.
Require Import Ctypes Cop.

(** ** Expressions *)
Expand Down Expand Up @@ -227,3 +227,4 @@ Definition type_of_fundef (f: fundef) : type :=
- a proof that this environment is consistent with the definitions. *)

Definition program := Ctypes.program function.

59 changes: 58 additions & 1 deletion cfrontend/Ctypes.v
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
(** Type expressions for the Compcert C and Clight languages *)

Require Import Axioms Coqlib Maps Errors.
Require Import AST Linking.
Require Import AST Linking Builtins.
Require Archi.

Set Asymmetric Patterns.
Expand Down Expand Up @@ -2021,3 +2021,60 @@ Qed.

End LINK_MATCH_PROGRAM.


Global Program Instance is_external_fundef_ctypes f : is_external (fundef f) :=
{ is_ok :=
fun cp' fd =>
match fd with
| Internal _ => True
| External ef _ _ _ =>
match ef with
| EF_external cp name sg => True
| EF_builtin cp name sg
| EF_runtime cp name sg =>
match Builtins.lookup_builtin_function name sg with
| None => True
| _ => cp = cp'
end
| EF_vload cp chunk => cp = cp'
| EF_vstore cp chunk => cp = cp'
| EF_malloc cp => cp = cp'
| EF_free cp => cp = cp'
| EF_memcpy cp sz al => cp = cp'
| EF_annot cp kind txt targs => True
| EF_annot_val cp kind txt targ => True
| EF_inline_asm cp txt sg clb => True
| EF_debug cp kind txt targs => cp = cp'
end
end;
is_ok_b :=
fun cp' fd =>
match fd with
| Internal _ => true
| External ef _ _ _ =>
match ef with
| EF_external cp name sg => true
| EF_builtin cp name sg
| EF_runtime cp name sg =>
match lookup_builtin_function name sg with
| None => true
| _ => Pos.eqb cp cp'
end
| EF_vload cp chunk => Pos.eqb cp cp'
| EF_vstore cp chunk => Pos.eqb cp cp'
| EF_malloc cp => Pos.eqb cp cp'
| EF_free cp => Pos.eqb cp cp'
| EF_memcpy cp sz al => Pos.eqb cp cp'
| EF_annot cp kind txt targs => true
| EF_annot_val cp kind txt targ => true
| EF_inline_asm cp txt sg clb => true
| EF_debug cp kind txt targs => Pos.eqb cp cp'
end
end;
is_ok_reflect := _;
}.
Next Obligation.
destruct fd as [| []]; simpl; try now (symmetry; eauto using Pos.eqb_eq).
destruct (lookup_builtin_function name sg); try now (symmetry; eauto using Pos.eqb_eq).
destruct (lookup_builtin_function name sg); try now (symmetry; eauto using Pos.eqb_eq).
Defined.
7 changes: 7 additions & 0 deletions cfrontend/SimplExprproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ Proof.
symmetry; eauto.
Qed.

Instance external_tr_fundef:
is_external_match (fun cu f tf => tr_fundef cu f tf).
Proof.
intros ctx f tf ? [? ? []|]; reflexivity.
Qed.


Lemma transf_program_match:
forall p tp, transl_program p = OK tp -> match_prog p tp.
Proof.
Expand Down
5 changes: 5 additions & 0 deletions cfrontend/SimplLocalsproof.v
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ Proof.
now monadInv EQ.
Qed.

Instance external_transf_fundef: is_external_transl_partial transf_fundef.
Proof.
intros [f | ef] ? ? H; monadInv H; reflexivity.
Qed.

Lemma match_transf_program:
forall p tp, transf_program p = OK tp -> match_prog p tp.
Proof.
Expand Down
Loading