|
| 1 | +<!-- |
| 2 | +SPDX-License-Identifier: PMPL-1.0-or-later |
| 3 | +Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk> |
| 4 | +--> |
| 5 | + |
| 6 | +# src/abi — Idris2 ABI Layer |
| 7 | + |
| 8 | +This directory contains the Idris2 formal proofs for both roles of `typed-wasm` |
| 9 | +(see ADR-004 in `.machine_readable/6a2/META.a2ml`). |
| 10 | + |
| 11 | +## Directory Layout |
| 12 | + |
| 13 | +``` |
| 14 | +src/abi/ |
| 15 | +├── TypedWasm/ABI/ ← Role 1: TypeLL type safety for WasmGC linear memory |
| 16 | +│ ├── Levels.idr Type safety level hierarchy (L1-L10 initial mapping) |
| 17 | +│ ├── Region.idr Region schema proofs |
| 18 | +│ ├── TypedAccess.idr Type-safe access operation proofs |
| 19 | +│ ├── Pointer.idr Pointer safety proofs |
| 20 | +│ ├── MultiModule.idr Multi-module shared memory proofs |
| 21 | +│ ├── Effects.idr Effect tracking proofs |
| 22 | +│ ├── Lifetime.idr Lifetime safety (no use-after-free) |
| 23 | +│ ├── Linear.idr Linearity proofs (QTT) |
| 24 | +│ ├── Tropical.idr Tropical type extensions (L11+ research) |
| 25 | +│ ├── Epistemic.idr Epistemic type extensions (L12+ research) |
| 26 | +│ └── Proofs.idr Top-level proof bundle |
| 27 | +│ |
| 28 | +├── layout/ ← Role 2: Cross-language layout contracts (aggregate library) |
| 29 | +│ ├── Types.idr Agreed WasmGC type layouts (Option, Result, String, ...) |
| 30 | +│ └── ABI.idr Cross-language calling conventions |
| 31 | +│ |
| 32 | +└── typed-wasm.ipkg Idris2 package file (covers TypedWasm/ABI/ only) |
| 33 | +``` |
| 34 | + |
| 35 | +## Role Separation |
| 36 | + |
| 37 | +**`TypedWasm/ABI/`** is the primary role: the TypeLL progressive type safety proofs |
| 38 | +for WasmGC linear memory. These proofs are part of the default checked package |
| 39 | +(`typed-wasm.ipkg`). No `believe_me` is permitted here. |
| 40 | + |
| 41 | +**`layout/`** is the secondary role: formally verified type layout and ABI |
| 42 | +conventions for languages that compile to typed WasmGC (AffineScript, Ephapax). |
| 43 | +These proofs are developed separately from the TypeLL level hierarchy because |
| 44 | +the two concerns — WASM memory safety and cross-language interop — are |
| 45 | +independent. They share the same Idris2 tooling but are not logically coupled. |
| 46 | + |
| 47 | +## Pipeline Position |
| 48 | + |
| 49 | +``` |
| 50 | +katagoria → typell → typed-wasm → PanLL |
| 51 | + ↑ |
| 52 | + both subtrees live here |
| 53 | +``` |
| 54 | + |
| 55 | +Type theory ideas originate in `katagoria` (research), are promoted to `typell` |
| 56 | +(the open-ended progressive verification kernel), and applied here: |
| 57 | +- `TypedWasm/ABI/` applies TypeLL to WASM memory safety |
| 58 | +- `layout/` applies Idris2 ABI methodology to cross-language binary conventions |
0 commit comments