Skip to content

Commit

Permalink
Remove compilerTheory (put its content at end of codegenTheory)
Browse files Browse the repository at this point in the history
  • Loading branch information
myreen committed Mar 11, 2024
1 parent 772a64a commit 3a51c81
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 22 deletions.
4 changes: 2 additions & 2 deletions examples/bootstrap/README.md
Expand Up @@ -20,8 +20,8 @@ Functions and proofs about lexing, parsing and pretty printing of source code:
- [parsing_proofsScript.sml](parsing_proofsScript.sml)
- [printingScript.sml](printingScript.sml)

Top-level compiler definition as shallow embedding:
- [compilerScript.sml](compilerScript.sml)
Top-level compiler definition as shallow embedding is at the bottom of:
- [codegenScript.sml](codegenScript.sml)

Automation that converts shallow embeddings into deep embeddings:
- [automation_lemmasScript.sml](automation_lemmasScript.sml)
Expand Down
6 changes: 6 additions & 0 deletions examples/bootstrap/codegenScript.sml
Expand Up @@ -2,6 +2,7 @@
open HolKernel Parse boolLib bossLib;
open arithmeticTheory listTheory pairTheory finite_mapTheory stringTheory;
open source_valuesTheory source_syntaxTheory x64asm_syntaxTheory;
open parsingTheory wordsLib;

val _ = new_theory "codegen";

Expand Down Expand Up @@ -333,4 +334,9 @@ Definition codegen_def:
flatten (Append (List (init (k+1))) c) []
End

Definition compiler_def:
compiler input =
asm2str (codegen (parser (lexer input)))
End

val _ = export_theory();
16 changes: 0 additions & 16 deletions examples/bootstrap/compilerScript.sml

This file was deleted.

3 changes: 1 addition & 2 deletions examples/bootstrap/compiler_evalScript.sml
@@ -1,7 +1,7 @@

open HolKernel Parse boolLib bossLib term_tactic;
open arithmeticTheory listTheory pairTheory finite_mapTheory stringTheory;
open wordsTheory wordsLib automationLib compilerTheory compiler_progTheory;
open wordsTheory wordsLib automationLib compiler_progTheory;

val _ = new_theory "compiler_eval";

Expand All @@ -25,5 +25,4 @@ Theorem compiler_asm_str = time EVAL “compiler_asm_str”;
val _ = write_hol_string_to_file "compiler_prog.txt" (compiler_str |> concl |> rand);
val _ = write_hol_string_to_file "compiler_asm.s" (compiler_asm_str |> concl |> rand);


val _ = export_theory();
2 changes: 1 addition & 1 deletion examples/bootstrap/compiler_progScript.sml
Expand Up @@ -3,7 +3,7 @@ open HolKernel Parse boolLib bossLib term_tactic;
open arithmeticTheory listTheory pairTheory finite_mapTheory stringTheory;
open source_valuesTheory source_syntaxTheory source_semanticsTheory mp_then
source_propertiesTheory parsingTheory codegenTheory x64asm_syntaxTheory
wordsTheory wordsLib automation_lemmasTheory automationLib compilerTheory;
wordsTheory wordsLib automation_lemmasTheory automationLib;

val _ = new_theory "compiler_prog";

Expand Down
2 changes: 1 addition & 1 deletion examples/bootstrap/compiler_proofsScript.sml
Expand Up @@ -20,7 +20,7 @@ QED
Theorem compiler_compiler_str:
compiler compiler_str = compiler_asm_str
Proof
fs [compiler_str_def,compilerTheory.compiler_def,
fs [compiler_str_def,codegenTheory.compiler_def,
parser_lexer_prog2str,compiler_asm_str_def,compiler_asm_def]
QED

Expand Down

0 comments on commit 3a51c81

Please sign in to comment.