Commit bb8b614
feat: implement Phase 1 — ternary probabilistic modelling core
Rewrite manifest to parse betlangiser.toml with probabilistic variable
declarations (Normal, Uniform, Beta, Bernoulli, Custom distributions),
simulation config (samples, confidence, seed, output format), and full
parameter validation.
Implement ABI types: Distribution with validated constructors,
TernaryBool with complete Kleene strong three-valued logic (AND/OR/NOT/
implies), ConfidenceInterval, SimulationConfig, and SimulationResult.
Add codegen submodules (parser, distribution, codegen) that generate
Betlang source code with distribution declarations, uncertainty
propagation rules, ternary logic helpers, and Monte Carlo entry points.
84 tests pass: unit tests for all ABI types, codegen modules, manifest
validation, and integration tests covering init, generate, end-to-end
pipeline, De Morgan's laws for ternary logic, and all distribution types.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 546fedb commit bb8b614
11 files changed
Lines changed: 3270 additions & 47 deletions
File tree
- examples/risk-model
- src
- abi
- codegen
- manifest
- tests
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
0 commit comments