Commit c6163a3
committed
feat(dijkstra): add UTXO and UTXOW preservation-of-value modules
Introduce three new modules implementing the UTXO-level building blocks
of the Dijkstra-era preservation-of-value proof (towards closing #1123 /
CIP-159-11):
+ `Utxo/Properties/Base.lagda.md`
Era-independent helper lemmas: `∙-homo-Coin`, `newTxid⇒disj`,
`outs-disjoint`. Intentionally minimal for now — the Conway Base
proofs of `balance-cong`, `balance-∪`, and `split-balance` do not
port verbatim because Dijkstra defines `balance` as `∑ˢ` over a set
of Values rather than as `indexedSumᵐ` over a map of hashed TxOuts.
Tracking issue filed for the proper port.
+ `Utxo/Properties/PoV.lagda.md`
The Dijkstra UTXO preservation-of-value proof is split into two
orthogonal pieces:
- Mechanical state change (`UTXO-I-getCoin`, `UTXO-V-mechanical`):
relates `getCoin s₀` to `getCoin s₁` from the UTxOState transition
alone, using `split-balance` and `balance-∪`. Proved.
- Batch coin balance (`batch-balance-coin`): the coin projection of
the `consumedBatch ≡ producedBatch` premise (premise p₇ of the
UTXO rule). Proved from the two module parameters
`coin-of-consumedBatch` and `coin-of-producedBatch`, which are
themselves left as assumptions for now (see PoV follow-up work).
The combined `UTXO-pov` theorem is stated but left as a placeholder
(`?`); its exact form depends on how `LEDGER-pov`'s
`BatchUtxoAccounting` consumer threads sub-transaction state.
+ `Utxow/Properties/PoV.lagda.md`
UTXOW-level wrappers that extract the UTXO derivation from either
`UTXOW-normal` or `UTXOW-legacy` (via a shared `UTXOW⇒UTXO`
extractor) and delegate to the UTXO-level lemmas. Provides
`utxow-pov-invalid` in the exact shape required as a module
parameter by `Ledger/Properties/PoV.lagda.md`.
Proof-internal notes:
+ `balance-∪` and `split-balance` are currently module parameters
to `Utxo/Properties/PoV` pending the port of Conway Base's balance
arithmetic to Dijkstra (see tracking issue).
+ The 7-term +-commutative-monoid shuffle in `UTXO-V-mechanical` is
proved by hand using a `swap-right` helper; this could later be
replaced by a call to a commutative-monoid solver.
+ All three modules typecheck under `--safe`.1 parent cf645b4 commit c6163a3
3 files changed
Lines changed: 719 additions & 0 deletions
File tree
- src/Ledger/Dijkstra/Specification
- Utxow/Properties
- Utxo/Properties
Lines changed: 80 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
0 commit comments