|
1 | | --- This module serves as the root of the `Freigen` library. |
2 | 1 | import Freigen.Free |
3 | | -import Freigen.ITree |
4 | | -import Freigen.Ast |
5 | | -import Freigen.Reflect |
| 2 | +import Freigen.ITree.Effect |
| 3 | +import Freigen.ITree.Basic |
| 4 | +import Freigen.ITree.Eutt |
| 5 | +import Freigen.Ast.Tp |
| 6 | +import Freigen.Ast.Basic |
| 7 | +import Freigen.Ast.Sexp |
| 8 | +import Freigen.Reflect.Sound |
| 9 | +import Freigen.Reflect.Basic |
| 10 | +import Freigen.Reflect.Recursion |
6 | 11 | import Freigen.Compile |
7 | | -import Freigen.Examples |
| 12 | +import Freigen.Examples.Circuit.Basic |
| 13 | +import Freigen.Examples.Storage |
| 14 | +import Freigen.Examples.Recursion |
| 15 | + |
| 16 | +/-! |
| 17 | +# Freigen — the root module |
| 18 | +
|
| 19 | +`import Freigen` brings in the whole library. Directories are pure namespaces (mathlib-style: |
| 20 | +no per-directory umbrella modules); this file lists every module, and the lakefile's |
| 21 | +`.andSubmodules` glob makes CI build any module even if it goes missing from this list. |
| 22 | +
|
| 23 | +Module map (details in each module's own docstring; the full story is in the README): |
| 24 | +
|
| 25 | +- `Freigen.Free` — the free monad `Free Op SOp` (`pure`/`op`/`hop`) and the generic interpreter |
| 26 | + `run`. |
| 27 | +- `Freigen.ITree.Basic`/`.Effect`/`.Eutt` — the coinductive denotation domain `Comp Op` |
| 28 | + (`ret`/`tau`/`vis`/`fail`), `bind` + its laws, the general-recursion combinator `mrec` (with |
| 29 | + `interp` and the call-extended signature `CallOp`), and weak bisimulation `≈` with its |
| 30 | + congruence algebra. |
| 31 | +- `Freigen.Ast.Tp`/`.Basic`/`.Sexp` — the object-type universe and reified primitives, the dumb |
| 32 | + typed AST `Code`/`Prog` with its uniform denotation `denoteProg` into `Comp`, and the |
| 33 | + S-expression serialization (**the** printer; grammar pinned in `Ast.Sexp`). |
| 34 | +- `Freigen.Reflect.Sound`/`.Basic`/`.Recursion` — `reflect%` compiles a `Free` program (a value, |
| 35 | + a function of its inputs, or a structural recursion) into a `Prog` bundled with its |
| 36 | + `≈`-soundness against `ofFree`: per-node congruence lemmas, the mode-parametric walk, and the |
| 37 | + recursion arm with the `reflect%`/`reflect_def` elaborators. |
| 38 | +- `Freigen.Compile` — the `DSL` class, `serialize`, and the `#compile prog => "path"` command |
| 39 | + behind the `lake build <lib>:prog` facet. |
| 40 | +- `Freigen.Examples.Circuit.Basic`/`.Storage`/`.Recursion` — the Lean-side unit-test suite |
| 41 | + (`CircOp` + scoped `hint`, the hint-less `StoreOp`, and `rec_` programs), each example pinning |
| 42 | + its runtime result, soundness statement, and serialized AST with `#guard_msgs`. The end-to-end |
| 43 | + path — `#compile` → `.prog` artifact → parsed and executed by the Rust SDK — is exercised by |
| 44 | + the separate goldens project (`examples/client/`) on CI. |
| 45 | +-/ |
0 commit comments