@@ -113,6 +113,9 @@ open import Ledger.Dijkstra.Specification.Utxow txs abs
113113
114114open import Ledger.Dijkstra.Specification.Certs.Properties.PoV govStructure
115115open import Ledger.Dijkstra.Specification.Entities.Properties.PoV txs
116+ open import Ledger.Dijkstra.Specification.Gov.Properties.PoV txs abs
117+ using ( proposalsOf; proposalsOf-Proposals+Votes
118+ ; rmOrphanDRepVotes-coinFromGovDeposit; GOVS-coinFromGovDeposit )
116119open import Ledger.Dijkstra.Specification.Utxo.Properties.PoV txs abs
117120 using (noMintingSubTxs)
118121open import Ledger.Dijkstra.Specification.Utxow.Properties.PoV txs abs
@@ -126,13 +129,6 @@ open ≡-Reasoning
126129instance
127130 _ = +-0-monoid
128131
129- -- proposalsOf is useful for extracting proposals from a mixed `GOVS` (`GovVote ⊎
130- -- GovProposal`) input list for the `GOVS-coinFromGovDeposit` gov-deposit accounting.
131- proposalsOf : {A B : Type} → List (A ⊎ B) → List B
132- proposalsOf [] = []
133- proposalsOf (inj₁ _ ∷ xs) = proposalsOf xs
134- proposalsOf (inj₂ p ∷ xs) = p ∷ proposalsOf xs
135-
136132```
137133-->
138134
@@ -155,8 +151,8 @@ organized into the following groups:
155151 themselves are imported from ` Utxow.Properties.PoV ` {.AgdaModule};
156152+ Cert facts: value accounting for a single ` CERTS ` {.AgdaDatatype} run,
157153 imported from ` Certs.Properties.PoV ` {.AgdaModule};
158- + Gov deposit facts ( ` rmOrphanDRepVotes-coinFromGovDeposit ` {.AgdaFunction},
159- ` GOVS-coinFromGovDeposit ` {.AgdaFunction}) ;
154+ + Gov deposit facts, imported from ` Gov.Properties.PoV ` {.AgdaModule} together
155+ with ` proposalsOf ` {.AgdaFunction}, whose single home is that module ;
160156+ no-truncation withdrawal bounds (` ENTITIES-wdrls-bounded ` {.AgdaFunction},
161157 ` SUBENTITIES-wdrls-bounded ` {.AgdaFunction}); see
162158 ` Entities.Properties.PoV ` {.AgdaModule} for why these are not consequences of
@@ -222,28 +218,15 @@ module LEDGER-PoV
222218 → Γe ⊢ cs ⇀⦇ stx ,SUBENTITIES⦈ cs'
223219 → ∀[ (addr , amt) ∈ (WithdrawalsOf stx) ˢ ]
224220 amt ≤ maybe id 0 (lookupᵐ? (RewardsOf cs) (stake addr)) )
225-
226- -- Governance-deposit accounting. `rmOrphanDRepVotes` only rewrites
227- -- `votes.gvDRep`, never `GovActionState.deposit`, so it leaves
228- -- `coinFromGovDeposit` unchanged.
229- ( rmOrphanDRepVotes-coinFromGovDeposit :
230- (cs : CertState) (g : GovState)
231- → coinFromGovDeposit (rmOrphanDRepVotes cs g) ≡ coinFromGovDeposit g )
232-
233- -- Per-`GOVS`-step gov-deposit growth equals `govProposalsDeposits` of step's
234- -- proposals. Used by `SUBLEDGERS-gov-coin` and `gov-acc`.
235- ( GOVS-coinFromGovDeposit :
236- ∀ {Γ : GovEnv} {govSt govSt′ : GovState} {props}
237- → Γ ⊢ govSt ⇀⦇ props ,GOVS⦈ govSt′
238- → coinFromGovDeposit govSt′
239- ≡ coinFromGovDeposit govSt + govProposalsDeposits (PParamsOf Γ) (proposalsOf props) )
240221 where
241222
242- -- The UTxO-side and Certs -side facts, previously module parameters, are now
243- -- imported: `utxow-pov-invalid`, `UTXOW-V-mechanical` and
223+ -- The UTxO-side, Certs-side and gov -side facts, previously module parameters,
224+ -- are now imported: `utxow-pov-invalid`, `UTXOW-V-mechanical` and
244225 -- `UTXOW-batch-balance-coin` from `UTXOW-PoV`; `subutxow-step-coin` from
245- -- `SUBUTXOW-PoV` (given the two batch-threading hypotheses above); and the
246- -- `CERTS-*` facts with `refundCertDeposits-++` from `Certs.Properties.PoV`.
226+ -- `SUBUTXOW-PoV` (given the two batch-threading hypotheses above); the
227+ -- `CERTS-*` facts with `refundCertDeposits-++` from `Certs.Properties.PoV`;
228+ -- and `rmOrphanDRepVotes-coinFromGovDeposit` with `GOVS-coinFromGovDeposit`
229+ -- from `Gov.Properties.PoV`.
247230 open UTXOW-PoV tx noMintSubTx
248231 open SUBUTXOW-PoV subtx-fresh-txid subtx-spend-agree
249232
@@ -554,24 +537,10 @@ transaction's certificates.
554537Induct over ` SUBLEDGERS ` {.AgdaDatatype}, threading the per-` GOVS ` gov-deposit growth: each
555538` SUBLEDGER-V ` {.AgdaInductiveConstructor} step grows ` coinFromGovDeposit ` {.AgdaFunction} by the
556539` govProposalsDeposits ` {.AgdaFunction} of the sub-transaction's proposals (via the
557- ` GOVS-coinFromGovDeposit ` {.AgdaFunction} parameter applied to the step's ` GOVS `
540+ ` GOVS-coinFromGovDeposit ` {.AgdaFunction} fact applied to the step's ` GOVS `
558541premise). ` SUBLEDGER-I ` {.AgdaInductiveConstructor} is ruled out by the top-level validity flag.
559542
560543``` agda
561- -- `proposalsOf (GovProposals+Votes t)` recovers exactly the proposals of `t`.
562- proposalsOf-Proposals+Votes : ∀ {ℓ} (t : Tx ℓ)
563- → proposalsOf (GovProposals+Votes t) ≡ ListOfGovProposalsOf t
564- proposalsOf-Proposals+Votes t = go (ListOfGovProposalsOf t) (ListOfGovVotesOf t)
565- where
566- drop-votes : {A B : Type} (vs : List A) → proposalsOf {B = B} (map inj₁ vs) ≡ []
567- drop-votes [] = refl
568- drop-votes (_ ∷ vs) = drop-votes vs
569-
570- go : {A B : Type} (ps : List B) (vs : List A)
571- → proposalsOf (map inj₂ ps ++ map inj₁ vs) ≡ ps
572- go [] vs = drop-votes vs
573- go (p ∷ ps) vs = cong (p ∷_) (go ps vs)
574-
575544 open SubLedgerEnv
576545
577546 SUBLEDGERS-gov-coin :
@@ -653,7 +622,7 @@ sub-level totals of direct deposits and withdrawals respectively, the goal
653622where ` G₀ = coinFromGovDeposit govState₀ ` and, since the final
654623` LEDGER-V ` {.AgdaInductiveConstructor} ` GovState ` {.AgdaRecord}
655624is ` rmOrphanDRepVotes certState₂ govState₂ ` and ` rmOrphanDRepVotes ` preserves
656- ` coinFromGovDeposit ` (parameter ` rmOrphanDRepVotes-coinFromGovDeposit ` ),
625+ ` coinFromGovDeposit ` (` rmOrphanDRepVotes-coinFromGovDeposit ` ),
657626` G' = coinFromGovDeposit govState₂ ` .
658627
659628The body assembles the goal from two lemmas:
0 commit comments