Verified core
The Lux compiler front-end carries two layers of verification beyond its unit suite: machine-checked proofs over bounded domains, and property tests over generated inputs. This page is extracted from those source files at every site build — it is a view of the artifacts, not a description of them.
extracted from crates/lux-lang/src/ · 9 proofs · 50 properties · build 2026-06-29
Kani proofs
Bounded model checking: each harness exhaustively explores its stated domain — every input in the bound, not a sample. What it guarantees is exactly the property over exactly that domain, no more.
run: cargo kani -p lux-lang
Property invariants
Property-based testing: each invariant is checked against randomized generated inputs (256 cases per run by default) plus every previously-found failing seed. Weaker than a proof — it samples the domain — but it covers domains too large to bound.
run: cargo test -p lux-lang proptest
| P1 | Roundtrip idempotency for generated modules |
| P2 | Tokenize never panics for arbitrary strings |
| P3 | Parse never panics for arbitrary strings |
| P4 | Nesting depth limit prevents stack overflow |
| P5 | All keywords tokenize correctly |
| P6 | Item count preserved through roundtrip |
| P7 | Integer literals survive roundtrip |
| P8 | Binary operator associativity is stable |
| P9 | Simple string literals survive roundtrip |
| P10 | List literals survive roundtrip |
| P11 | Indentation with consistent spaces produces valid tokens |
| P12 | Dedent back to column 0 produces matching dedent tokens |
| P13 | Invalid dedent level produces an error |
| P14 | String escape sequences roundtrip correctly |
| P15 | Unicode escape sequences tokenize without panic |
| P16 | Integer overflow produces error, not panic |
| P17 | Float literals with varying decimal places roundtrip |
| P18 | Empty string roundtrips |
| P19 | Comments are stripped by lexer (don't appear in AST) |
| P20 | Multiple blank lines between items don't change AST |
| P21 | All binary operators produce stable roundtrips |
| P22 | Logical operators roundtrip |
| P23 | If/else statement roundtrip |
| P24 | For loop roundtrip |
| P25 | While loop roundtrip |
| P26 | Match statement roundtrip |
| P27 | Nested function definitions roundtrip |
| P28 | Record literal roundtrip |
| P29 | Lambda expression roundtrip |
| P30 | Pipe operator roundtrip |
| P31 | Strings with newlines roundtrip correctly (escape bug regression) |
| P32 | Strings with tabs roundtrip correctly |
| P33 | Strings with null bytes roundtrip correctly |
| P34 | Strings with escaped braces roundtrip |
| P35 | Strings with backslash roundtrip |
| P36 | Strings with quotes roundtrip |
| P37 | Mixed escape sequences in one string roundtrip |
| P38 | Boolean roundtrips |
| P39 | Range expressions roundtrip |
| P40 | Unary operators roundtrip |
| P41 | Field access chains roundtrip |
| P42 | Function calls with arguments roundtrip |
| P43 | Index expressions roundtrip |
| P44 | Return statement roundtrip |
| P45 | Unless statement roundtrip (Ruby-style) |
| P46 | Until loop roundtrip (Ruby-style) |
| P47 | Null coalesce operator roundtrip |
| P48 | String interpolation roundtrip |
| P49 | Signal expression roundtrip |
| P50 | Memo expression roundtrip |
What this does and doesn't claim
- Proofs hold over their stated bounded domains — e.g. all printable ASCII, not all of Unicode.
- Property tests sample; a passing run is evidence, not proof.
- Coverage is the compiler front-end (lexer, parser, printer). The evaluator and runtime are covered by their unit suites, not by these artifacts.
- This page regenerates from the source files at every site build. A claim listed here exists in the code on the build date shown above.
Determinism is gated separately: every compiler emit surface is byte-deterministic and checked in CI (see format and check in CI).