diff --git a/.github/workflows/agda.yml b/.github/workflows/agda.yml index aba43b6..175fa14 100644 --- a/.github/workflows/agda.yml +++ b/.github/workflows/agda.yml @@ -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 diff --git a/PROOF-STATUS.adoc b/PROOF-STATUS.adoc index edfb85d..b7f5a26 100644 --- a/PROOF-STATUS.adoc +++ b/PROOF-STATUS.adoc @@ -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 diff --git a/docs/bridges/ECHO-CNO-BRIDGE.adoc b/docs/bridges/ECHO-CNO-BRIDGE.adoc index 01cff87..c500657 100644 --- a/docs/bridges/ECHO-CNO-BRIDGE.adoc +++ b/docs/bridges/ECHO-CNO-BRIDGE.adoc @@ -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 diff --git a/docs/echo-types/MAP.adoc b/docs/echo-types/MAP.adoc index 3f80a52..08da80f 100644 --- a/docs/echo-types/MAP.adoc +++ b/docs/echo-types/MAP.adoc @@ -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 diff --git a/docs/echo-types/echo-kernel-note.adoc b/docs/echo-types/echo-kernel-note.adoc index 6e1631d..868ec34 100644 --- a/docs/echo-types/echo-kernel-note.adoc +++ b/docs/echo-types/echo-kernel-note.adoc @@ -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` diff --git a/proofs/agda/EchoCNOBridge.agda b/proofs/agda/EchoCNOBridge.agda index 0e06346..d8ed9b8 100644 --- a/proofs/agda/EchoCNOBridge.agda +++ b/proofs/agda/EchoCNOBridge.agda @@ -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 @@ -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 @@ -21,6 +22,7 @@ open import CNO using ; Instruction ; Halt ; IsCNO + ; Closed ; empty-is-cno ; halt-is-cno ; cno-composition @@ -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₂) diff --git a/proofs/agda/EchoCNOPackaging.agda b/proofs/agda/EchoCNOPackaging.agda index e85047d..6b24d2b 100644 --- a/proofs/agda/EchoCNOPackaging.agda +++ b/proofs/agda/EchoCNOPackaging.agda @@ -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 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. @@ -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} → @@ -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)) diff --git a/proofs/agda/EchoCNOSemantics.agda b/proofs/agda/EchoCNOSemantics.agda index 7ac50f4..b55239c 100644 --- a/proofs/agda/EchoCNOSemantics.agda +++ b/proofs/agda/EchoCNOSemantics.agda @@ -1,18 +1,28 @@ -{-# 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: 2026 Jonathan D.A. Jewell +-- A semantic bridge to absolute-zero's pinned CNO model: a pc-driven +-- machine with a big-step run relation `p ⊢ s ⇓ s'`, started at pc 0 by +-- `start`, and observational equality `obs-eq` (memory, registers, I/O; +-- not the program counter). Programs can loop or fault, so termination +-- is a real property here, and the bridge separates it from identity. module EchoCNOSemantics where open import Data.Product.Base using (Σ; _×_; _,_; proj₁; proj₂) open import Data.List.Base using ([]; _∷_) -open import Data.Empty using (⊥) -open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym; trans; subst) +open import Data.Empty using (⊥; ⊥-elim) +open import Relation.Nullary using (¬_) +open import Relation.Binary.PropositionalEquality using (_≡_; refl; subst) open import Echo using (echo-intro) open import EchoCNOBridge using (ProgramEcho; program-to-unit) open import CNO using - ( Program; ProgramState; mk-state; empty-memory; IsCNO; eval; state-eq - ; terminates-always; Nop; Halt; empty-is-cno; halt-is-cno; seq-comp; cno-composition ) + ( Program; ProgramState; mk-state; empty-memory; IsCNO; _⊢_⇓_; start; obs-eq + ; obs-eq-refl; obs-eq-sym; obs-eq-trans; Terminates + ; cno-from-runs; cno-result; cno-result-run; cno-preserves-state + ; Nop; Halt; seq-comp; Closed; cno-composition + ; empty-is-cno; halt-is-cno; nop-is-cno + ; loop; jump-self-diverges; load-prog; load-not-cno ) -- Unlike the legacy ProgramEcho alias, this record ties the stored witness -- and certificate to precisely the program in the index. @@ -29,66 +39,98 @@ certify-program-echo p c = record ; certificate = c } +---------------------------------------------------------------------- +-- Native nullness, total and partial. + +-- Total: from every state, the run stops at an observationally equal +-- state. This is exactly what CNO.cno-from-runs consumes. NativeNull : Program → Set -NativeNull p = ∀ s → state-eq (eval p s) s +NativeNull p = ∀ s → Σ ProgramState (λ s' → p ⊢ start s ⇓ s' × obs-eq s' s) + +-- Partial: every run that does stop, stops at an observationally equal +-- state. This is IsCNO's identity field on its own. +PartialNull : Program → Set +PartialNull p = ∀ {s s'} → p ⊢ start s ⇓ s' → obs-eq s' s certified-echo-native-null : ∀ {p} → CertifiedProgramEcho p → NativeNull p -certified-echo-native-null e = IsCNO.cno-identity (CertifiedProgramEcho.certificate e) +certified-echo-native-null e s = + cno-result c s , cno-result-run c s , cno-preserves-state c s + where c = CertifiedProgramEcho.certificate e -state-refl : ∀ s → state-eq s s -state-refl s = (λ addr → refl) , refl , refl , refl +native-null-to-cno : ∀ {p} → NativeNull p → IsCNO p +native-null-to-cno = cno-from-runs -state-sym : ∀ {s t} → state-eq s t → state-eq t s -state-sym (m , r , i , p) = (λ addr → sym (m addr)) , sym r , sym i , sym p +native-null-partial : ∀ {p} → NativeNull p → PartialNull p +native-null-partial {p} h {s} {s'} = IsCNO.cno-identity (native-null-to-cno {p} h) {s} {s'} -state-trans : ∀ {s t u} → state-eq s t → state-eq t u → state-eq s u -state-trans (m , r , i , p) (n , q , j , z) = - (λ addr → trans (m addr) (n addr)) , trans r q , trans i j , trans p z +native-null-terminates : ∀ {p} → NativeNull p → ∀ s → Terminates p s +native-null-terminates h s = proj₁ (h s) , proj₁ (proj₂ (h s)) --- At this pinned external model, all other IsCNO fields follow from --- native state identity: evaluation is total and its energy function is zero. --- This is a statement about that model, not physical thermodynamics. -native-null-to-cno : ∀ {p} → NativeNull p → IsCNO p -native-null-to-cno {p} h = record - { cno-terminates = terminates-always p - ; cno-identity = h - ; cno-pure = λ s → sym (proj₁ (proj₂ (proj₂ (h s)))) , - (λ addr → sym (proj₁ (h s) addr)) - ; cno-reversible = λ s → refl - } +partial-terminating-native-null : ∀ {p} → PartialNull p → (∀ s → Terminates p s) → + NativeNull p +partial-terminating-native-null pn t s = proj₁ (t s) , proj₂ (t s) , pn {s} (proj₂ (t s)) + +---------------------------------------------------------------------- +-- Relation-valued fibres. They use obs-eq, not propositional equality +-- between states (whose memories are functions). --- Relation-valued fibres use CNO's native state-eq. They do not assert --- propositional equality between states (whose memories are functions). StateEcho : Program → ProgramState → Set -StateEcho p target = Σ ProgramState (λ source → state-eq (eval p source) target) +StateEcho p target = + Σ ProgramState (λ source → + Σ ProgramState (λ s' → p ⊢ start source ⇓ s' × obs-eq s' target)) IdentityStateEcho : ProgramState → Set -IdentityStateEcho target = Σ ProgramState (λ source → state-eq source target) +IdentityStateEcho target = Σ ProgramState (λ source → obs-eq source target) -native-null-to-fibre-map : ∀ {p} → NativeNull p → +partial-null-to-fibre-map : ∀ {p} → PartialNull p → ∀ {target} → StateEcho p target → IdentityStateEcho target -native-null-to-fibre-map h (s , e) = s , state-trans (state-sym (h s)) e +partial-null-to-fibre-map h {target} (s , s' , d , e) = + s , obs-eq-trans {s} {s'} {target} (obs-eq-sym {s'} {s} (h {s} {s'} d)) e +-- The reverse map needs a run to exist, so it needs total nullness. native-null-from-fibre-map : ∀ {p} → NativeNull p → ∀ {target} → IdentityStateEcho target → StateEcho p target -native-null-from-fibre-map h (s , e) = s , state-trans (h s) e +native-null-from-fibre-map h {target} (s , e) = + s , proj₁ (h s) , proj₁ (proj₂ (h s)) , + obs-eq-trans {proj₁ (h s)} {s} {target} (proj₂ (proj₂ (h s))) e record SourcePreservingStateMap (p : Program) : Set where field map : ∀ {target} → StateEcho p target → IdentityStateEcho target - source-preserved : ∀ {target} (e : StateEcho p target) → proj₁ (map e) ≡ proj₁ e + source-preserved : ∀ {target} (e : StateEcho p target) → proj₁ (map {target} e) ≡ proj₁ e -native-null-source-map : ∀ {p} → NativeNull p → SourcePreservingStateMap p -native-null-source-map {p} h = record - { map = native-null-to-fibre-map {p} h - ; source-preserved = λ e → refl +partial-null-source-map : ∀ {p} → PartialNull p → SourcePreservingStateMap p +partial-null-source-map {p} h = record + { map = λ {target} → partial-null-to-fibre-map {p} (λ {s} {s'} → h {s} {s'}) {target} + ; source-preserved = λ {target} e → refl } -source-map-native-null : ∀ {p} → SourcePreservingStateMap p → NativeNull p -source-map-native-null {p} m s = state-sym - (subst (λ x → state-eq x (eval p s)) - (SourcePreservingStateMap.source-preserved m (s , state-refl (eval p s))) - (proj₂ (SourcePreservingStateMap.map m (s , state-refl (eval p s))))) +source-map-partial-null : ∀ {p} → SourcePreservingStateMap p → PartialNull p +source-map-partial-null {p} m {s} {s'} d = obs-eq-sym {s} {s'} + (subst (λ x → obs-eq x s') + (SourcePreservingStateMap.source-preserved m {s'} e) + (proj₂ (SourcePreservingStateMap.map m {s'} e))) + where + e : StateEcho p s' + e = s , s' , d , obs-eq-refl s' + +native-null-source-map : ∀ {p} → NativeNull p → SourcePreservingStateMap p +native-null-source-map {p} h = + partial-null-source-map {p} (λ {s} {s'} → native-null-partial {p} h {s} {s'}) + +-- A source-preserving map characterises partial nullness only: the +-- self-jump never stops, so its fibres are empty and it has such a map, +-- yet it is not natively null. +loop-source-map : SourcePreservingStateMap loop +loop-source-map = partial-null-source-map {loop} + (λ {s} {s'} d → ⊥-elim (jump-self-diverges s (s' , d))) + +loop-not-native-null : ¬ NativeNull loop +loop-not-native-null h = jump-self-diverges s₀ (native-null-terminates {loop} h s₀) + where s₀ = mk-state empty-memory [] [] 0 + +---------------------------------------------------------------------- +-- Certified echoes. certified-state-echo : ∀ {p} → CertifiedProgramEcho p → ∀ s → StateEcho p s certified-state-echo e s = s , certified-echo-native-null e s @@ -97,10 +139,12 @@ certified-state-echo-source : ∀ {p} (e : CertifiedProgramEcho p) s → proj₁ (certified-state-echo e s) ≡ s certified-state-echo-source e s = refl -certified-compose : ∀ {p q} → CertifiedProgramEcho p → CertifiedProgramEcho q → +-- Composition needs the first program to be closed (CNO.closedness-needed). +certified-compose : ∀ {p q} → Closed p → CertifiedProgramEcho p → CertifiedProgramEcho q → CertifiedProgramEcho (seq-comp p q) -certified-compose {p} {q} e d = certify-program-echo (seq-comp p q) - (cno-composition (CertifiedProgramEcho.certificate e) (CertifiedProgramEcho.certificate d)) +certified-compose {p} {q} cl e d = certify-program-echo (seq-comp p q) + (cno-composition {p} {q} cl + (CertifiedProgramEcho.certificate e) (CertifiedProgramEcho.certificate d)) empty-certified : CertifiedProgramEcho [] empty-certified = certify-program-echo [] empty-is-cno @@ -108,13 +152,10 @@ empty-certified = certify-program-echo [] empty-is-cno halt-certified : CertifiedProgramEcho (Halt ∷ []) halt-certified = certify-program-echo (Halt ∷ []) halt-is-cno --- A meaningful negative control: this semantics increments PC on Nop. -initial-state : ProgramState -initial-state = mk-state empty-memory [] [] 0 - -nop-not-native-null : NativeNull (Nop ∷ []) → ⊥ -nop-not-native-null h with proj₂ (proj₂ (proj₂ (h initial-state))) -... | () +-- Nop changes only the program counter, which obs-eq ignores. +nop-certified : CertifiedProgramEcho (Nop ∷ []) +nop-certified = certify-program-echo (Nop ∷ []) nop-is-cno -nop-not-certified : CertifiedProgramEcho (Nop ∷ []) → ⊥ -nop-not-certified e = nop-not-native-null (certified-echo-native-null e) +-- Negative control: a Load that changes a register has no certificate. +load-not-certified : CertifiedProgramEcho load-prog → ⊥ +load-not-certified e = load-not-cno (CertifiedProgramEcho.certificate e) diff --git a/proofs/agda/Smoke.agda b/proofs/agda/Smoke.agda index c093ece..b825ebe 100644 --- a/proofs/agda/Smoke.agda +++ b/proofs/agda/Smoke.agda @@ -16,7 +16,8 @@ import EchoSourcePreserving as SourcePreserving using ) import EchoCNOSemantics as CNOSemantics using ( CertifiedProgramEcho; certified-echo-native-null; native-null-to-cno - ; native-null-source-map; source-map-native-null; nop-not-certified + ; native-null-source-map; source-map-partial-null; nop-certified + ; load-not-certified; loop-source-map; loop-not-native-null ) import EchoDependentPushforward as DependentPushforward using ( transpose-untranspose; untranspose-transpose @@ -1392,7 +1393,8 @@ open import EchoSourcePreservingComparison using ; pointwise-fibre-map; source-map-pointwise; pointwise-fibre-iso ) open import EchoCNOPackaging using ( LogicalEquivalence; native-null-iff-cno; native-null-iff-certified - ; native-null-iff-source-map; native-null-compose; source-map-compose ) + ; native-null-iff-partial-terminating; partial-null-iff-source-map + ; native-null-compose ) open import EchoFiniteResidue using ( ExactRecovery; recovery-separates; recovery-forbids-residue-collision ; finite-fibre-bound; constant-recovery; constant-bound; no-one-symbol-for-two ) diff --git a/scripts/setup-agda.sh b/scripts/setup-agda.sh index 82c9859..eb61fc0 100644 --- a/scripts/setup-agda.sh +++ b/scripts/setup-agda.sh @@ -7,7 +7,7 @@ set -euo pipefail AGDA_VERSION=2.7.0.1 AGDA_SHA256=975b515a14877ab6bce5bfc641e16c4a3ee52ca5d7f846577dee80aa2145db8a STDLIB_SHA=8326c7475af1fa456ca04a0203c168d5d7ff842b -ABSZ_SHA=f486c29903434589117fa0662c6f29b0f17d1d5f +ABSZ_SHA=8a3162a24c8524735b464bedb9747517dc8b0467 test "$(uname -s)-$(uname -m)" = Linux-x86_64 tool_dir="${AGDA_TOOLS_DIR:-${RUNNER_TEMP:?RUNNER_TEMP or AGDA_TOOLS_DIR is required}/echo-agda}"