AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
翻譯準備中
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Origami folding sequences as programs, evaluated exactly into a FOLD file with every folded state
翻譯準備中
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
Origami folding sequences as programs. A program names points and creases and
folds along constructions that align them. Beloch evaluates it exactly, step by
step, into a FOLD file, the
exchange format of computational-origami tools. Its own renderer draws crease
patterns and folded states from that file, and other FOLD tools can open it.檢視完整 README ↗| crease pattern | folded |
|---|---|
The traditional crane, flat, in 28 statements:
examples/crane.bel. It follows steps 2 to 17 of Ida's
crane program
(Ida 2020, Fig. 7.19); her last
two steps open the wings in 3D, which Beloch does not model yet. The native
evaluator folds it; the browser playground cannot evaluate it yet.
Cicada, 26 statements: examples/cicada.bel, after Jimena Candia's diagram | Penguin, 19 statements: examples/penguin.bel, after Kelly Tan's diagram | Samurai helmet, 21 statements: examples/samurai-helmet.bel, after the diagram on origami.me |
All three are traditional models, each folded to its last flat state after a free diagram; the comments in a program name the diagram's steps.
Every drawing in this README is the renderer's output for the linked program.
scripts/render-readme-figures.sh redraws them, and CI fails when one no
longer matches its program.
paper square
fold (map .a onto .c) as --bd ; triangle: corner a onto corner c
reverse (map .b onto .c) as --h ; corner b tucked inside, onto c
reverse (map .d onto .c) as --v ; corner d likewise
These are the first three statements of the crane
(examples/crane.bel); they fold the preliminary base.
paper square gives the unit square with corners .a .b .c .d
counter-clockwise from the origin. A name with a dot is a point, a name with
two dashes is a crease. (map .a onto .c) is the fold line that carries one
point onto another, one of the seven Huzita-Justin axioms; as --bd names the
crease so later statements can use it.
Five verbs write to the paper. mark scores a crease and moves nothing,
fold folds along it, reverse makes an inside or outside reverse fold,
flip turns the paper over, and flatten folds a vertex flat along several
rays at once; given an odd number of them, it derives the one ray that is
missing. The evaluator works out where every layer goes and which creases end
up mountain or valley. The full grammar is in docs/reference/BELOCH-GRAMMAR.md
and on the grammar page.
Written origami languages predate computers: Smith's Origami Instruction Language (1975) is executed by a human folder. Fisher (1994) gave a textual folding language with its own syntax and a program that executes it and tracks face layering. Ida's Eos (Ida et al. 2009; Ida 2020) is the most comprehensive system. Its language Orikoto is a subset of the Wolfram Language inside Mathematica; it folds by the Huzita-Justin rules, maintains the superposition relation between faces, and proves constructions correct with Gröbner bases, while the folds themselves are solved numerically (Ida et al. 2008). Caruana and Pace (2007) embed the axioms in Haskell for plane constructions and derive the preconditions a construction needs. eGami (Fastag 2009) generates diagrams from direct manipulation. Rabbit Ear (Kraft 2016) is a JavaScript library with the seven axioms as functions, FOLD manipulation and folding simulation; a construction written with it is a JavaScript program, and it reads the FOLD files Beloch emits.
Beloch combines what these hold separately: a standalone language that always terminates, evaluated to its folded state in exact arithmetic.
The evaluator computes the folded state of a folding sequence in exact
real-algebraic arithmetic (FLINT qqbar): where every layer lies, the stacking
order of the layers, and which creases end up mountain or valley. A coincidence
such as "this corner lies on this crease" is decided, and a √2 from axiom 5 or
the cube root of axiom 7 stays exact through every later fold. Fisher's
executor places lines near vertices by tolerance and Eos solves each fold
numerically; here the question is decided exactly.
flatten folds a vertex flat along several rays at once. Given an odd number
of rays, it derives the ray that Kawasaki's condition forces and scores it as
a new crease. This expresses folds no Huzita-Justin axiom constructs from the
points a program has named; the swivel rabbit ear
(packages/core/tests/cases/bases/swivel-rabbit.bel)
is one.
Both rest on the language: a program is a finite sequence of constructions and
folds, with no loops, no recursion (a def sees only earlier defs) and no
host language
(decision 0009). Every program
terminates, its statements are its folding sequence, and every crease in the
FOLD output names the statement and the construction that made it.
examples/ evaluate end to end to their last flat
state, and the test suite checks assertions on them. Programs for the
jumping frog, the flapping bird and the traditional frog are drafts; each
stops at a step the kernel cannot fold yet.docs/reference/MODEL.md defines folded states and
the operations on them. Its first sections are reviewed; the section on
operations is a draft, and two of its lemmas, among them that a fold
introduces no crossing, have pending proofs.The playground needs no install. It runs the same evaluator, compiled to JavaScript with js_of_ocaml and backed by a WebAssembly build of FLINT. An operation that forces a value the browser backend cannot canonicalize says so and asks for the native evaluator; it never returns a wrong answer.
With Nix, the evaluator runs without a checkout:
nix run github:tophcodes/beloch -- fold program.bel # FOLD JSON on stdout
Rendering needs the development shell (below), which puts the renderer on
PATH:
beloch render examples/crane.bel crane.svg --view cp # or --view folded
beloch render examples/crane.bel --open # render and open it
Exactness is paid for in evaluation time. Measured on the benchmark corpus
with dune exec packages/core/bench/bench_fold.exe, on one developer machine:
| program | time |
|---|---|
| fish base (√2 throughout) | 0.24 s |
| swivel rabbit ear | 0.13 s |
| rabbit ear | 0.13 s |
| two-ear fish | 0.24 s |
| cube root (axiom 7) | 0.13 s |
These are programs of ten to thirty statements. How the kernel behaves on
chained cubic folds, or on a crease pattern with hundreds of vertices, has not
been measured. The corpus is listed at the top of
packages/core/bench/bench_fold.ml.
The evaluator core is OCaml, the tooling around it TypeScript. A Nix flake provides both toolchains, so Nix and direnv are the only prerequisites:
direnv allow # or: nix develop
check # every test suite
check-all # what CI runs, adding docs, README drawings, site
The kernel suites have known failures, recorded with their cause in
scripts/known-failures.txt; a failure beyond them fails the check.
BibTeX for all of them is in bibliography/references.bib.
@software{muehl_beloch,
author = {M{\"u}hl, Christopher},
title = {Beloch: origami folding sequences as programs},
year = {2026},
doi = {10.5281/zenodo.22884252},
url = {https://github.com/tophcodes/beloch}
}
GitHub's "Cite this repository" button offers the same entry and APA, read
from CITATION.cff.
Beloch is named after Margherita Piazzola Beloch, whose 1936 work showed that folding solves general cubic equations. Axiom 7 is the Beloch fold.
Licensed MIT (LICENSE.md).