Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some Pancake cleanup #912

Merged
merged 3 commits into from Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion pancake/Holmakefile
Expand Up @@ -4,7 +4,6 @@ INCLUDES = $(HOLDIR)/examples/machine-code/multiword\
$(CAKEMLDIR)/compiler/backend/\
$(CAKEMLDIR)/compiler/\
$(CAKEMLDIR)/examples/\
$(CAKEMLDIR)/semantics/\
$(CAKEMLDIR)/compiler/encoders/asm


Expand Down
18 changes: 18 additions & 0 deletions pancake/parser/Holmakefile
@@ -0,0 +1,18 @@
INCLUDES = $(HOLDIR)/examples/machine-code/multiword\
$(CAKEMLDIR)/misc\
$(CAKEMLDIR)/pancake\
$(CAKEMLDIR)/basis/pure\
$(CAKEMLDIR)/compiler/backend/\
$(CAKEMLDIR)/compiler/\
$(CAKEMLDIR)/examples/\
$(CAKEMLDIR)/semantics/\
$(CAKEMLDIR)/compiler/encoders/asm


all: $(DEFAULT_TARGETS) README.md
.PHONY: all

README_SOURCES = $(wildcard *Script.sml) $(wildcard *Lib.sml) $(wildcard *Syntax.sml)
DIRS = $(wildcard */)
README.md: $(CAKEMLDIR)/developers/readme_gen readmePrefix $(README_SOURCES)
$(protect $(CAKEMLDIR)/developers/readme_gen) $(README_SOURCES)
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions pancake/parser/readmePrefix
@@ -0,0 +1 @@
The Pancake parser.
16 changes: 3 additions & 13 deletions pancake/proofs/loop_to_wordProofScript.sml
Expand Up @@ -40,9 +40,7 @@ Definition state_rel_def:
t.clock = s.clock ∧
t.be = s.be ∧
t.ffi = s.ffi ∧
IS_SOME (FLOOKUP t.store CurrHeap) ∧
isWord (THE (FLOOKUP t.store CurrHeap)) ∧
s.base_addr = theWord (THE (FLOOKUP t.store CurrHeap)) ∧
ALOOKUP (fmap_to_alist t.store) CurrHeap = SOME (Word s.base_addr) ∧
globals_rel s.globals t.store ∧
code_rel s.code t.code
End
Expand All @@ -51,8 +49,7 @@ val goal =
``λ(prog, s). ∀res s1 t ctxt retv l.
evaluate (prog,s) = (res,s1) ∧ res ≠ SOME Error ∧
state_rel s t ∧ locals_rel ctxt s.locals t.locals ∧
IS_SOME (FLOOKUP t.store CurrHeap) ∧
isWord (THE (FLOOKUP t.store CurrHeap)) ∧
ALOOKUP (fmap_to_alist t.store) CurrHeap = SOME (Word s.base_addr) ∧
lookup 0 t.locals = SOME retv ∧ no_Loops prog ∧
~(isWord retv) ∧
domain (acc_vars prog LN) ⊆ domain ctxt ⇒
Expand Down Expand Up @@ -122,7 +119,7 @@ Theorem state_rel_intro:
t.clock = s.clock ∧
t.be = s.be ∧
t.ffi = s.ffi ∧
s.base_addr = theWord (THE (FLOOKUP t.store CurrHeap)) ∧
ALOOKUP (fmap_to_alist t.store) CurrHeap = SOME (Word s.base_addr) ∧
globals_rel s.globals t.store ∧
code_rel s.code t.code
Proof
Expand Down Expand Up @@ -1074,7 +1071,6 @@ Proof
fs [Abbr ‘ctxt’] >>
match_mp_tac locals_rel_mk_ctxt_ln >>
fs []) >>
conj_tac >- fs[state_rel_def] >>
conj_tac >- fs[state_rel_def]
>> (
fs [no_Loops_def, no_Loop_def] >>
Expand Down Expand Up @@ -1115,7 +1111,6 @@ Proof
fs [Abbr ‘ctxt’] >>
match_mp_tac locals_rel_mk_ctxt_ln >>
fs []) >>
conj_tac >- fs[state_rel_def] >>
conj_tac >- fs[state_rel_def]
>> (
fs [no_Loops_def, no_Loop_def] >>
Expand Down Expand Up @@ -1159,7 +1154,6 @@ Proof
fs [Abbr ‘ctxt’] >>
match_mp_tac locals_rel_mk_ctxt_ln >>
fs []) >>
conj_tac >- fs[state_rel_def] >>
conj_tac >- fs[state_rel_def]
>> (
fs [no_Loops_def, no_Loop_def] >>
Expand Down Expand Up @@ -1201,7 +1195,6 @@ Proof
fs [Abbr ‘ctxt’] >>
match_mp_tac locals_rel_mk_ctxt_ln >>
fs []) >>
conj_tac >- fs[state_rel_def] >>
conj_tac >- fs[state_rel_def]
>> (
fs [no_Loops_def, no_Loop_def] >>
Expand Down Expand Up @@ -1240,7 +1233,6 @@ Proof
fs [Abbr ‘ctxt’] >>
match_mp_tac locals_rel_mk_ctxt_ln >>
fs []) >>
conj_tac >- fs[state_rel_def] >>
conj_tac >- fs[state_rel_def]
>> (
fs [no_Loops_def, no_Loop_def] >>
Expand Down Expand Up @@ -1315,7 +1307,6 @@ Proof
fs [Abbr ‘ctxt’] >>
match_mp_tac locals_rel_mk_ctxt_ln >>
fs []) >>
impl_tac >- fs[state_rel_def] >>
impl_tac>- fs[state_rel_def] >>
impl_tac >- (
fs [no_Loops_def, no_Loop_def] >>
Expand Down Expand Up @@ -1348,7 +1339,6 @@ Proof
fs [Abbr ‘ctxt’] >>
match_mp_tac locals_rel_mk_ctxt_ln >>
fs []) >>
impl_tac >- fs[state_rel_def] >>
impl_tac>- fs[state_rel_def] >>
impl_tac
>- (
Expand Down
4 changes: 1 addition & 3 deletions pancake/proofs/pan_to_wordProofScript.sml
Expand Up @@ -376,9 +376,7 @@ Theorem state_rel_imp_semantics:
t.mdomain = s.memaddrs ∧
t.be = s.be ∧
t.ffi = s.ffi ∧
IS_SOME (FLOOKUP t.store CurrHeap) ∧
isWord (THE (FLOOKUP t.store CurrHeap)) ∧
theWord (THE (FLOOKUP t.store CurrHeap)) = s.base_addr ∧
ALOOKUP (fmap_to_alist t.store) CurrHeap = SOME (Word s.base_addr) ∧
ALL_DISTINCT (MAP FST pan_code) ∧
ALOOKUP pan_code start = SOME ([],prog) ∧
lc < LENGTH pan_code ∧ EL lc pan_code = (start,[],prog) ∧
Expand Down
17 changes: 17 additions & 0 deletions pancake/proofs/time/Holmakefile
@@ -0,0 +1,17 @@
INCLUDES = $(HOLDIR)/examples/machine-code/multiword\
$(CAKEMLDIR)/misc\
$(CAKEMLDIR)/basis/pure\
$(CAKEMLDIR)/compiler/backend/\
$(CAKEMLDIR)/compiler/backend/proofs\
$(CAKEMLDIR)/compiler/encoders/asm\
$(CAKEMLDIR)/pancake\
$(CAKEMLDIR)/pancake/semantics


all: $(DEFAULT_TARGETS) README.md
.PHONY: all

README_SOURCES = $(wildcard *Script.sml) $(wildcard *Lib.sml) $(wildcard *Syntax.sml)
DIRS = $(wildcard */)
README.md: $(CAKEMLDIR)/developers/readme_gen readmePrefix $(patsubst %,%readmePrefix,$(DIRS)) $(README_SOURCES)
$(protect $(CAKEMLDIR)/developers/readme_gen) $(README_SOURCES)
4 changes: 4 additions & 0 deletions pancake/proofs/time/README.md
@@ -0,0 +1,4 @@
Proofs files for compiling TimeLang.

[time_to_panProofScript.sml](time_to_panProofScript.sml):
Correctness proof for timeLang to panLang
1 change: 1 addition & 0 deletions pancake/proofs/time/readmePrefix
@@ -0,0 +1 @@
Proof files for compiling TimeLang.