Proof models, verified runtime APIs, and differential checks for MoonBit
Dependencies
moon add mizchi/veriimport {
"mizchi/veri/bounds",
}
options("proof-enabled": true)pub fn digit(value : Int) -> Int {
proof_ensure: result => 0 <= result && result <= 9,
} {
@bounds.clamp(value, 0, 9)
}
test "clamp includes its upper bound" {
assert_eq(digit(10), 9)
}moon test --target js
moon prove| Guide | Contents |
|---|---|
| Package index | Available models, APIs, and guarantees |
| Runtime APIs and graph checking | Map / Set, search, checked arithmetic, codecs, Union-Find, parsers, paths, and topology |
| Collections and arrays | Lists, stacks, queues, priority queues, trees, and FixedArray update contracts |
| Bitvectors and numeric models | Fixed-width bits, orders, number theory, reals, and rounding errors |
| Verification guide | Solver setup, moon prove, QuickCheck, and shrinking |
| Benchmarks | Core comparisons, measurement conditions, and tuning results |
| Proof architecture | Why3 / SMT-LIB bindings, runtime correspondence, and trusted boundaries |
| IEEE 754 | Float / Double APIs, reference checks, proof scope, and limitations |
| Temporal model checking | moonx, Z3 / Apalache, and TaskGroup / lease-clock examples |
| Practical verification workflows | CI suites, saved counterexamples, model builders, and implementation comparisons |
Install
Download zipProof models, verified runtime APIs, and differential checks for MoonBit
Dependencies