Language layer (ADR 0010): - claim tables (定理|结论|前提|策略) parsed before first executable statement, extracted into Function.claims, removed from body - check --proof (default off): proof.claim_malformed / claim_ambiguous / claim_misplaced / claim_duplicate / claim_unknown_symbol / claim_unsupported / name_shadow Runtime layer (src/prove/): - ir.rs: Plan IR with stable hand-rolled JSON (schema 1) - lower.rs: subset acceptance (proof.while / proof.recursion / proof.dynamic_call), inlining for straight-line pure callees, opaque ops with effect labels, --allow-opaque whole-function downgrade - types.rs: literal-driven inference + branch confluence (proof.type_mismatch, exit 1) - emit.rs: deterministic Lean emission (Val × List Op, continuation style, -- mq: line:col anchors, «…» for dotted idents, theorem scaffolds from claims with unfold/split script) - mod.rs: prove/emit/audit/clean commands, Verdict taxonomy (error > unproved > rejected > unverified > checked > proved), exit codes 0/1/2 per design §3.3 Tests: tests/prove.rs 19 integration cases (no Lean required) + module unit tests; full suite stays green except the 3 documented env-limited failures. Docs: doc/design/prove-cli.md (§12 records deviations: result.ok/error vs drafted success/failure, Val-based run at P1, op arity, opaque effect label), doc/roadmap/prove.md, doc/adr/0010. Env fixes carried in: scratch dirs in test helpers honor CARGO_TARGET_DIR (needed on this machine's read-only target/debug).
测试夹具(金样例)
金样例与集成测试同处 tests/,用子目录区分类别。设计见 examples-and-tests.md。
| 路径 | 内容 |
|---|---|
structure/ |
函数、调用、分支、循环、表、导入、位置实参 |
keywords/ |
print、布尔与 and/or/not |
markup-v03/ |
Markup v0.3 草案金样例(#[ignore] 至旗标落地;见目录 README) |
errors/ |
期望失败(诊断文案) |
web_handbook.rs |
直接执行双语 Web 手册,验证递归布局参考工程的离线/在线一致性;先构建 Web 插件 |
quantum_handbook.rs |
直接执行 Quantum 双语手册围栏,校验科学期望、真实契约及双后端;先构建量子插件 |
gold.rs |
集成测试:跑上述夹具并比对 stdout / stderr |
cargo test
marqdo run tests/structure/hello.mq.md
marqdo view tests
marqdo catalog tests -o .marqdo
面向访客的可执行介绍在 public/(不含 errors/),见 user-site.md。