ABI Layer 2: prove inductive-invariant safety soundness — flagship Idris2 proof#38
Merged
Merged
Conversation
…emantics Add a flagship machine-checked semantic proof raising the Tlaiser Idris2 ABI to Layer 2. Models a two-process lock-based mutual-exclusion state machine (the canonical PlusCal example) with an Init predicate, a nondeterministic Step relation, and an inductive Reachable closure. Headline theorem (safetySound): mutual exclusion (Safe) holds on every reachable state. The engine is invInductive (TLA+ INV1): a strengthened, genuinely inductive invariant Inv that couples "process is Critical" to "process holds the lock" holds initially (initEstablishes) and is preserved by every transition (stepPreserves), hence holds on all reachable states; Safe is derived from Inv (invImpliesSafe). Includes a sound+complete Dec (decSafe), a Result-valued certifier with soundness (certifyReachableSound), a positive control (a real reachable Critical state, proven Safe) and negative controls (the (Critical,Critical) state has no Safe proof and is unreachable). The "both critical" bad case has no constructor, so a deliberately false safety witness is rejected by idris2 (non-vacuity verified). Builds clean (idris2 0.7.0, zero warnings). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
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
Raises tlaiser's Idris2 ABI to Layer 2 with its first flagship semantic proof. tlaiser's headline is extracting state machines and model-checking with TLA+; this proves the foundational model-checking guarantee — inductive-invariant soundness: a safety property that holds initially and is preserved by every transition holds on every reachable state (
safetySound).Mirrors the estate flagship-proof pattern:
Init/Step/Reachable/Safemodel, the inductive-invariant theorem, certifier, controls.Changes
src/interface/abi/Tlaiser/ABI/Semantics.idr— state-machine model,Reachable,Safe,safetySound(reachable ⇒ safe), certifier + soundness, controls.tlaiser-abi.ipkg.RSR Quality Checklist
Required
As Applicable
Testing
Verified with Idris2 0.7.0:
idris2 --build tlaiser-abi.ipkg→ exit 0, zero warnings. Adversarial check: a deliberately-false proof was rejected.build/removed.🤖 Generated with Claude Code
https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
Generated by Claude Code