|
1 | | -/-! |
2 | | -# Global Lint Options for Formal Verification Hardening |
3 | | -
|
4 | | -These options enforce strict variable tracking and tactic hygiene across |
5 | | -all modules in the CoEA Level-Based formalization. Every `.lean` file |
6 | | -in the project must `import LintOptions` to inherit these constraints. |
7 | | -
|
8 | | -## Paper Reference |
9 | | -Derived from: "Formally Verified Artificial Intelligence: Exhaustive Protocols |
10 | | -for Detecting and Preventing Heuristic Cheating in Lean 4 Proof Generation" |
11 | | --/ |
12 | | - |
13 | | --- ============================================================ |
14 | | --- STRICT VARIABLE TRACKING |
15 | | --- ============================================================ |
16 | | --- Forces the compiler to flag any declared variable that fails |
17 | | --- to structurally propagate through the proof body. |
18 | | - |
19 | | -set_option linter.unusedVariables true |
20 | | -set_option linter.unusedVariables.funArgs true |
21 | | -set_option linter.unusedVariables.patternVars true |
22 | | - |
23 | | --- ============================================================ |
24 | | --- NOTE: Tactic bloat detection is handled externally by |
25 | | --- semantic_linter.py (Rule 8) since linter.unusedTactic |
26 | | --- is not available in this Lean 4 version. |
27 | | --- ============================================================ |
28 | | - |
| 1 | +/-! |
| 2 | +# Global Lint Options for Formal Verification Hardening |
| 3 | +
|
| 4 | +These options enforce strict variable tracking and tactic hygiene across |
| 5 | +all modules in the CoEA Level-Based formalization. Every `.lean` file |
| 6 | +in the project must `import LintOptions` to inherit these constraints. |
| 7 | +
|
| 8 | +## Enforced checks |
| 9 | +
|
| 10 | +1. **Unused variables** — any declared variable that does not appear in the |
| 11 | + proof body is flagged by the compiler. |
| 12 | +2. **Function argument tracking** — unused function arguments are flagged. |
| 13 | +3. **Pattern variable tracking** — unused pattern-match binders are flagged. |
| 14 | +
|
| 15 | +## CI enforcement (additional, external) |
| 16 | +
|
| 17 | +The `.github/workflows/ci.yml` pipeline enforces: |
| 18 | +- `sorry` — forbidden outside `LBTCoupling.lean` (three documented deferred proofs) |
| 19 | +- `axiom` declarations — forbidden in all project files |
| 20 | +- `admit` — forbidden in all project files |
| 21 | +- `native_decide` — forbidden in all project files (bypasses the Lean kernel) |
| 22 | +
|
| 23 | +## Paper Reference |
| 24 | +Derived from: "Formally Verified Artificial Intelligence: Exhaustive Protocols |
| 25 | +for Detecting and Preventing Heuristic Cheating in Lean 4 Proof Generation" |
| 26 | +-/ |
| 27 | + |
| 28 | +-- ============================================================ |
| 29 | +-- STRICT VARIABLE TRACKING |
| 30 | +-- ============================================================ |
| 31 | +-- Forces the compiler to flag any declared variable that fails |
| 32 | +-- to structurally propagate through the proof body. |
| 33 | + |
| 34 | +set_option linter.unusedVariables true |
| 35 | +set_option linter.unusedVariables.funArgs true |
| 36 | +set_option linter.unusedVariables.patternVars true |
| 37 | + |
| 38 | +-- ============================================================ |
| 39 | +-- NOTE: native_decide is banned via CI (see ci.yml). |
| 40 | +-- It bypasses the Lean kernel by compiling to native code, |
| 41 | +-- so proofs using it are not kernel-checked. |
| 42 | +-- Use `decide` (kernel-checked) instead. |
| 43 | +-- ============================================================ |
0 commit comments