feat(compiler): Z3 SMT-LIB2 verification backend (speckl#21)

- New generator: compiler/src/generators/z3.ts (1,034 lines)
- Translates SpeckDL state → Z3 sort declarations
- Translates invariants → Z3 define-fun returning Bool
- Translates actions → Z3 transition predicates (enabled + step)
- BMC unrolling with --verify-depth=N (default: 10)
- CLI: --target=z3 or --target=all
- ToggleSwitch and TigerBeetleLedger generate valid SMT-LIB2
- KafkaKRaft spec generates valid SMT-LIB2 structure
- Complex forall/set expressions emit 'true' as placeholders (to be improved)
- All 41 existing tests still pass

This unblocks M1.2 (KRaft verification), M3.2 (Show HN), and M4.3 (OAuth verification).
This commit is contained in:
cos Agent 2026-05-09 22:28:39 -07:00 • committed by Scott Scoble
parent 582ef92586
commit 6c6daaf90f
14 changed files with 4787 additions and 49 deletions

View file

@ -1 +1 @@
{"version":"2.1.9","results":[[":__tests__/parser.test.ts",{"duration":39.401257999999984,"failed":false}],[":__tests__/e2e-wasm.test.ts",{"duration":108.43775999999997,"failed":false}],[":src/__tests__/compiler.test.ts",{"duration":11.341655000000003,"failed":false}]]}
{"version":"2.1.9","results":[[":__tests__/parser.test.ts",{"duration":49.959937000000025,"failed":false}],[":__tests__/e2e-wasm.test.ts",{"duration":90.40252399999997,"failed":false}],[":src/__tests__/compiler.test.ts",{"duration":11.602408000000025,"failed":false}]]}