Skip to content

ABI Layer 5: end-to-end soundness capstone certificate#41

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

ABI Layer 5: end-to-end soundness capstone certificate#41
hyperpolymath merged 6 commits into
mainfrom
claude/new-session-znxgm7

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Layer 5 (the capstone, completing the 5-layer proof track): a new *.ABI.Capstone module importing every prior layer and assembling a single inhabited ABISound certificate (abiContractDischarged) from the real exported witnesses of the flagship property (L2 counter-bound invariant), the deeper invariant (L3 monoid action), and the FFI-seam injectivity (L4). One end-to-end soundness statement.

Genuine composition only — reuses real exported names.

Testing

Idris2 0.7.0 --build → exit 0, zero warnings. Adversarial: a bogus-field certificate was rejected. 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 6 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
Add Lustreiser.ABI.FfiSeam proving the FFI result-code encoding is sound:
- resultToIntInjective: distinct Result outcomes never collide on the wire
- intToResult + resultRoundTrip: faithful/lossless decode (injectivity derived)
- positive controls (concrete decodes = Refl) and a non-vacuity negative
  control (distinct codes have distinct ints, machine-checked)

Genuine proof: %default total, no believe_me/postulate/assert_total/idris_crash.
Builds clean (idris2 0.7.0) with zero warnings; false seam claim rejected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
Assemble the existing prior-layer proofs into one inhabited certificate.

ABISound bundles the key proven facts, one field per layer, reusing the
ACTUAL exported witnesses (no reproving, no fabrication):
  - Layer 2 (Semantics): safeWatchdogWithinBound + safeRunWithinBound
    (per-tick / whole-run saturating-counter safety bound)
  - Layer 3 (Invariants): appendWitness (run is a monoid action / fold-fusion)
    + monotoneWitness (satInc monotonicity)
  - Layer 4 (FfiSeam): resultToIntInjective (result-code encoding injective)

abiContractDischarged : ABISound is the single inhabited capstone value: if
any prior layer were unsound it would fail to typecheck. Non-vacuity verified
adversarially — a bogus flagshipBound claiming WithinBound (MkCounter 2 5) is
rejected (no LTE 5 2 witness). Builds with zero warnings under Idris2 0.7.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
@hyperpolymath hyperpolymath marked this pull request as ready for review June 28, 2026 07:24
@hyperpolymath hyperpolymath merged commit b3d0283 into main Jun 28, 2026
6 checks passed
@hyperpolymath hyperpolymath deleted the claude/new-session-znxgm7 branch June 28, 2026 07:24
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