Skip to content

Commit

Permalink
Merge pull request #967 from CakeML/lpr_arm8
Browse files Browse the repository at this point in the history
ARM8 version of LPR checker & proof
  • Loading branch information
myreen committed Aug 21, 2023
2 parents 5c1bae6 + 70c9116 commit 5696cf2
Show file tree
Hide file tree
Showing 10 changed files with 648 additions and 13 deletions.
1 change: 1 addition & 0 deletions developers/build-sequence
Expand Up @@ -108,6 +108,7 @@ examples/lpr_checker
examples/lpr_checker/array
examples/lpr_checker/array/compilation
examples/lpr_checker/array/compilation/proofs
examples/lpr_checker/array/compilation/proofsARM8
examples/opentheory
examples/opentheory
examples/opentheory/compilation
Expand Down
15 changes: 4 additions & 11 deletions examples/lpr_checker/array/compilation/Holmakefile
@@ -1,21 +1,14 @@
INCLUDES = $(CAKEMLDIR)/misc $(CAKEMLDIR)/basis $(CAKEMLDIR)/compiler ..
CLINE_OPTIONS =

all: $(DEFAULT_TARGETS) README.md exec
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)

ifndef CC
CC=gcc
endif
lpr_array.S: *lpr_arrayCompileScript.sml
lpr_ramsey.S: *lpr_arrayRamseyCompileScript.sml
cake_lpr_array: lpr_array.S $(CAKEMLDIR)/basis/basis_ffi.o
$(CC) $< $(protect $(CAKEMLDIR)/basis/basis_ffi.o) $(GCCFLAGS) -o $@

exec: cake_lpr_array
.PHONY: exec
cake_lpr.S: *lpr_arrayCompileScript.sml
cake_lpr_arm8.S: *lpr_arrayCompileARM8Script.sml
cake_lpr_ramsey.S: *lpr_arrayRamseyCompileScript.sml
7 changes: 7 additions & 0 deletions examples/lpr_checker/array/compilation/README.md
@@ -1,5 +1,8 @@
An LRAT checker built on CakeML with arrays

[lpr_arrayCompileARM8Script.sml](lpr_arrayCompileARM8Script.sml):
Compiles the lpr example by evaluation inside the logic of HOL

[lpr_arrayCompileScript.sml](lpr_arrayCompileScript.sml):
Compiles the lpr example by evaluation inside the logic of HOL

Expand All @@ -11,3 +14,7 @@ Compiles the lpr example by evaluation inside the logic of HOL

[proofs](proofs):
Prove end-to-end correctness theorem for LPR checker with arrays

[proofsARM8](proofsARM8):
Prove end-to-end correctness theorem for LPR checker with arrays
against ARM8 model
@@ -0,0 +1,11 @@
(*
Compiles the lpr example by evaluation inside the logic of HOL
*)
open preamble compilationLib lpr_arrayFullProgTheory

val _ = new_theory "lpr_arrayCompileARM8"

val lpr_array_compiled = save_thm("lpr_array_compiled",
compile_arm8 "cake_lpr_arm8" check_unsat_prog_def);

val _ = export_theory ();
Expand Up @@ -6,6 +6,6 @@ open preamble compilationLib lpr_arrayFullProgTheory
val _ = new_theory "lpr_arrayCompile"

val lpr_array_compiled = save_thm("lpr_array_compiled",
compile_x64 "lpr_array" check_unsat_prog_def);
compile_x64 "cake_lpr" check_unsat_prog_def);

val _ = export_theory ();
Expand Up @@ -6,6 +6,6 @@ open preamble compilationLib lpr_arrayRamseyProgTheory
val _ = new_theory "lpr_arrayRamseyCompile"

val lpr_array_compiled = save_thm("lpr_ramsey_compiled",
compile_x64 "lpr_ramsey" check_unsat_prog_def);
compile_x64 "cake_lpr_ramsey" check_unsat_prog_def);

val _ = export_theory ();
15 changes: 15 additions & 0 deletions examples/lpr_checker/array/compilation/proofsARM8/Holmakefile
@@ -0,0 +1,15 @@
INCLUDES = $(CAKEMLDIR)/misc $(CAKEMLDIR)/semantics/proofs\
$(CAKEMLDIR)/compiler/backend/proofs\
$(HOLDIR)/examples/l3-machine-code/arm8/asl-equiv \
$(CAKEMLDIR)/compiler/encoders/arm8_asl \
$(CAKEMLDIR)/compiler/encoders/arm8_asl/proofs\
$(CAKEMLDIR)/compiler/backend/arm8_asl \
.. ../..

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)
7 changes: 7 additions & 0 deletions examples/lpr_checker/array/compilation/proofsARM8/README.md
@@ -0,0 +1,7 @@
Prove end-to-end correctness theorem for LPR checker with arrays
against ARM8 model

[lpr_arrayProofARM8Script.sml](lpr_arrayProofARM8Script.sml):
Compose the semantics theorem and the compiler correctness
theorem with the compiler evaluation theorem to produce end-to-end
correctness theorem that reaches final machine code.

0 comments on commit 5696cf2

Please sign in to comment.