No description
  • OCaml 90.7%
  • JavaScript 4.5%
  • TeX 2%
  • Standard ML 1.4%
  • Nix 1.2%
  • Other 0.2%
Find a file
Christopher Mühl 35ec244ed9 feat(num): real-algebraic number kernel — replace the quadratic Ext tower (#19)
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.
2026-06-30 12:58:24 +00:00
.vscode docs: design spec for dogfooding blog tooling (build) 2026-06-28 22:12:59 +02:00
bin feat(cli): end-to-end beloch fold pipeline with example fixtures 2026-06-28 20:56:21 +02:00
blog docs: design spec for dogfooding blog tooling (build) 2026-06-28 22:12:59 +02:00
decisions feat(num): real-algebraic number kernel — replace the quadratic Ext tower (#19) 2026-06-30 12:58:24 +00:00
docs/superpowers feat(num): real-algebraic number kernel — replace the quadratic Ext tower (#19) 2026-06-30 12:58:24 +00:00
examples feat(syntax): axiom 6 — fold a point onto a line, crease through a fixed point (#17) 2026-06-30 11:04:07 +00:00
lib feat(num): real-algebraic number kernel — replace the quadratic Ext tower (#19) 2026-06-30 12:58:24 +00:00
notes feat(num): real-algebraic number kernel — replace the quadratic Ext tower (#19) 2026-06-30 12:58:24 +00:00
paper feat(num): real-algebraic number kernel — replace the quadratic Ext tower (#19) 2026-06-30 12:58:24 +00:00
plans feat(emit): Crease names in FOLD output + diagram labels (#5) 2026-06-29 11:17:48 +00:00
spec feat(num): real-algebraic number kernel — replace the quadratic Ext tower (#19) 2026-06-30 12:58:24 +00:00
tests feat(num): real-algebraic number kernel — replace the quadratic Ext tower (#19) 2026-06-30 12:58:24 +00:00
tools feat(syntax): axiom 6 — fold a point onto a line, crease through a fixed point (#17) 2026-06-30 11:04:07 +00:00
.envrc chore: scaffold project — ADRs, docs, OCaml/nix skeleton 2026-06-28 16:42:19 +02:00
.gitignore refactor(core): retire the dead crease-line path + gitignore render artifacts (#11) 2026-06-30 06:16:18 +00:00
.ocamlformat chore(quality): ocamlformat config + fatal warnings in dev (#6) 2026-06-29 13:32:54 +00:00
antipatterns.md feat(axiom3): Perpendicular through a point (perp --l through .p) (#1) 2026-06-29 07:07:41 +00:00
bibliography.md feat(num): real-algebraic number kernel — replace the quadratic Ext tower (#19) 2026-06-30 12:58:24 +00:00
bun.lock tools: fold2svg — render FOLD to SVG/PNG via Rabbit Ear (#4) 2026-06-29 10:07:55 +00:00
CLAUDE.md docs: add references.bib, citation discipline, gitignore refs/ 2026-06-28 17:59:58 +02:00
dune chore(quality): ocamlformat config + fatal warnings in dev (#6) 2026-06-29 13:32:54 +00:00
dune-project build: add zarith/alcotest/menhir setup and error module 2026-06-28 20:25:19 +02:00
flake.lock chore: scaffold project — ADRs, docs, OCaml/nix skeleton 2026-06-28 16:42:19 +02:00
flake.nix tools: fold2svg — render FOLD to SVG/PNG via Rabbit Ear (#4) 2026-06-29 10:07:55 +00:00
LICENSE.md chore: initial commit 2026-04-18 02:38:44 +02:00
package.json tools: fold2svg — render FOLD to SVG/PNG via Rabbit Ear (#4) 2026-06-29 10:07:55 +00:00
README.md chore: scaffold project — ADRs, docs, OCaml/nix skeleton 2026-06-28 16:42:19 +02:00

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 and notes/ 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