ABI Layer 3: run is a left monoid action of the input stream (runAppend)#39
Merged
Conversation
Add Lustreiser.ABI.Semantics, raising the Idris2 ABI to Layer 2 with a machine-checked flagship proof of the repo headline (formally verified real-time embedded code via Lustre). Faithful model: a synchronous saturating bounded-counter Lustre node with Tick/Reset inputs, a static cap, and one-tick state memory; step/run give the synchronous execution semantics. Properties proven (no believe_me/postulate/assert): - Invariant preservation per tick: WithinBound c -> WithinBound (step i c) for every input, lifted to whole runs via runPreservesBound (no overflow). - Determinism (synchronous hypothesis): equal input streams from equal state yield equal output streams. - Sound+complete Dec (decWithinBound) + sound certifier (certifyBoundSound). - Positive controls (explicit witnesses, incl. a run that saturates) and a machine-checked negative control (overflowNotWithinBound) ensuring non-vacuity; a deliberately false witness is rejected by idris2. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
…tInc monotonicity Adds Lustreiser.ABI.Invariants over the existing Semantics model (same Input/CounterNode/satInc/step/run). Proves a deeper, distinct class of property than the Layer-2 bound/cong-determinism: - FLAGSHIP: runAppend — run (xs ++ ys) c = run ys (run xs c), the monoid action / fold-fusion law, by genuine induction on the prefix (not cong). - Corollaries: runConsSplit, runResetClears, runEndingInResetIsZero (transition soundness consumed through runAppend). - ORTHOGONAL: satIncMonotone — order preservation of the saturating successor (m <= n => satInc cap m <= satInc cap n), plus stepTickMonotone. - decEqInput: sound+complete Dec for input equality. - Positive controls (appendWitness, resetSuffixWitness, monotoneWitness) and non-vacuity controls (prefixMatters, inputsDistinct, satIncNotConstant, all Not (...)). No believe_me/postulate/assert/idris_crash. %default total. Clean build, zero warnings; adversarial false-equality check rejected. 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
Layer 3 (second, deeper invariant): proves
runis a left monoid action of the input stream on node state —runAppend : run (xs ++ ys) s = run ys (run xs s)— so streaming composes. Distinct from and deeper than the Layer-2 bound invariant.New module
Lustreiser.ABI.Invariants(imports the Layer-2Semanticsmodel). Positive + non-vacuity controls.Testing
Idris2 0.7.0
--build→ exit 0, zero warnings. Adversarial rejection confirmed.build/removed. Nobelieve_me/postulate/sorry.🤖 Generated with Claude Code
https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
Generated by Claude Code