Commit e1539eb
authored
[Dijkstra] CIP-159-11c: Prove LEDGER preservation of value (#1187)
Prove `LEDGER-pov` for the Dijkstra LEDGER rule: getCoin s ≡ getCoin s',
where getCoin (LedgerState) sums UTxO coin, the rewards balance, the three
cert-deposit pots, and the gov-action deposits. Typechecks under --safe
with no postulates or holes.
Top-down plan: the supporting Certs / UTxO / Gov facts are module
parameters of `Ledger.Properties.PoV`, forming the frozen contract for the
follow-up PRs (#1186 utxo/utxow, #1210 certs, and a future Gov PoV).
New modules:
- Ledger/Properties/PoV: LEDGER-pov. The LEDGER-V case is a single
LedgerState-level equational chain; direct-deposit value cancels between
the UTxO and CertState sides, gov-deposit growth is matched against the
produced-side govProposalsDeposits, and `bat'` converts the closed-form
batch balance (#1186 shape) to the chain's two-level posPart/negPart
deposit form via the batch-cert-deposits-bridge (#1210 shape) and
net-arith.
- Entities/Properties/PoV: ENTITIES-pov and SUBENTITIES-pov, the
value-flow equations for the post-#1256 tx-signal rules. NetworkId and
domain facts come from the rules' own premises; the no-truncation bound
(withdrawal amount ≤ input-state balance) is an explicit hypothesis —
the phantom-withdrawal gap flagged in the #1256 review, provided at the
LEDGER level by the ENTITIES/SUBENTITIES-wdrls-bounded parameters.
- Entities/Properties/ApplyToRewardsPoV: applyWithdrawals-pov and
applyDirectDeposits-pov fold lemmas.
Spec changes:
- Ledger: getCoin (LedgerState) gains a coinFromGovDeposit summand
(gov-action deposits live in GovActionState.deposit, not
GState.deposits, yet the UTXO batch balance charges
govProposalsDeposits on the produced side).
- Certs: getCoin (CertState) is now total (rewards + deposit pots), with
coinFromRewards / coinFromDeposits projections.
- Prelude: era-independent sum lemmas (+-interleave, sum-map-+).
Squash of the pre-rebase branch (13 WIP commits, head f677e1b), rebased
onto master and adapted to #1250 (explicit cert deposits, closed-form
newCertDeposits/refundCertDeposits), #1253/#1256 (EntitiesEnv,
SUBENTITIES, tx-signal ENTITIES), #1262 (legacyMode threading), and
deposit sign-swap fix in #1250, so it is no longer part of the diff.
AI-assistend development: Claude Fable 5 <noreply@anthropic.com>1 parent f481664 commit e1539eb
3 files changed
Lines changed: 19 additions & 7 deletions
File tree
- src/Ledger/Dijkstra/Specification/Entities/Properties
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
7 | 19 | | |
8 | 20 | | |
9 | 21 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
| 293 | + | |
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
| 363 | + | |
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | | - | |
| 408 | + | |
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
| 285 | + | |
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| |||
0 commit comments