From 64b8a33c7dde54cedf1fd3f5b8c5ba3e8f66bb41 Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Wed, 15 Jul 2026 10:13:11 +0200 Subject: [PATCH] refactor(report): move theory to separate chapter --- report/bachelor_thesis.typ | 7 ++++--- report/bibliography.bib | 17 ++++++++------- report/chapters/01_introduction.typ | 2 +- report/chapters/02_state_of_the_art.typ | 19 ++++++++++++++++- report/chapters/03_development.typ | 8 ------- report/chapters/03_development/01_theory.typ | 4 ---- .../03_development/02_implementation.typ | 10 --------- .../02_implementation/01_overview.typ | 4 ---- .../02_implementation/02_midas_language.typ | 4 ---- .../02_implementation/03_python_checking.typ | 4 ---- .../02_implementation/04_generation.typ | 4 ---- report/chapters/03_theory.typ | 11 ++++++++++ report/chapters/04_implementation.typ | 21 +++++++++++++++++++ .../04_implementation/01_overview.typ | 14 +++++++++++++ .../04_implementation/02_midas_language.typ | 16 ++++++++++++++ .../04_implementation/03_python_checking.typ | 16 ++++++++++++++ .../04_implementation/04_generation.typ | 10 +++++++++ ...nclusion.typ => 05_results_discussion.typ} | 2 +- ...sults_discussion.typ => 06_conclusion.typ} | 2 +- 19 files changed, 122 insertions(+), 53 deletions(-) delete mode 100644 report/chapters/03_development.typ delete mode 100644 report/chapters/03_development/01_theory.typ delete mode 100644 report/chapters/03_development/02_implementation.typ delete mode 100644 report/chapters/03_development/02_implementation/01_overview.typ delete mode 100644 report/chapters/03_development/02_implementation/02_midas_language.typ delete mode 100644 report/chapters/03_development/02_implementation/03_python_checking.typ delete mode 100644 report/chapters/03_development/02_implementation/04_generation.typ create mode 100644 report/chapters/03_theory.typ create mode 100644 report/chapters/04_implementation.typ create mode 100644 report/chapters/04_implementation/01_overview.typ create mode 100644 report/chapters/04_implementation/02_midas_language.typ create mode 100644 report/chapters/04_implementation/03_python_checking.typ create mode 100644 report/chapters/04_implementation/04_generation.typ rename report/chapters/{05_conclusion.typ => 05_results_discussion.typ} (66%) rename report/chapters/{04_results_discussion.typ => 06_conclusion.typ} (71%) diff --git a/report/bachelor_thesis.typ b/report/bachelor_thesis.typ index 86bd644..415a0dc 100644 --- a/report/bachelor_thesis.typ +++ b/report/bachelor_thesis.typ @@ -100,9 +100,10 @@ You can also change the order or the names of the sections, for instance, if you #include "chapters/01_introduction.typ" #include "chapters/02_state_of_the_art.typ" -#include "chapters/03_development.typ" -#include "chapters/04_results_discussion.typ" -#include "chapters/05_conclusion.typ" +#include "chapters/03_theory.typ" +#include "chapters/04_implementation.typ" +#include "chapters/05_results_discussion.typ" +#include "chapters/06_conclusion.typ" #pagebreak() diff --git a/report/bibliography.bib b/report/bibliography.bib index 8f7e63b..8d869dc 100644 --- a/report/bibliography.bib +++ b/report/bibliography.bib @@ -52,15 +52,16 @@ year = 2021 } -@book{Householder1951, - author = {Householder, Alston S.}, - title = {Monte Carlo Method}, - series = {Applied Mathematics Series}, - number = {12}, +@Book{Householder1951, + author = {Householder, Alston S.}, + title = {Monte Carlo Method}, + year = {1951}, + series = {Applied Mathematics Series}, + number = {12}, + note = {Proceedings of a symposium held June 29, 30, and July 1, 1949}, publisher = {U.S. Department of Commerce, National Bureau of Standards}, - year = {1951}, - address = {Washington, D.C.}, - note = {Proceedings of a symposium held June 29, 30, and July 1, 1949} + pages = {36}, + address = {Washington, D.C.}, } @Online{HOPL, diff --git a/report/chapters/01_introduction.typ b/report/chapters/01_introduction.typ index 1a3e798..5ef3623 100644 --- a/report/chapters/01_introduction.typ +++ b/report/chapters/01_introduction.typ @@ -2,7 +2,7 @@ #import isc-hei-bthesis: todo #import "../utils.typ": quote-block -= Introduction += Introduction #quote-block[J. von Neumann @Householder1951][ Any one who considers arithmetical methods of producing random digits is, of course, in a state of sin diff --git a/report/chapters/02_state_of_the_art.typ b/report/chapters/02_state_of_the_art.typ index 96160ce..0dd12d5 100644 --- a/report/chapters/02_state_of_the_art.typ +++ b/report/chapters/02_state_of_the_art.typ @@ -1,4 +1,21 @@ #import "../requirements.typ": isc-hei-bthesis #import isc-hei-bthesis: todo -= State of the Art += State of the Art + + +/* +- Python type hints (https://peps.python.org/pep-0484/): + - base types + - type aliases + - structural subtyping with Protocols -> matches duck-typing (https://peps.python.org/pep-0544/) + +- Existing type checkers + - MyPy / Pyright + +- Existing libraries + - Pandera: runtime only, syntax heavy, but quite complete + +- Similar ideas + - Gator system (https://capra.cs.cornell.edu/research/gator/) +*/ \ No newline at end of file diff --git a/report/chapters/03_development.typ b/report/chapters/03_development.typ deleted file mode 100644 index 894a91f..0000000 --- a/report/chapters/03_development.typ +++ /dev/null @@ -1,8 +0,0 @@ -#import "../requirements.typ": isc-hei-bthesis -#import isc-hei-bthesis: todo -#import "../utils.typ": include-offset - -= Development and Methodology - -#include-offset(path("03_development/01_theory.typ")) -#include-offset(path("03_development/02_implementation.typ")) diff --git a/report/chapters/03_development/01_theory.typ b/report/chapters/03_development/01_theory.typ deleted file mode 100644 index 8443cf9..0000000 --- a/report/chapters/03_development/01_theory.typ +++ /dev/null @@ -1,4 +0,0 @@ -#import "../../requirements.typ": isc-hei-bthesis -#import isc-hei-bthesis: todo - -= Underlying Theory and Typing Rules diff --git a/report/chapters/03_development/02_implementation.typ b/report/chapters/03_development/02_implementation.typ deleted file mode 100644 index 7ef30cf..0000000 --- a/report/chapters/03_development/02_implementation.typ +++ /dev/null @@ -1,10 +0,0 @@ -#import "../../requirements.typ": isc-hei-bthesis -#import isc-hei-bthesis: todo -#import "../../utils.typ": include-offset - -= Implementation - -#include-offset(path("02_implementation/01_overview.typ")) -#include-offset(path("02_implementation/02_midas_language.typ")) -#include-offset(path("02_implementation/03_python_checking.typ")) -#include-offset(path("02_implementation/04_generation.typ")) \ No newline at end of file diff --git a/report/chapters/03_development/02_implementation/01_overview.typ b/report/chapters/03_development/02_implementation/01_overview.typ deleted file mode 100644 index 295f83c..0000000 --- a/report/chapters/03_development/02_implementation/01_overview.typ +++ /dev/null @@ -1,4 +0,0 @@ -#import "../../../requirements.typ": isc-hei-bthesis -#import isc-hei-bthesis: todo - -= Architecture Overview \ No newline at end of file diff --git a/report/chapters/03_development/02_implementation/02_midas_language.typ b/report/chapters/03_development/02_implementation/02_midas_language.typ deleted file mode 100644 index f577858..0000000 --- a/report/chapters/03_development/02_implementation/02_midas_language.typ +++ /dev/null @@ -1,4 +0,0 @@ -#import "../../../requirements.typ": isc-hei-bthesis -#import isc-hei-bthesis: todo - -= Midas Definition Processing diff --git a/report/chapters/03_development/02_implementation/03_python_checking.typ b/report/chapters/03_development/02_implementation/03_python_checking.typ deleted file mode 100644 index 9e82a9f..0000000 --- a/report/chapters/03_development/02_implementation/03_python_checking.typ +++ /dev/null @@ -1,4 +0,0 @@ -#import "../../../requirements.typ": isc-hei-bthesis -#import isc-hei-bthesis: todo - -= Python Type Checking diff --git a/report/chapters/03_development/02_implementation/04_generation.typ b/report/chapters/03_development/02_implementation/04_generation.typ deleted file mode 100644 index 5c2513d..0000000 --- a/report/chapters/03_development/02_implementation/04_generation.typ +++ /dev/null @@ -1,4 +0,0 @@ -#import "../../../requirements.typ": isc-hei-bthesis -#import isc-hei-bthesis: todo - -= Code Generation diff --git a/report/chapters/03_theory.typ b/report/chapters/03_theory.typ new file mode 100644 index 0000000..47fd75b --- /dev/null +++ b/report/chapters/03_theory.typ @@ -0,0 +1,11 @@ +#import "../requirements.typ": isc-hei-bthesis +#import isc-hei-bthesis: todo + += Underlying Theory and Typing Rules + +/* +- Identify requirements +- Introduction to TAPL +- Grammar and typing rules for Midas, paralleled with TAPL +- Omitted rules, simplifications, mechanisms not implemented +*/ \ No newline at end of file diff --git a/report/chapters/04_implementation.typ b/report/chapters/04_implementation.typ new file mode 100644 index 0000000..943c6b9 --- /dev/null +++ b/report/chapters/04_implementation.typ @@ -0,0 +1,21 @@ +#import "../requirements.typ": isc-hei-bthesis +#import isc-hei-bthesis: todo +#import "../utils.typ": include-offset + += Implementation + +#include-offset(path("04_implementation/01_overview.typ")) +#include-offset(path("04_implementation/02_midas_language.typ")) +#include-offset(path("04_implementation/03_python_checking.typ")) +#include-offset(path("04_implementation/04_generation.typ")) + +/* +Subjects: +- Variance inference +- Environment +- Resolver +- Evaluator +- CallDispatcher +- Registry (`is_subtype`) +- MethodRegistry (frames and columns) +*/ \ No newline at end of file diff --git a/report/chapters/04_implementation/01_overview.typ b/report/chapters/04_implementation/01_overview.typ new file mode 100644 index 0000000..aa2a08a --- /dev/null +++ b/report/chapters/04_implementation/01_overview.typ @@ -0,0 +1,14 @@ +#import "../../requirements.typ": isc-hei-bthesis +#import isc-hei-bthesis: todo + += Architecture Overview + +/* +- Main elements + - Definition language + - Supported Python syntax (cf. grammar and typing rules) + - Parse and type check + - Produce user-facing diagnostics + - Generate runtime assertions +- Architecture overview +*/ \ No newline at end of file diff --git a/report/chapters/04_implementation/02_midas_language.typ b/report/chapters/04_implementation/02_midas_language.typ new file mode 100644 index 0000000..100599e --- /dev/null +++ b/report/chapters/04_implementation/02_midas_language.typ @@ -0,0 +1,16 @@ +#import "../../requirements.typ": isc-hei-bthesis +#import isc-hei-bthesis: todo + += Midas Definition Processing + +/* +- Midas definition language + - Lexer + parser (Crafting Interpreters, Pebble) + - reference theory for grammar rules + - token location -> necessary later for diagnostics + - AST node generation, similar to CI (3 kinds, Stmt/Expr/Type) + - Typer + - reference theory for typing rules + - type structures + - types registry +*/ \ No newline at end of file diff --git a/report/chapters/04_implementation/03_python_checking.typ b/report/chapters/04_implementation/03_python_checking.typ new file mode 100644 index 0000000..15bb5de --- /dev/null +++ b/report/chapters/04_implementation/03_python_checking.typ @@ -0,0 +1,16 @@ +#import "../../requirements.typ": isc-hei-bthesis +#import isc-hei-bthesis: todo + += Python Type Checking + +/* +- Python type checking + - Parsing (short paragraph about AST nodes) + - Resolver + - Cf. CI + - Assignment analysis + - Typer + - Returns / if-else + - Environment + - Static constraint evaluation +*/ \ No newline at end of file diff --git a/report/chapters/04_implementation/04_generation.typ b/report/chapters/04_implementation/04_generation.typ new file mode 100644 index 0000000..e88e771 --- /dev/null +++ b/report/chapters/04_implementation/04_generation.typ @@ -0,0 +1,10 @@ +#import "../../requirements.typ": isc-hei-bthesis +#import isc-hei-bthesis: todo + += Code Generation + +/* +- Code generation + - Stubs + - Assertions +*/ \ No newline at end of file diff --git a/report/chapters/05_conclusion.typ b/report/chapters/05_results_discussion.typ similarity index 66% rename from report/chapters/05_conclusion.typ rename to report/chapters/05_results_discussion.typ index 6d43c41..c369e29 100644 --- a/report/chapters/05_conclusion.typ +++ b/report/chapters/05_results_discussion.typ @@ -1,4 +1,4 @@ #import "../requirements.typ": isc-hei-bthesis #import isc-hei-bthesis: todo -= Conclusion += Results and Discussion diff --git a/report/chapters/04_results_discussion.typ b/report/chapters/06_conclusion.typ similarity index 71% rename from report/chapters/04_results_discussion.typ rename to report/chapters/06_conclusion.typ index e906e51..124bfdb 100644 --- a/report/chapters/04_results_discussion.typ +++ b/report/chapters/06_conclusion.typ @@ -1,4 +1,4 @@ #import "../requirements.typ": isc-hei-bthesis #import isc-hei-bthesis: todo -= Results and Discussion += Conclusion