Commit d99e02a
[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
#1263/#1265 (UTXOW premise changes). Master absorbed this branch's
deposit sign-swap fix in #1250, so it is no longer part of the diff.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent e6ba69e commit d99e02a
9 files changed
Lines changed: 1793 additions & 10 deletions
File tree
- src/Ledger
- Dijkstra/Specification
- Entities
- Properties
- Ledger
- 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 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
365 | 380 | | |
366 | 381 | | |
367 | 382 | | |
368 | 383 | | |
369 | | - | |
| 384 | + | |
| 385 | + | |
370 | 386 | | |
371 | 387 | | |
372 | 388 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
0 commit comments