Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/agda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ jobs:
path: |
${{ runner.temp }}/echo-agda/**/*.agdai
proofs/agda/**/*.agdai
key: agdai-${{ runner.os }}-2.7.0.1-stdlib8326c747-abszf486c299-${{ hashFiles('proofs/agda/**/*.agda') }}
key: agdai-${{ runner.os }}-2.7.0.1-stdlib8326c747-absz8a3162a2-${{ hashFiles('proofs/agda/**/*.agda') }}
restore-keys: |
agdai-${{ runner.os }}-2.7.0.1-stdlib8326c747-abszf486c299-
agdai-${{ runner.os }}-2.7.0.1-stdlib8326c747-absz8a3162a2-
- name: Typecheck shipped closure and headlines
run: |
agda --no-libraries -i "$AGDA_STDLIB" -i "$ABSOLUTE_ZERO_AGDA" --safe --without-K --cubical-compatible -i proofs/agda proofs/agda/All.agda
Expand Down
21 changes: 21 additions & 0 deletions PROOF-STATUS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,27 @@ include some definitions as well as theorems): `PWG-1` 0, `PWG-2ii` 5,
per-theorem record exists for it yet.
Agda results for the whole closure are dated checks, not grades.

== Agda cold check (2026-11-16): absolute-zero repin

absolute-zero is repinned from `f486c29` to
`8a3162a24c8524735b464bedb9747517dc8b0467`, the merge of absolute-zero#199,
which replaces the total evaluator with a pc-driven machine. `EchoCNOBridge`,
`EchoCNOSemantics` and `EchoCNOPackaging` are restated over it (see
link:docs/bridges/ECHO-CNO-BRIDGE.adoc[the bridge boundary]).

With the CI toolchain from `scripts/setup-agda.sh` (Agda 2.7.0.1, the same
release-archive sha256 as below; stdlib `8326c74`; absolute-zero `8a3162a`),
these all exited 0 on proof sources identical to commit
`4915be64bd7aeab3febd3a79b070255bbf2d4da5`:

* the five static guards;
* the seven `--safe --without-K --cubical-compatible` roots, cold
(`--ignore-interfaces`), as listed below;
* the `--safe --cubical` island.

No log was archived for this run. It is a local run, not a GitHub Actions
receipt.

== Agda cold check (2026-11-09)

At source commit `ccec4d79866e3e433ae2268d2f8b7899396cb34f`, with a clean
Expand Down
11 changes: 10 additions & 1 deletion docs/bridges/ECHO-CNO-BRIDGE.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ The earlier proposed definition `UniversalCNO p = ∀ s → Echo p s ≃ Echo id

At baseline `cd85288dcce55191ad477c0fa7d1d2421514a0d3`, `EchoCNOBridge.agda` imports native `CNO.Program` and `CNO.IsCNO`, but its map is the constant `Program → ⊤`. Its `ProgramEcho _` ignores its program index, and `cno-program-echo p _` ignores the certificate. Every program has this echo witness. Passing native certificates through composition does not by itself connect Echo to execution or state preservation.

A semantic replacement must use the native execution semantics and the `CNO.state-eq` evidence. Merely importing a certificate type does not establish that bridge. The local audit adds `EchoCNOSemantics` and `EchoSourcePreserving`, using same-program certificates, native `CNO.state-eq`, and source-preserving fibre comparisons. Their local Agda 2.7.0.1 checks passed, along with the ordinary CI roots. `CertifiedProgramEcho` binds the provenance witness and certificate to the same program. `NativeNull` and `IsCNO` imply each other within the pinned dependency’s total, zero-energy model; the Nop negative control changes the program counter. `SourcePreservingStateMap` characterizes native nullness through a source-preserving map of relation-valued fibres using `state-eq`. Its record does not assert the two inverse laws of the ordinary `FibreIso` interface. This is a scoped semantic bridge, not a theorem about all operational models.
A semantic replacement must use the native execution semantics and native state evidence. Merely importing a certificate type does not establish that bridge. `EchoCNOSemantics` and `EchoSourcePreserving` use same-program certificates and source-preserving fibre comparisons. `CertifiedProgramEcho` binds the provenance witness and certificate to the same program.

Since the absolute-zero repin to `8a3162a` (2026-11-16), the pinned model is a pc-driven machine: a big-step run relation `p ⊢ s ⇓ s'` from pc 0, and `obs-eq` over memory, registers and I/O (not the program counter). Programs can loop or fault, so the bridge separates identity from termination:

* `NativeNull p`: every start state runs to an observably equal state. It is equivalent to `IsCNO p` (`native-null-iff-cno`) and to partial nullness plus termination (`native-null-iff-partial-terminating`).
* `PartialNull p`: every run that stops ends in an observably equal state. `SourcePreservingStateMap` characterises this, not `NativeNull` (`partial-null-iff-source-map`). The self-jump `loop` has a source-preserving map but is not natively null (`loop-source-map`, `loop-not-native-null`).
* Composition (`certified-compose`, `native-null-compose`, `cno-compose-echo`) needs the first program to be closed, as absolute-zero's `cno-composition` does. Composition of partial nullness alone is not provided, and the former `source-map-compose` is removed.
* `Nop` is now a certified CNO (`nop-certified`), because only the program counter changes. The negative control is a `Load` that changes a register (`load-not-certified`).

The record does not assert the two inverse laws of the ordinary `FibreIso` interface. This is a scoped semantic bridge, not a theorem about all operational models.

== Thermodynamic model

Expand Down
7 changes: 4 additions & 3 deletions docs/echo-types/MAP.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,10 @@ PR workflow results are tracked in link:../audit/2026-11-06-repository-readiness
fibre results using pointwise equality, including the source-preserving
identity criterion and dependent pushforward/reindexing adjunction data.
Composition is a natural isomorphism; full base-indexed coherence is not claimed.
* `EchoCNOSemantics`: derived bridge through `EchoCNOBridge` and pinned native
`CNO.state-eq`. Its source-preserving relation-fibre map criterion and
same-program certification are scoped to the external total zero-energy model.
* `EchoCNOSemantics`: derived bridge through `EchoCNOBridge` and absolute-zero's
pinned pc-driven machine, using `CNO.obs-eq` (memory, registers, I/O).
Total nullness (`NativeNull`) is equivalent to `IsCNO`; the source-preserving
relation-fibre map characterises partial nullness only (`loop-source-map`).
* `EchoGradedComonadNaturality` and `EchoErasingGradedComonad`: strengthened
companion obligations plus a concrete natural-grade erasing model. Grade UIP
is explicit in the interface and discharged for Nat in the model; no global
Expand Down
7 changes: 4 additions & 3 deletions docs/echo-types/echo-kernel-note.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,10 @@ kernel** — the boundary is real and lives outside this core.
| `EchoCNOSemantics`
| Imports `Echo`, `EchoCNOBridge`, stdlib, and the pinned external `CNO` module.
Same-program certification and the source-preserving relation-fibre map
criterion use native `state-eq`, not propositional equality of function-valued
states. The identity/IsCNO characterization is scoped to that total,
zero-energy model; it is not a physical theorem or a FibreIso inverse-law claim.
criterion use native `obs-eq`, not propositional equality of function-valued
states. `NativeNull` (every start state runs to an observably equal state) is
equivalent to `IsCNO` in that model; the source-preserving map characterises
partial nullness only. It is not a physical theorem or a FibreIso inverse-law claim.

| *Derived — graded interface and model (2026-11-06)*
| `EchoGradedComonadNaturality`, `EchoErasingGradedComonad`
Expand Down
20 changes: 12 additions & 8 deletions proofs/agda/EchoCNOBridge.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --safe --without-K #-}
{-# OPTIONS --safe --without-K --cubical-compatible --exact-split --no-sized-types --no-guardedness #-}
-- SPDX-License-Identifier: MPL-2.0
-- SPDX-FileCopyrightText: 2025-2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>

Expand All @@ -9,9 +9,10 @@
-- identity correspondence. Names are retained for compatibility.
--
-- EchoCNOSemantics adds CertifiedProgramEcho (same-program equality plus
-- IsCNO certificate) and a semantic bridge using CNO.state-eq. The pinned
-- external evaluator is total and its energy function is constant zero;
-- these model definitions are not independent physical guarantees.
-- IsCNO certificate) and a semantic bridge over the pinned pc-driven
-- machine, using CNO.obs-eq (memory, registers and I/O; not the program
-- counter). The pinned model has no energy function; nothing here is a
-- physical guarantee.
module EchoCNOBridge where

open import Echo
Expand All @@ -21,6 +22,7 @@ open import CNO using
; Instruction
; Halt
; IsCNO
; Closed
; empty-is-cno
; halt-is-cno
; cno-composition
Expand Down Expand Up @@ -72,10 +74,12 @@ absolute-zero-echo =

----------------------------------------------------------------------
-- This legacy construction accepts external composition evidence, then
-- discards it when constructing the provenance witness.
-- discards it when constructing the provenance witness. The pinned
-- composition theorem needs the first program to be closed (its jumps
-- stay inside it); CNO.closedness-needed shows why.

cno-compose-echo :
∀ {p₁ p₂} → IsCNO p₁ → IsCNO p₂ →
∀ {p₁ p₂} → Closed p₁ → IsCNO p₁ → IsCNO p₂ →
ProgramEcho (seq-comp p₁ p₂)
cno-compose-echo {p₁} {p₂} c₁ c₂ =
cno-program-echo (seq-comp p₁ p₂) (cno-composition c₁ c₂)
cno-compose-echo {p₁} {p₂} cl c₁ c₂ =
cno-program-echo (seq-comp p₁ p₂) (cno-composition {p₁} {p₂} cl c₁ c₂)
54 changes: 30 additions & 24 deletions proofs/agda/EchoCNOPackaging.agda
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{-# OPTIONS --safe --without-K --cubical-compatible #-}
{-# OPTIONS --safe --without-K --cubical-compatible --exact-split --no-sized-types --no-guardedness #-}
-- SPDX-License-Identifier: MPL-2.0
-- SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>

module EchoCNOPackaging where

open import CNO using (Program; IsCNO; seq-comp)
open import Data.Product.Base using (_×_; _,_; proj₁; proj₂)
open import CNO using (Program; IsCNO; Terminates; seq-comp; Closed)
open import EchoCNOSemantics using
( NativeNull; CertifiedProgramEcho; SourcePreservingStateMap
( NativeNull; PartialNull; CertifiedProgramEcho; SourcePreservingStateMap
; native-null-to-cno; certify-program-echo; certified-echo-native-null
; native-null-source-map; source-map-native-null; certified-compose )
; native-null-partial; native-null-terminates; partial-terminating-native-null
; partial-null-source-map; source-map-partial-null; certified-compose )

-- Logical equivalence means implications in both directions. In particular,
-- it does not identify certificate records or relation-witness spaces.
Expand All @@ -17,12 +19,10 @@ record LogicalEquivalence (P Q : Set) : Set where
to : P → Q
from : Q → P

-- The converse uses the pinned native model: evaluation is total and the
-- energy function is zero, as documented by native-null-to-cno.
native-null-iff-cno : ∀ {p} → LogicalEquivalence (NativeNull p) (IsCNO p)
native-null-iff-cno = record
native-null-iff-cno {p} = record
{ to = native-null-to-cno
; from = IsCNO.cno-identity
; from = λ c → certified-echo-native-null (certify-program-echo p c)
}

native-null-iff-certified : ∀ {p} →
Expand All @@ -32,24 +32,30 @@ native-null-iff-certified {p} = record
; from = certified-echo-native-null
}

native-null-iff-source-map : ∀ {p} →
LogicalEquivalence (NativeNull p) (SourcePreservingStateMap p)
native-null-iff-source-map = record
{ to = native-null-source-map
; from = source-map-native-null
-- Total nullness splits into partial nullness and termination.
native-null-iff-partial-terminating : ∀ {p} →
LogicalEquivalence (NativeNull p) (PartialNull p × (∀ s → Terminates p s))
native-null-iff-partial-terminating {p} = record
{ to = λ h → (λ {s} {s'} → native-null-partial {p} h {s} {s'}) , native-null-terminates {p} h
; from = λ pt → partial-terminating-native-null {p} (λ {s} {s'} → proj₁ pt {s} {s'}) (proj₂ pt)
}

-- Both input certificates retain their program indices. Composition uses
-- the existing native certificate API, without equating its proof fields.
native-null-compose : ∀ {p q : Program} → NativeNull p → NativeNull q →
-- A source-preserving fibre map characterises partial nullness, not
-- total nullness (EchoCNOSemantics.loop-source-map).
partial-null-iff-source-map : ∀ {p} →
LogicalEquivalence (PartialNull p) (SourcePreservingStateMap p)
partial-null-iff-source-map {p} = record
{ to = partial-null-source-map {p}
; from = source-map-partial-null
}

-- Composition uses the native certificate API, which needs the first
-- program to be closed. Composing partial nullness alone is not
-- provided: it would need to split a run of the composite at the seam,
-- and the pinned model exports no such lemma.
native-null-compose : ∀ {p q : Program} → Closed p → NativeNull p → NativeNull q →
NativeNull (seq-comp p q)
native-null-compose {p} {q} h k = certified-echo-native-null
(certified-compose {p} {q}
native-null-compose {p} {q} cl h k = certified-echo-native-null
(certified-compose {p} {q} cl
(LogicalEquivalence.to (native-null-iff-certified {p}) h)
(LogicalEquivalence.to (native-null-iff-certified {q}) k))

source-map-compose : ∀ {p q : Program} →
SourcePreservingStateMap p → SourcePreservingStateMap q →
SourcePreservingStateMap (seq-comp p q)
source-map-compose {p} {q} m n = native-null-source-map {seq-comp p q}
(native-null-compose {p} {q} (source-map-native-null m) (source-map-native-null n))
Loading
Loading