Repository navigation
Formal Verification and Prover
Unlike toolchains that delegate verification to gigabyte-scale external C++ solvers with unpredictable timeouts, Lume embeds its multi-theory theorem prover (OmniProof-v4) directly inside the self-hosted compiler (compiler/stage1/lume/06_typecheck.src, 06b_phase3.src, lcaas.src) and pairs it with an independent, zero-compiler-import proof certificate kernel (compiler/stage1/lcert.src).
Running lume self-prove --json executes live compile-time proofs and native tests across the entire self-hosted standard library and domain engine suite with zero external scripts:
| Metric | Verified Result (v1.1.0) |
|---|---|
| Embedded Proof Engine | LumeCompiler-Embedded-OmniProof-v4 |
| Domain Proof Batteries | 16 / 16 certified (ok: true) |
| Formal Mathematical Obligations Verified |
1,682 (proven + @bound budget-checked) |
| Runtime-Fallback or Refuted Obligations | 0 |
| Native Unit Tests Passed |
372 (exit 0) |
Translation-Validated lstd.src Functions |
70 functions (426 proof cases) |
| Verified Sovereign Domains | 122 domains |
| Theory / Analysis | Diagnostic Codes | Self-Hosted Decision Procedure |
|---|---|---|
QF_LIA Linear Integer Arithmetic |
[V0001] |
Exact Fourier-Motzkin variable elimination, integer cutting planes, disjunctive or splitting, C99 truncated remainder bounds (-k + 1 <= r <= k - 1), 10^9 coefficient overflow guard, and Farkas dual certificates
|
QF_NIA Nonlinear Polynomials |
[V0001] |
Horner/Bernstein polynomial interval envelopes, native quadratic square-completion ((a*x + b)^2 >= 0), Positivstellensatz witnesses, sign-rule propagation, and 64-bit multiplication overflow guards (<= 3,037,000,499) |
QF_BV Bitvectors & Shifts |
[V0001] |
Exact bitmask bounds (0 <= bit_and(x, m) <= m), bit_or/bit_xor algebraic identities, and bounded left/right bit-shift semantics
|
Relational Octagons (±x ± y <= c) |
[V0001] |
Difference-bound & octagon closure tracking coupled index/length invariants across branches and loops |
| Termination, DAG & WCET Budgets |
[V0002], [K0006]
|
Lexicographic ranking measures for total fn, call-DAG acyclicity ([K0006]), and static instruction-cycle summation (@bound(N)) |
| Separation Logic & Perceus Reuse |
[O0001]–[O0030]
|
Disjoint heap frame rules (p != q), affine ownership dataflow, and alias-safe in-place cell reuse (pat_scrutinee_safe) |
| Constant-Time Secret Isolation |
[C0009], [C0011]
|
Secret taint lattices forbidding secret branches, divisions, memory indices, and non-kernel calls; paired with ltv [C0010]
|
## Quadratic non-negativity discharged by native square-completion / QF_NIA:
law shifted_parabola_floor(x: int) =
(x * x) - (6 * x) + 14 >= 5
## Conservation-proven ledger withdrawal with static WCET bound:
@no_alloc
@bound(40)
pub fn withdraw(balance: int, amount: int, fee: int) -> int / pure
requires balance >= 0 and amount > 0 and fee >= 0 and amount + fee <= balance
ensures result == balance - amount - fee and result >= 0 and result < balance
= balance - amount - fee
When a contract is falsifiable, compilation aborts fail-closed (exit 3) with [V0001] before a single byte of object code is emitted.
To keep interactive IDE and incremental builds instantaneous on large verified modules, compiler/stage1/lproof_cache.src caches discharged obligation digests keyed by normalized function AST, contract AST, transitive callee ensures signatures, and prover version:
-
Warm Cache Latency:
~6.9 msin-process /~7.4 msCLI (< 10 ms, verified inG-DWARF-CACHEacross20/20warm hits and19/20single-function edits). -
Sound Invalidation & Tamper Refusal: Automatically invalidates cached proofs whenever a function body, its
requires/ensures, or any transitive callee'sensureschanges; rejects corrupted cache entries with[PC0002]and refuses forged false-theorem cache injections with[PC0003].
Lume enforces strict separation between proof search (lcaas.src) and proof checking (lcert.src):
-
Zero-Compiler-ImportTCB:compiler/stage1/lcert.srcimports zero modules fromlumecorlcaas. It independently re-derives every Farkas linear combination, quadratic/Horner step, and frame condition from the emitted.cert.jsonartifact. -
Source-to-Certificate AST Binding (
--check-source): Runninglume verify-cert --check-source <file.src> <file.cert.json>re-parses the original.srcfile, verifies its SHA-256 digest, enforces kernel safety laws ([K0005]symbolicW^XDMA page protection and[K0006]mutual recursion prohibition), and ensures no obligation was omitted, weakened, or forged:-
[K0010]: Edited or mismatched source file refused. -
[K0011]: Deleted/missing proof obligation refused. -
[K0012]: Certificate referencing a non-existent function refused. -
[K0013]: Weakened postcondition goal, strengthened precondition hypothesis, captured caller parameter, loosened@bound, or weakenedlawrefused.
-
lume prove app.src
lume certify app.src > app.cert.json
lume verify-cert --check-source app.src app.cert.jsonEvery CI run executes tests/harness/prover_fuzz_gate.src (lume prover-fuzz) and claude_audit_gate.src:
- Generates and mutates hundreds of subtle false theorems across 6 verification domains (64-bit boundaries, division/modulo signs, records + variable shadowing, canonical arrays, separation/heap aliasing, nested quantifiers, wrapping
+%/-%/*%operators,2^40coefficients, and lexicographic termination measures). - Verifies that
0false theorems are ever accepted bylumec,lcaas, orlcert, while266valid control theorems are independently re-derived bylcert.
For post-codegen machine-code translation validation (ltv), clean-room .smt2 solving (lsmt + z3), 0/9,618 Masking MC/DC, 118 constant-time crypto kernels, and 2oo2D lockstep qualification, continue to Binary Assurance, Crypto & Qualification.
stage2 == stage3) · OmniProof-v4 (1,682 Proofs · 372 Tests · 122 Domains) · Signed Qualification Dossier PASS (106/106 Probes · 21/21 Gates · 0/9,618 Uncovered MC/DC) · 118 [C0011] Constant-Time Crypto Kernels · 9-Ecosystem Chameleon FFI ([I0003]) · 27 Targets · Licensed under Apache-2.0
- Home
- Getting Started
- Core Architecture & Assurance
- LumeLabs & Community
- Dossiers & Reference Manuals