Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/lean.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Report-only Lean job for the GC-admission proof (plan §12).
# It is never a required check and does not block a push or merge. The
# `lake build` evaluates the `#guard`s in Examples.lean, so a false example
# fails the job; the axiom receipt is checked against the three standard
# axioms only, and the product-LOC guard proves `formal/` contributes 0.
name: lean

on:
push:
branches: [main]
paths: ["formal/lean/**", ".github/workflows/lean.yml", "tools/check_lean_axioms.py", "tools/test_production_loc.py", "tools/production_loc.py"]
pull_request:
branches: [main]
paths: ["formal/lean/**", ".github/workflows/lean.yml", "tools/check_lean_axioms.py", "tools/test_production_loc.py", "tools/production_loc.py"]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: lean-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: lake build (reports only)
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v7.0.1
- uses: leanprover/lean-action@v1
with:
lake-package-directory: formal/lean/gc-admission
- name: no sorry or axiom
working-directory: formal/lean/gc-admission
run: |
! grep -RIn --include='*.lean' -E '\b(sorry|admit|native_decide)\b|^[[:space:]]*(axiom|constant)\b' GcAdmission.lean GcAdmission
- name: no non-standard axioms
working-directory: formal/lean/gc-admission
run: |
lake env lean GcAdmission/Axioms.lean 2>&1 | tee /tmp/lean-axioms.txt
python3 "$GITHUB_WORKSPACE/tools/check_lean_axioms.py" /tmp/lean-axioms.txt
- name: product LOC guard
run: python3 -B -m unittest discover -s tools -p 'test_production_loc.py'
1 change: 1 addition & 0 deletions formal/lean/gc-admission/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.lake/
6 changes: 6 additions & 0 deletions formal/lean/gc-admission/GcAdmission.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import GcAdmission.State
import GcAdmission.Transitions
import GcAdmission.Invariants
import GcAdmission.Proofs
import GcAdmission.Examples
import GcAdmission.Axioms
39 changes: 39 additions & 0 deletions formal/lean/gc-admission/GcAdmission/Axioms.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import GcAdmission.Proofs

/-!
GcAdmission/Axioms.lean

The axiom receipt for the main theorem, the §9.4 corollaries of the shipped
scope, the Inv7/EntriesSound/base-case lemmas, the Inv3/Inv4 witness
preservation and the force-remove end. There are 23 receipts.
`lake env lean GcAdmission/Axioms.lean` prints every closure; the workflow
feeds that output to `tools/check_lean_axioms.py`, which requires every
listed declaration and accepts only `propext`, `Classical.choice` and
`Quot.sound`. `sorryAx`, a user axiom or a native-decide proof fails the
check.
-/
open GcAdmission

#print axioms GcAdmission.step_preserves
#print axioms GcAdmission.no_reclaim_live
#print axioms GcAdmission.compact_barrier
#print axioms GcAdmission.reconcile_only_dead
#print axioms GcAdmission.done_is_operator
#print axioms GcAdmission.place_fallback_conservative
#print axioms GcAdmission.conservative_no_death
#print axioms GcAdmission.unordered_never_dead
#print axioms GcAdmission.restore_is_uncertain
#print axioms GcAdmission.ordered_rule
#print axioms GcAdmission.ordered_rule_sequential
#print axioms GcAdmission.compareMachine_uncertain_cases
#print axioms GcAdmission.unordered_place_never_dead
#print axioms GcAdmission.recorded_newer_is_uncertain
#print axioms GcAdmission.done_survives_compact
#print axioms GcAdmission.preview_is_done
#print axioms GcAdmission.Inv7_holds
#print axioms GcAdmission.Inv7_preserves
#print axioms GcAdmission.Inv3_preserves
#print axioms GcAdmission.Inv4_preserves
#print axioms GcAdmission.EntriesSound_preserves
#print axioms GcAdmission.empty_inv
#print axioms GcAdmission.force_remove_ends_mounts
Loading