No description
- OCaml 90.7%
- JavaScript 4.5%
- TeX 2%
- Standard ML 1.4%
- Nix 1.2%
- Other 0.2%
Slice 1 of axiom 7 (Justin ⑦, the Beloch fold): replaces `Num`'s quadratic `Ext` tower with an exact real-algebraic kernel, so creases of degree ≤ 3 — including the casus-irreducibilis cubics axiom 7 needs — become representable. No `.bel` surface change; axioms 1–6 are unchanged in behaviour.
- New `lib/poly.ml`: ℚ-polynomials — arithmetic, Sylvester resultant, Euclidean gcd/squarefree, Sturm sequences, real-root isolation. `[bpr2006]`
- `lib/num.ml` rewritten: `Rat of Q.t | Alg { poly; lo; hi }` — the unique real root of a squarefree ℚ-polynomial in an isolating rational interval. Arithmetic builds the result's defining polynomial by resultant-via-interpolation (`Alg±Rat`/`Alg×Rat` fast paths); `sqrt` via `poly(y²)`; exact `sign`/`compare`/`equal` by interval refinement; new `real_roots`. The `Rat` fast-path keeps axioms 1–4 in ℚ.
- Public `Num` interface frozen (+ `real_roots`), so `geom`/`isometry`/`fold_state`/`fold_emit`/`eval` compile unchanged.
- ADR 0012 supersedes 0010; `bpr2006` (Basu–Pollack–Roy) added to the bibliography.
The casus irreducibilis is why a `Cbrt` generator won't do — three real roots that aren't real radicals — so the kernel stays on the real line via defining-polynomial + isolating interval, no complex arithmetic. Cost: √-heavy axioms 5/6 lose the closed-form `a+b√d` speed; correctness over speed, as ADR 0010 already bargained.
|
||
|---|---|---|
| .vscode | ||
| bin | ||
| blog | ||
| decisions | ||
| docs/superpowers | ||
| examples | ||
| lib | ||
| notes | ||
| paper | ||
| plans | ||
| spec | ||
| tests | ||
| tools | ||
| .envrc | ||
| .gitignore | ||
| .ocamlformat | ||
| antipatterns.md | ||
| bibliography.md | ||
| bun.lock | ||
| CLAUDE.md | ||
| dune | ||
| dune-project | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE.md | ||
| package.json | ||
| README.md | ||
Beloch, named after Margherita Piazzola Beloch, is a declarative language for origami, built on the Huzita-Justin axioms, that compiles source models into folded states, crease patterns, and step-by-step folding diagrams.
Status: early restart. Scaffolding and design records are in place; the minimal evaluator core (v0.0) is not implemented yet. See
decisions/for the architecture andnotes/for the design journal.
Development
The evaluator core is OCaml; tooling lives at the edges in TypeScript (see decision 0001). A Nix flake provides the OCaml toolchain (dune, menhir, sedlex, ocaml-lsp, …):
direnv allow # or: nix develop
dune build
dune exec beloch -- --version
Layout
lib/ evaluator core (OCaml library)
bin/ the `beloch` CLI
spec/ human-readable language specification (grows per increment)
decisions/ architecture decision records (ADRs)
notes/ dated design journal
examples/ .bel programs, tagged works / aspirational / anti
paper/ the eventual write-up (arXiv / JOSS / OSME)
antipatterns.md dead ends and rejected approaches
bibliography.md annotated sources