Repository navigation
proofs: add standalone AArch64 Fl4SpecA64 ↔ l4v ASpec equivalence suite - #157
Merged
Merged
Conversation
Add standalone machine-checked equivalence suite under proofs/Fl4SpecEquivA64/ proving single-step equivalence, conditional on CallKernelSafe, between Fl4SpecA64 (losfair/FL4@ed6b92799) and upstream Isabelle/HOL seL4/l4v AArch64 MCS ASpec (f44de69e426184f5edff14aeb8d8e03385f33c01): - proofs/Fl4SpecEquivA64/L4vRefA64/** (92 Lean 4 files, 36,447 lines, 1,308 public theorems, 0 errors, 0 warnings, 0 sorry): - 63 frozen emitted Spec + Prim modules mechanically generated from Isabelle ASpec export (verified 0-diff idempotent) - Rel/ + Patched.lean + 24 Equiv/ modules including top-level patched_callKernel_equiv, all 7 blind-validation fix theorems, all 15 explicit divergence (*_delta) theorems, and 11 concrete non-vacuity witnesses in Equiv/Witness.lean (conditional on ConfigRel & OpaqueRel) - Manifest.lean auditing #print axioms across 65 theorems strictly within {propext, Classical.choice, Quot.sound} - proofs/Fl4SpecEquivA64/tools/ (ExportASpec.ML, emit_l4v_ref.py, build.py): build.py enforces 0 warnings on non-frozen modules and audits all >=65 Manifest #print axioms entries (rejecting sorryAx / custom axioms) - proofs/Fl4SpecEquivA64/{README.md,REPORT.md} - proofs/Fl4SpecA64/PORTING.md: document init_kheap high-IRQ CNode difference (512 BitVec 9 vs 8,192 BitVec 13; 7,680 extra empty CNodes at 512 <= irq < 8192) Not imported from Fl4Proofs.lean or Fl4ProofsA64.lean; zero impact on existing P0-P3 builds or CI.
CommaBot
added a commit
to CommaBot/FL4
that referenced
this pull request
Dec 6, 2026
…into par/a64-p6-int Merged against the base 6c92d26 (main's Stage-5 squash has the same tree), so only the Fl4SpecEquiv additions and the two PORTING.md edits come in. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a standalone, machine-checked Lean 4 equivalence suite under
proofs/Fl4SpecEquivA64/proving single-step equivalence (conditional onCallKernelSafe) between FL4's AArch64 MCS abstract specification (proofs/Fl4SpecA64/, frozen atlosfair/FL4@ed6b92799) and upstream Isabelle/HOLseL4/l4vAArch64 MCSASpec(seL4/l4v@f44de69e426184f5edff14aeb8d8e03385f33c01,seL4@c98d70ad), plus a concisePORTING.mdnote documenting theinit_kheaphigh-IRQ CNode difference.Zero changes to
proofs/Fl4SpecA64/*.lean,proofs/Fl4Proofs.lean,proofs/Fl4ProofsA64.lean,crates/, orxtask/. Not imported byFl4Proofs.leanorFl4ProofsA64.lean, so existing P0–P3 builds and CI are completely unaffected.What is included (
98files,+38,884)proofs/Fl4SpecEquivA64/L4vRefA64/**(92Lean 4 files,36,446lines,1,308public theorems,0 errors,0 warnings,0 sorry):Prim.lean+Spec/*.lean+Spec.lean(63frozen modules): read-only Isabelle/HOLASpecreference mechanically emitted bytools/emit_l4v_ref.pyfrom Isabelle2025-2 kernel exportaspec-full.jsonl(SHA-2565b45f4611d1987a6a6f5257530805dc1f3cbbe8efd02d8e1aedbb7b16a245665, verified 0-diff idempotent).Rel/(3modules) +Patched.lean(1module): explicit state/monad/embedding relations and minimal divergence overlay isolating only the 6 documentedPORTING.mdbehavioral deltas.Equiv/*.lean(24modules): full-stack equivalence fromMachine/Types/StructuresthroughKHeap,CSpace,VCPU,VSpace,Arch,Retype,SchedContext,Schedule,Tcb,Ipc,Interrupt,Decode,Init, andSyscall(patched_callKernel_equiv), plus:L4vRefA64.Spec(confirming all 7do-block early-returnreturn ()bugs caught on82371d59are fixed oned6b92799:disableVirtTimer,vcpuDisable,vcpuInvalidateActive,associateVcpuTcb,prepareThreadDelete,performPgInvUnmap,performPtInvUnmap);*_deltadivergence theorems directly against unmodifiedL4vRefA64.Speccovering all 6 documentedPORTING.mddeltas (ntfnBits5 vs 6,lookup_ipc_bufferslot 4 vs 2,make_arch_fault_msg+1label offset,tcb_cnode_map5 vs 7 slots,end_timeslice.RunningVM,user_vtop2^44-1vs2^47-1/decodeVsInvFlush) plus the 1 Bucket A finding (init_kheap512BitVec 9vs8,192BitVec 13IRQ CNodes,7,680extra empty CNodes at512 ≤ irq < 8192);Equiv/Witness.lean(11mechanized non-vacuity witness theorems): directly instantiatingpatched_callKernel_equivon both.SyscallEvent .SysYieldand.Interrupt, plusschedule_equiv,performPgInvUnmap_equiv_direct,performPtInvUnmap_equiv_direct,invokeTcb,invokeIrqControl,invokeIrqHandler(SetIRQHandler),archPerformInvocation(MakePool+PageUnmap), anddoReplyTransfer(conditional only onConfigRel— consistent withopaque kernelConfiginFl4SpecA64/Machine.lean:198— andOpaqueRel RestRel).Manifest.lean:#print axiomsaudit across 65 top-level, blind-validation, delta, subsystem, and non-vacuity witness theorems.proofs/Fl4SpecEquivA64/tools/(3files):ExportASpec.ML(Isabelle2025-2 typed HOL kernel exporter),emit_l4v_ref.py(deterministic Lean 4 emitter), andbuild.py(parallel incremental builder + enforced zero-warning and≥65standard-axiom gate).proofs/Fl4SpecEquivA64/{README.md,REPORT.md}: reproduction guide, TCB disclosure (ExportASpec.ML,emit_l4v_ref.py,Prim.lean), and complete audit report.proofs/Fl4SpecA64/PORTING.md(+17): documents theinit_kheaphigh-IRQ CNode difference and links toproofs/Fl4SpecEquivA64/REPORT.md.Verification
tools/build.pyonafkprover, Lean 4.36):92/92modules green,0 errors,WARNINGS=0,AXIOM_AUDIT PASS: 65/65 theorems strictly standard(⊆ {propext, Classical.choice, Quot.sound};63standard,2zero-axiom;0sorryAx,0custom axioms).sorryAx, custom axioms, compiler warnings, and<65audited theorems are all rejected with non-zero exit code..leanfiles):0sorry,0admit,0bv_decide,0native_decide,0axiom,0unsafe,0implemented_by,0@[extern,0unconstrained state quantifiers in*Safepredicates.claude-fable-5-2) static review (APPROVE,0P0,0P1).