Skip to content

Commit a4e1866

Browse files
chore(estate): betlang reconciliation + 6a2 currency + license branding (#60)
## betlang reference-pass (estate reconciliation + hygiene) — increment 1 Part of the estate-wide reconciliation/hygiene checkpoint, with **betlang as the reference repo**. ### Branch reconciliation → one clean `main` - `estate-standardization-20260607` is **fully merged into `main`** (`main..branch` is empty; the branch tip is the merge-base). Nothing unmerged to lose. - Deleting it is **blocked in this environment** (git proxy returns `HTTP 403` on `push --delete`; no MCP delete-branch tool). → recorded as an **owner UI action**. After it's gone, `main` is the sole branch. ### Metadata currency (`.machine_readable/6a2/`) - **STATE.a2ml**: reflects PR #56 — echo operations are now *typed* (the functor/comonad surface: `echo`, `echo_output`, `echo_map`, `echo_duplicate`, `echo_to_residue`, `sample_echo`). M5/M6 marked done (type-level); stale "echo operations deferred" blocker removed; next-actions refreshed (harden checker, TP-5, `bet_echo` runtime); maintenance notes 38 bet-check tests. - **META.a2ml / ECOSYSTEM.a2ml**: drop the standards-**banned** `PMPL-1.0` token in descriptive metadata → `Palimpsest License (SPDX: MPL-2.0)`. (betlang's actual SPDX headers + root `LICENSE` were already correct MPL-2.0.) ### ⚠️ Flagged for the owner (cannot verify from here — out of MCP scope) `Causals.jl` and `BowtieRisk.jl` both ship `LICENSES/PMPL-1.0-or-later.txt` (the *banned* identifier) while declaring MPL-2.0 canonical. Two freshly-templated repos with the identical artifact strongly implies **`rsr-template-repo` still ships the banned license file** — please check the template + `standards`. ### Still to come on this branch (betlang reference pass) CI-health-at-root verification, issues for tracked proof/tech-debt, `bot_directives/` (greenfield format — needs a schema decision), and the repo wiki (currently none). https://claude.ai/code/session_01QGi8GND5yNWgDyfReVEPYs --- _Generated by [Claude Code](https://claude.ai/code/session_01QGi8GND5yNWgDyfReVEPYs)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5f89192 commit a4e1866

11 files changed

Lines changed: 450 additions & 17 deletions

File tree

.machine_readable/6a2/ECOSYSTEM.a2ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
# ECOSYSTEM.a2ml — Betlang ecosystem position
55
[metadata]
66
version = "1.1"
7-
last-updated = "2026-06-02"
7+
last-updated = "2026-06-13"
88

99
[project]
1010
name = "Betlang"
1111
purpose = "Ternary probabilistic programming with Dutch book prevention and gambling harm reduction"
1212
role = "programming-language"
13-
license = "PMPL-1.0 (SPDX: MPL-2.0)"
13+
license = "Palimpsest License (SPDX: MPL-2.0)"
1414
repo = "https://github.com/hyperpolymath/betlang"
1515

1616
[position-in-ecosystem]
@@ -54,7 +54,7 @@ role = "AffineScript tooling"
5454
[[related-projects.tooling]]
5555
name = "palimpsest-license"
5656
repo = "https://github.com/hyperpolymath/palimpsest-license"
57-
role = "PMPL-1.0 license definition (betlang uses PMPL-1.0 / SPDX: MPL-2.0)"
57+
role = "Palimpsest License definition (betlang uses Palimpsest License / SPDX: MPL-2.0)"
5858

5959
[external-dependencies]
6060
proof-verifier = "Lean 4 (leanprover/lean4:v4.15.0)"

.machine_readable/6a2/META.a2ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ version = "1.1"
77
last-updated = "2026-06-02"
88

99
[project-info]
10-
license = "PMPL-1.0 (SPDX: MPL-2.0)"
10+
license = "Palimpsest License (SPDX: MPL-2.0)"
1111
author = "Jonathan D.A. Jewell (hyperpolymath)"
1212
contact = "j.d.a.jewell@open.ac.uk"
1313

.machine_readable/6a2/STATE.a2ml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
[metadata]
66
project = "betlang"
77
version = "0.8.0-dev"
8-
last-updated = "2026-06-02"
8+
last-updated = "2026-06-13"
99
status = "active"
10-
session = "affinescript-alignment + governance + echo-types — 2026-06-02"
10+
session = "echo operations (functor/comonad surface) + estate reconciliation — 2026-06-13"
1111

1212
[project-context]
1313
name = "Betlang"
@@ -16,7 +16,7 @@ Safe probabilistic programming with Dutch book prevention and gambling harm redu
1616
Core primitive: (bet A B C) — ternary stochastic choice. Type system adds Echo T / EchoR T
1717
structured-loss formers (proof-relevant, ghost-erased). Proofs machine-checked in Lean 4.
1818
"""
19-
completion-percentage = 87
19+
completion-percentage = 88
2020

2121
[position]
2222
phase = "proof-foundation + governance-alignment + echo-types-integration"
@@ -28,34 +28,42 @@ maturity = "experimental" # experimental | alpha | beta | production | lts
2828
# PR #54: Governance/CI debt — Cargo.toml license, rackunit conflict, timeout-minutes,
2929
# .governance-allowlist, .hypatia-ignore, delete Java, ReScript → AffineScript
3030
# PR #55: Echo T / EchoR T type formers in Rust checker + Lean + spec + docs
31+
# PR #56: Echo operations typed — echo / echo_output / echo_map / echo_duplicate /
32+
# echo_to_residue / sample_echo (functor + comonad surface; type-level/ghost).
33+
# 38 bet-check tests pass; proof-scan clean. README/docs/PROOF tracking updated.
34+
# Session 2026-06-13: estate reconciliation — synced local to main; identified
35+
# estate-standardization-20260607 as FULLY MERGED into main (safe to delete;
36+
# deletion blocked by git proxy HTTP 403 → owner UI action). Metadata currency.
3137

3238
[route-to-mvp]
3339
milestones = [
3440
"M1: Proof foundation — lakefile.lean + proofs.yml CI + banned-pattern gate [DONE #53]",
3541
"M2: Governance clean — licence, language policy, Racket tests, timeout [DONE #54]",
3642
"M3: Echo types core — Type::Echo/EchoR, unify, lower, Lean Ty.echo/echoR [DONE #55]",
3743
"M4: Discharge substTop_preserves_typing axiom (PROOF-STATUS TP-4) [DONE — now a proved theorem; axiom-free core]",
38-
"M5: Echo operations — echo_intro, proj1, echo_to_residue; typing rules",
39-
"M6: sample_echo / bet_echo probabilistic bridge",
44+
"M5: Echo operations — echo/echo_output/echo_map/echo_duplicate/echo_to_residue typing rules [DONE #56, type-level]",
45+
"M6: sample_echo probabilistic bridge [DONE #56, type-level]; bet_echo runtime retention [deferred]",
4046
"M7: Julia backend Phase 2 — core language features",
4147
]
4248

4349
[proof-obligations]
44-
# See PROOF-STATUS.md for the full register (13 obligations)
50+
# See PROOF-STATUS.md for the full register
4551
proved = ["TP-1 Progress", "TP-2 Preservation", "TP-3 Monad laws", "TP-4 substTop_preserves_typing (discharged — axiom-free)"]
4652
axioms = []
47-
remaining = 9
53+
remaining = 10 # incl. new TP-5 (echo-operation metatheory in Lean — mirrors #56's typed surface)
4854

4955
[blockers-and-issues]
5056
issues = [
51-
"bet-wasm E0308: pre-existing WASM backend breakage (match arm type mismatch, not caused by any of #53-55)",
52-
"Echo operations deferred: no echo_intro/proj1/echo_to_residue until runtime/proof story settled",
57+
"bet-wasm E0308: pre-existing WASM backend breakage (match arm type mismatch, not caused by any of #53-56)",
58+
"Echo operations typed at type-level (#56: functor/comonad surface); runtime residue payload + bet_echo retention still deferred; Lean metatheory is TP-5",
59+
"estate-standardization-20260607 branch fully merged into main; deletion blocked by git proxy (403) — owner UI action",
5360
]
5461

5562
[critical-next-actions]
5663
actions = [
57-
"TP-5: Echo-operation typing rules + metatheory in Lean (echo_intro, echo_to_residue, proj1)",
58-
"sample_echo / bet_echo probabilistic bridge (Dist T → Echo T)",
64+
"Harden bet-check: occurs check in unify() + real type schemes (replace shared-var pseudo-polymorphism)",
65+
"TP-5: mirror #56's echo-operation typing rules in Lean + re-establish Progress/Preservation",
66+
"bet_echo runtime branch-tag retention (Dist/bet collapse → Echo residue payload)",
5967
"Julia backend Phase 2 — core language features",
6068
"bet-wasm E0308: fix pre-existing WASM backend match-arm type mismatch",
6169
]
@@ -71,9 +79,9 @@ config = "Nickel / 6a2 Scheme (.a2ml)"
7179
banned = ["TypeScript (except playground sandbox)", "Node.js", "npm", "Go", "Python", "Java", "Kotlin", "Swift"]
7280

7381
[maintenance-status]
74-
last-run-utc = "2026-06-02T14:00:00Z"
82+
last-run-utc = "2026-06-13T00:00:00Z"
7583
last-result = "pass" # unknown | pass | warn | fail
7684
# Racket tests: pass (current + 8.11 + 8.12 on PR #54)
7785
# Governance: pass (all checks on PR #54)
7886
# Lean proofs: pass (proofs.yml lake build on PR #53)
79-
# Echo types: pass (cargo test -p bet-check: 27 tests pass on PR #55)
87+
# Echo types: pass (cargo test -p bet-check: 38 tests pass on PR #56 — 27 base + echo operations)

wiki/Architecture.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!-- SPDX-License-Identifier: MPL-2.0 -->
2+
<!-- SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) -->
3+
# Architecture
4+
5+
BetLang is a **multi-layer system** with clearly separated responsibilities. Each layer
6+
has a single job, and the boundaries are deliberate.
7+
8+
| Layer | Language | Responsibility | Authority |
9+
|-------|----------|----------------|-----------|
10+
| **Frontend / spec** | Racket | `#lang betlang`; `syntax-parse` + nanopass IR; lazy ternary semantics | **Source of truth for semantics** |
11+
| **Compute kernel** | Julia | High-performance numerical/statistical execution (Distributions.jl, StatsBase.jl, Random.jl); the uncertainty number tower migrates here | Performance path |
12+
| **Proof / verification** | Lean 4 | Machine-checks Progress, Preservation, distribution monad laws; `lakefile.lean` + `proofs.yml` | Trust |
13+
| **Compiler tooling** | Rust | `bet-core` (types incl. `Echo`/`EchoR`), `bet-check` (HM checker + unifier), `bet-parse` (LALRPOP), `bet-wasm` (paused) | Tooling only — **not** semantics |
14+
15+
## Why separate them
16+
17+
- **Racket is canonical** because the lazy ternary semantics (`(bet A B C)` evaluates
18+
only the chosen branch) are subtle and must have one unambiguous definition. The Rust
19+
checker and Lean proofs *model* that semantics; they do not redefine it.
20+
- **Julia is the kernel** because the numeric/statistical workloads (sampling, inference,
21+
the number tower) want a mature scientific stack. BetLang drives Julia; it does not
22+
reimplement it. See [Formal Verification](Formal-Verification) for how this complements
23+
rather than competes with the scientific-computing incumbents.
24+
- **Lean is firewalled** so the trusted base stays small and auditable
25+
(`docs/proof-debt.adoc`): zero `sorry`, axiom-free core.
26+
- **Rust is tooling** (type-check, parse, future WASM) — convenient and fast, but
27+
explicitly *not* authoritative. The workspace `Cargo.toml` says as much at the top.
28+
29+
## Repository layout (orienting)
30+
31+
```
32+
core/ Racket frontend — canonical semantics
33+
lib/ Racket libraries (distributions, sampling, markov, risk, …)
34+
compiler/ Rust tooling — bet-core / bet-check / bet-parse / bet-eval / bet-codegen / bet-wasm
35+
proofs/ Lean 4 — BetLang.lean + theorems/ + papers/
36+
verification/ RSR verification posture (coverage, safety_case, traceability)
37+
docs/ Design docs (echo-types.adoc, number-tower, semantics, comparison)
38+
.machine_readable/ 6a2 state/meta + contractiles + self-validating (k9) + svc
39+
```
40+
41+
See [Type System](Type-System) and [Echo Types](Echo-Types) for the `bet-check` layer in
42+
depth, and [Roadmap](Roadmap) for what each layer still owes.

wiki/Echo-Types.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<!-- SPDX-License-Identifier: MPL-2.0 -->
2+
<!-- SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) -->
3+
# Echo Types — Structured Loss as a Typed Object
4+
5+
When a computation collapses information — a `(bet A B C)` picks one branch, a `sample`
6+
marginalises away which draw fired — the *fact of what was lost* normally vanishes.
7+
**Echo types** make that residue a first-class, typed object.
8+
9+
## The idea (and where it comes from)
10+
11+
Upstream, in the Agda repo [`echo-types`](https://github.com/hyperpolymath/echo-types)
12+
(the **source of truth**), the echo at `y : B` for a map `f : A → B` is the fibre
13+
14+
```
15+
Echo f y := Σ (x : A), (f x ≡ y)
16+
```
17+
18+
— a *proof-relevant* record of which inputs collapsed onto `y`. BetLang is
19+
**non-dependent**, so it does not represent the literal fibre. Instead it adds two
20+
**unary type formers**:
21+
22+
| Former | Meaning |
23+
|--------|---------|
24+
| `Echo T` | A `T`-value carrying a proof-relevant residue of retained loss. **Distinct from `T`.** |
25+
| `EchoR T` | The strict, non-recoverable residue of `Echo T`. |
26+
27+
The load-bearing invariant: **`Echo T` is not `T`.** `unify(Echo T, T)` fails *by design*
28+
(and so does `unify(Echo T, EchoR T)`). There is **no implicit forgetting** `Echo T → T`;
29+
you must ask for the value back explicitly. If `Echo T` unified with `T`, the checker
30+
would lose the entire point of retained loss.
31+
32+
## Operations (the functor + comonad surface)
33+
34+
`bet-check` makes the formers *operational* via polymorphic builtins (each instantiated
35+
with a fresh carrier per use site, so they are genuinely generic). Surface syntax is
36+
ordinary application — `echo(x)` — so no grammar change was needed.
37+
38+
| Operation | Typing rule | Role |
39+
|-----------|-------------|------|
40+
| `echo` | `'a → Echo 'a` | introduction (`echo-intro`) |
41+
| `echo_output` | `Echo 'a → 'a` | **explicit** projection — the comonad **counit** |
42+
| `echo_map` | `('a → 'b) → Echo 'a → Echo 'b` | functor action (`map-over`) |
43+
| `echo_duplicate` | `Echo 'a → Echo (Echo 'a)` | comonad comultiplication |
44+
| `echo_to_residue` | `Echo 'a → EchoR 'a` | lower a full echo to its strict residue |
45+
| `sample_echo` | `Dist 'a → Echo 'a` | probabilistic-support bridge — retains what `sample` discards |
46+
47+
Together `echo_map` / `echo_output` / `echo_duplicate` give `Echo` the **functor +
48+
comonad** structure. This is the *ungraded, ghost shadow* of the **graded comonad of
49+
structured loss** proved upstream (`EchoGradedComonad.agda`: `gextract` / `gduplicate` /
50+
coassoc). BetLang carries the *typing*; the *laws* live in the Agda (and are tracked for
51+
Lean as obligation **TP-5**).
52+
53+
## Ghost / erased
54+
55+
`Echo T` and `EchoR T` **erase to `T` at runtime** — no residue payload is materialised
56+
yet. The value today is the *typed discipline* (you cannot accidentally forget; forgetting
57+
is explicit and visible in types), plus the cross-repo anchoring to machine-checked
58+
semantics. A future pass may give the residue a runtime representation (branch tags,
59+
support traces); until then BetLang deliberately avoids premature commitment.
60+
61+
## The `bet` bridge
62+
63+
The core primitive bridges to `Echo` *by composition*, with no new machinery:
64+
`echo(bet a b c) : Echo T` already type-checks — viewing the branch-collapse as a
65+
retained-loss site. A dedicated `bet_echo` is only needed for **runtime** branch-tag
66+
retention (deferred).
67+
68+
## Why this matters
69+
70+
`Echo` turns "irreversible computation" into "reversible *representation*": the collapse
71+
still happens, but the type remembers that it happened and refuses to silently pretend it
72+
didn't. That is the seed of provenance, auditability, and differential/▢-style reasoning
73+
in a probabilistic setting — see [Formal Verification](Formal-Verification) for how this
74+
slots into BetLang's proof story and how it sets BetLang apart from untyped numeric tools.
75+
76+
## Source
77+
78+
- `compiler/bet-core/src/types.rs``Type::Echo`, `Type::EchoR`
79+
- `compiler/bet-check/src/lib.rs``echo_builtin_type`, unification distinctness, tests
80+
- `docs/echo-types.adoc` — full design rationale
81+
- `proofs/BetLang.lean``Ty.echo` / `Ty.echoR` (formers; operations' metatheory is TP-5)

wiki/Formal-Verification.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<!-- SPDX-License-Identifier: MPL-2.0 -->
2+
<!-- SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) -->
3+
# Formal Verification — and How BetLang Compares
4+
5+
BetLang's claim is not "a faster numeric kernel" — Julia, R, Octave, Scilab, Mathematica
6+
and Maple are all formidable there. Its claim is **typed, proof-anchored uncertainty**:
7+
the language's loss/uncertainty objects are *checked by a type system* and *grounded in
8+
machine-checked metatheory*. This page covers both halves.
9+
10+
## The Lean 4 layer
11+
12+
The core calculus is mechanised in `proofs/BetLang.lean` as a first-class Lake project
13+
(CI-verified by `.github/workflows/proofs.yml`):
14+
15+
| ID | Theorem | Status |
16+
|----|---------|--------|
17+
| TP-1 | **Progress** — a well-typed closed term is a value or steps | ✅ proved |
18+
| TP-2 | **Preservation** — typing is preserved under reduction | ✅ proved |
19+
| TP-3 | **Distribution monad laws** (left id, right id, assoc) | ✅ proved |
20+
| TP-4 | Discharge the `substTop_preserves_typing` axiom | ✅ proved — **axiom-free core** |
21+
| TP-5 | Echo-operation typing rules + metatheory (mirror `bet-check`) | ⏳ open |
22+
23+
**Zero `sorry`.** After TP-4 the only axiom dependencies are Lean 4 core
24+
(`propext`, `Classical.choice`, `Quot.sound`). The trusted-base ledger lives in
25+
`docs/proof-debt.adoc`; obligations are enumerated in `PROOF-NEEDS.md` and tracked in
26+
`PROOF-STATUS.md`. A banned-pattern gate (`tools/proof-scan.sh`) forbids
27+
`sorry`/`admit`/`postulate`/`believe_me`/`unsafeCoerce` in CI.
28+
29+
The Echo formers currently appear in Lean as *type formers only* (`Ty.echo`, `Ty.echoR`),
30+
so Progress/Preservation are unaffected; mirroring the operational typing rules from
31+
`bet-check` is the open obligation **TP-5**.
32+
33+
## How BetLang compares to the scientific/CAS languages
34+
35+
BetLang complements rather than competes with these tools — and the differentiator is the
36+
type/proof layer, not raw numerics.
37+
38+
| System | Uncertainty model | Typed loss/uncertainty? | Machine-checked metatheory? | Relationship to BetLang |
39+
|--------|-------------------|--------------------------|------------------------------|--------------------------|
40+
| **Julia** | Distributions.jl, rich numerics | No (dynamic types) | No (the *companion* `EchoTypes.jl` is the executable echo shadow) | **Compute kernel** — BetLang's high-performance backend; `StatistEase` cross-checks |
41+
| **R** | distributions, sampling | No | No | Statistics interchange; BetLang adds typed support-retention |
42+
| **Octave / Scilab** | numeric matrices, Monte Carlo | No | No | Numeric kernels; no notion of typed information-loss |
43+
| **Mathematica** | symbolic + probability | No (symbolic, untyped) | No | Symbolic CAS peer; BetLang is symbolic-*and*-typed-*and*-proved |
44+
| **Maple** | symbolic + statistics | No | No | As Mathematica |
45+
46+
The recurring column is the point: **none of R/Octave/Scilab/Mathematica/Maple gives
47+
uncertainty or information-loss a *type*, and none ships a machine-checked metatheory.**
48+
BetLang does both:
49+
50+
- **Typed uncertainty** — the [Number Tower](Number-Tower) (14 systems: Gaussian, interval,
51+
fuzzy, Bayesian, VaR/CVaR, surreal, p-adic, imprecise, Dempster–Shafer, …) *is* the type
52+
system, and [Echo types](Echo-Types) type the *loss* itself.
53+
- **Proof-anchored** — the Lean 4 metatheory above, plus the Echo formers' meaning being
54+
inherited from the machine-checked Agda [`echo-types`](https://github.com/hyperpolymath/echo-types).
55+
56+
So the honest framing: **Julia is where BetLang computes; the Agda `echo-types` spine is
57+
where BetLang's loss types get their meaning; Lean is where BetLang's calculus is proved
58+
sound.** R/Octave/Scilab/Mathematica/Maple are the numeric/symbolic incumbents BetLang
59+
positions against by adding the typed, proof-backed layer they lack.
60+
61+
## See also
62+
63+
- [Echo Types](Echo-Types) — the structured-loss formers and operations
64+
- [Type System](Type-System) — the Hindley–Milner core that hosts them
65+
- `docs/proof-debt.adoc`, `PROOF-STATUS.md` — the trusted-base ledger

wiki/Home.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!-- SPDX-License-Identifier: MPL-2.0 -->
2+
<!-- SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) -->
3+
# BetLang Wiki
4+
5+
**BetLang** is a *Symbolic Probabilistic Metalanguage* — a **probabilistic computer
6+
algebra system (CAS)**, not a betting language. Its one idea:
7+
8+
> Computation is structured choice under uncertainty.
9+
10+
The fundamental primitive is the ternary form `(bet A B C)` — a probabilistic, **lazy**
11+
choice between three branches (only the selected branch is evaluated). On top of that
12+
sit two things that distinguish BetLang from every mainstream numeric/CAS tool: a
13+
**type system that treats uncertainty and information-loss as first-class typed objects**
14+
(the uncertainty number tower + **Echo types**), and a **machine-checked metatheory**
15+
(Lean 4).
16+
17+
## Map of this wiki
18+
19+
| Page | What it covers |
20+
|------|----------------|
21+
| [Architecture](Architecture) | The four-layer system: Racket (authoritative semantics) · Julia (compute kernel) · Lean 4 (proofs) · Rust (compiler tooling) |
22+
| [The `bet` Primitive & Ternary Semantics](Ternary-Semantics) | `bet` / `bet/weighted` / `bet/conditional` / `bet/lazy`; Kleene ternary logic vs ternary probabilistic belief |
23+
| [Type System](Type-System) | Hindley–Milner core in `bet-check`; the Echo/`EchoR` structured-loss formers and their operations |
24+
| [Echo Types](Echo-Types) | Structured loss as a typed object; the functor/comonad surface; the cross-repo Agda proof anchor |
25+
| [Formal Verification](Formal-Verification) | Lean 4 Progress / Preservation / monad laws; the proof-debt ledger; **how BetLang compares to Julia, R, Octave, Mathematica, Maple, Scilab** |
26+
| [Uncertainty Number Tower](Number-Tower) | The 14 uncertainty-aware number systems (Gaussian, interval, fuzzy, Bayesian, p-adic, Dempster–Shafer, …) |
27+
| [Roadmap](Roadmap) | Milestones M1–M7, open proof obligations, next advances |
28+
29+
## Status (2026-06-13)
30+
31+
| Layer | State |
32+
|-------|-------|
33+
| Racket frontend | ✅ Authoritative semantics |
34+
| Lean 4 proofs | ✅ Progress + Preservation + monad laws; **axiom-free core** (TP-4 discharged) |
35+
| Rust type-checker (`bet-check`) | ✅ HM + Echo formers **+ typed echo operations** (functor/comonad surface) |
36+
| Julia compute backend | 🟡 Active development |
37+
| `bet-wasm` backend | ⏸️ Paused (pre-existing build issue) |
38+
39+
## Ecosystem position
40+
41+
BetLang is the **applied probabilistic consumer** in a three-repo Echo-types spine:
42+
- [`echo-types`](https://github.com/hyperpolymath/echo-types) — Agda, the **source of truth** (constructive, `--safe --without-K`).
43+
- [`EchoTypes.jl`](https://github.com/hyperpolymath/EchoTypes.jl) — Julia, the **executable finite-domain shadow**.
44+
- **BetLang** — borrows the unary `Echo T` / `EchoR T` formers as a *typed discipline* over probabilistic loss.
45+
46+
License: **Palimpsest License (SPDX: MPL-2.0)**.

0 commit comments

Comments
 (0)