Skip to content

ABI Layer 3: run is a left monoid action of the input stream (runAppend)#39

Merged
hyperpolymath merged 3 commits into
mainfrom
claude/new-session-znxgm7
Jun 28, 2026
Merged

ABI Layer 3: run is a left monoid action of the input stream (runAppend)#39
hyperpolymath merged 3 commits into
mainfrom
claude/new-session-znxgm7

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Layer 3 (second, deeper invariant): proves run is 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-2 Semantics model). Positive + non-vacuity controls.

Testing

Idris2 0.7.0 --build → exit 0, zero warnings. Adversarial rejection confirmed. build/ removed. No believe_me/postulate/sorry.

🤖 Generated with Claude Code

https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx


Generated by Claude Code

claude and others added 3 commits June 27, 2026 19:36
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
@hyperpolymath hyperpolymath marked this pull request as ready for review June 28, 2026 05:41
@hyperpolymath hyperpolymath merged commit 7d8f846 into main Jun 28, 2026
22 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants