Ledger¶
This module defines the ledger transition system where valid transactions transform the ledger state.
LEDGER Transition System Types¶
record SubLedgerEnv : Type where field slot : Slot ppolicy : Maybe ScriptHash pparams : PParams enactState : EnactState treasury : Treasury utxo₀ : UTxO isTopLevelValid : Bool allScripts : ℙ Script allData : DataHash ⇀ Datum record LedgerEnv : Type where field slot : Slot ppolicy : Maybe ScriptHash pparams : PParams enactState : EnactState treasury : Treasury
record LedgerState : Type where
field utxoSt : UTxOState govSt : GovState certState : CertState
Helper Functions¶
txgov : ∀ {ℓ} → TxBody ℓ → List (GovVote ⊎ GovProposal) txgov txb = map inj₂ txGovProposals ++ map inj₁ txGovVotes where open TxBody txb GovProposals+Votes : ∀ {ℓ} → Tx ℓ → List (GovVote ⊎ GovProposal) GovProposals+Votes tx = map inj₂ (ListOfGovProposalsOf tx) ++ map inj₁ (ListOfGovVotesOf tx) rmOrphanDRepVotes : CertState → GovState → GovState rmOrphanDRepVotes cs govSt = L.map (map₂ go) govSt where ifDRepRegistered : Credential → Type ifDRepRegistered c = c ∈ dom (DRepsOf cs) go : GovActionState → GovActionState go gas = record gas { votes = record (GovVotesOf gas) { gvDRep = filterKeys ifDRepRegistered (GovVotes.gvDRep (GovVotesOf gas)) } } allColdCreds : GovState → EnactState → ℙ Credential allColdCreds govSt es = ccCreds (es .cc) ∪ concatMapˢ (λ (_ , st) → proposedCC (GovActionOf st)) (fromList govSt) calculateDepositsChange : CertState → CertState → CertState → DepositsChange calculateDepositsChange certState₀ certState₁ certState₂ = $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#5803}{\htmlId{5311}{\htmlClass{Function}{\text{coinChangeTop}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#5746}{\htmlId{5327}{\htmlClass{Function}{\text{coinChangeSub}}}}\, \end{pmatrix}$ where coinFromDeposit : CertState → Coin coinFromDeposit certState = getCoin (DepositsOf (DStateOf certState)) + getCoin (DepositsOf (PStateOf certState)) + getCoin (DepositsOf (GStateOf certState)) coin₀ : Coin coin₀ = coinFromDeposit certState₀ coin₁ : Coin coin₁ = coinFromDeposit certState₁ coin₂ : Coin coin₂ = coinFromDeposit certState₂ coinChangeSub : ℤ coinChangeSub = coin₁ - coin₀ coinChangeTop : ℤ coinChangeTop = coin₂ - coin₁
LEDGER Transition System¶
New in Dijkstra¶
In Dijkstra we compute the set of "global" scripts and data once at the
top-level in the LEDGER{.AgdaDatatype} rule. This is threaded through
SUBLEDGER via
UTxOEnv{.AgdaDatatype}/SubUTxOEnv{.AgdaDatatype}.} to UTXOW{.AgdaDatatype}/SUBUTXOW{.AgdaDatatype
-
allScripts : ℙ Script is the union of all scripts relevant to the entire batch: scripts referenced/witnessed by the top-level transaction plus scripts referenced/witnessed by every subtransaction (computed by
getAllScripts). -
allData : DataHash ⇀ Datumis the collection of all data relevant to the entire batch: all datums appearing in witnesses and in any (sub)transaction context (computer by getAllData).
Design Rationale for Ledger Rule Premises¶
- Batch-scoped phase-2 context.
We compute allScripts and allData once, from the pre-batch UTxO snapshot
and the full batch (top-level transaction and all subtransactions). This ensures a
shared, batch-scoped pool of scripts and datums for phase-2 validation.
-
Subtransactions are conditional on top-level validity.
-
If
IsValidFlagOf txTop ≡ true, then each subtransaction parametrizes its ownUTXOW/CERTS/GOVSrelation and the resulting (codomain) states are carried forward (viaSUBLEDGERS). -
If
IsValidFlagOf txTop ≡ false, thenSUBLEDGERSis the identity relation (no subtransaction effects are applied). -
Connecting top-level CERTS and GOVS relations relative to UTXOW.
We check top-level CERTS and GOVS relations before
top-level UTXOW because:
CERTStracks deposit updates (now included inCertState),-
UTXOaccounting needs the net deposit change of the whole batch in theUTxOEnv(used innewDepositsBatch/depositRefundsBatchin theUtxo.Accountingmodule). -
CertState and GovState Dependencies.
-
Top-level
CERTSrelates the post-SUBLEDGERSCertState(which reflects subtransaction certificates) to the finalCertState. - Top-level
GOVSrelates the post-SUBLEDGERSGovState(which relfects proposals/votes of subtransactions) to the finalGovState, and is parameterized by the finalCertState(so it sees the final registered DRep set after certificates). -
Orphan DRep votes are removed using the final (post-
CERTS)CertState. -
allColdCredsuses the finalGovState
The CertEnv assumed in the CERTS relation includes
allColdCreds govState₁ enactState to so that CC hot key registration can account
for both enacted CC credentials and any newly proposed CC actions that appear in
the final (post-subtransaction processing) GovState.
data _⊢_⇀⦇_,SUBLEDGER⦈_ : SubLedgerEnv → LedgerState → SubLevelTx → LedgerState → Type where SUBLEDGER-V : ∙ isTopLevelValid ≡ true ∙ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6239}{\htmlId{9971}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6337}{\htmlId{9978}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6432}{\htmlId{9983}{\htmlClass{Generalizable}{\text{treasury}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#5955}{\htmlId{9994}{\htmlClass{Generalizable}{\text{utxo₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6479}{\htmlId{10002}{\htmlClass{Generalizable}{\text{isTopLevelValid}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6522}{\htmlId{10020}{\htmlClass{Generalizable}{\text{allScripts}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6569}{\htmlId{10033}{\htmlClass{Generalizable}{\text{allData}}}}\, \end{pmatrix}$ ⊢ utxoState₀ ⇀⦇ stx ,SUBUTXOW⦈ utxoState₁ ∙ $\begin{pmatrix} \,\href{Ledger.Core.Specification.Epoch.html#954}{\htmlId{10095}{\htmlClass{Function}{\text{epoch}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6239}{\htmlId{10101}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6337}{\htmlId{10108}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Transaction.html#12712}{\htmlId{10113}{\htmlClass{Field}{\text{ListOfGovVotesOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6190}{\htmlId{10130}{\htmlClass{Generalizable}{\text{stx}}}}\, \\ \,\href{Ledger.Core.Specification.Address.html#2976}{\htmlId{10136}{\htmlClass{Field}{\text{WithdrawalsOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6190}{\htmlId{10150}{\htmlClass{Generalizable}{\text{stx}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#5002}{\htmlId{10156}{\htmlClass{Function}{\text{allColdCreds}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6094}{\htmlId{10169}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6383}{\htmlId{10179}{\htmlClass{Generalizable}{\text{enactState}}}}\, \end{pmatrix}$ ⊢ certState₀ ⇀⦇ DCertsOf stx ,CERTS⦈ certState₁ ∙ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Transaction.html#11441}{\htmlId{10250}{\htmlClass{Field}{\text{TxIdOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6190}{\htmlId{10257}{\htmlClass{Generalizable}{\text{stx}}}}\, \\ \,\href{Ledger.Core.Specification.Epoch.html#954}{\htmlId{10263}{\htmlClass{Function}{\text{epoch}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6239}{\htmlId{10269}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6337}{\htmlId{10276}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6282}{\htmlId{10281}{\htmlClass{Generalizable}{\text{ppolicy}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6383}{\htmlId{10291}{\htmlClass{Generalizable}{\text{enactState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6057}{\htmlId{10304}{\htmlClass{Generalizable}{\text{certState₁}}}}\, \\ \,\href{Class.IsSet.html#916}{\htmlId{10317}{\htmlClass{Function}{\text{dom}}}}\, \,\htmlId{10321}{\htmlClass{Symbol}{\text{(}}}\,\,\href{Ledger.Dijkstra.Specification.Certs.html#3324}{\htmlId{10322}{\htmlClass{Field}{\text{RewardsOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6057}{\htmlId{10332}{\htmlClass{Generalizable}{\text{certState₁}}}}\,\,\htmlId{10342}{\htmlClass{Symbol}{\text{)}}}\, \end{pmatrix}$ ⊢ govState₀ ⇀⦇ GovProposals+Votes stx ,GOVS⦈ govState₁ ──────────────────────────────── $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6239}{\htmlId{10452}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6282}{\htmlId{10459}{\htmlClass{Generalizable}{\text{ppolicy}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6337}{\htmlId{10469}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6383}{\htmlId{10474}{\htmlClass{Generalizable}{\text{enactState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6432}{\htmlId{10487}{\htmlClass{Generalizable}{\text{treasury}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#5955}{\htmlId{10498}{\htmlClass{Generalizable}{\text{utxo₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6479}{\htmlId{10506}{\htmlClass{Generalizable}{\text{isTopLevelValid}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6522}{\htmlId{10524}{\htmlClass{Generalizable}{\text{allScripts}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6569}{\htmlId{10537}{\htmlClass{Generalizable}{\text{allData}}}}\, \end{pmatrix}$ ⊢ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#5998}{\htmlId{10551}{\htmlClass{Generalizable}{\text{utxoState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6094}{\htmlId{10564}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6046}{\htmlId{10576}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \end{pmatrix}$ ⇀⦇ stx ,SUBLEDGER⦈ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6009}{\htmlId{10610}{\htmlClass{Generalizable}{\text{utxoState₁}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6105}{\htmlId{10623}{\htmlClass{Generalizable}{\text{govState₁}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6057}{\htmlId{10635}{\htmlClass{Generalizable}{\text{certState₁}}}}\, \end{pmatrix}$ SUBLEDGER-I : ∙ isTopLevelValid ≡ false ∙ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6239}{\htmlId{10707}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6337}{\htmlId{10714}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6432}{\htmlId{10719}{\htmlClass{Generalizable}{\text{treasury}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#5955}{\htmlId{10730}{\htmlClass{Generalizable}{\text{utxo₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6479}{\htmlId{10738}{\htmlClass{Generalizable}{\text{isTopLevelValid}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6522}{\htmlId{10756}{\htmlClass{Generalizable}{\text{allScripts}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6569}{\htmlId{10769}{\htmlClass{Generalizable}{\text{allData}}}}\, \end{pmatrix}$ ⊢ utxoState₀ ⇀⦇ stx ,SUBUTXOW⦈ utxoState₀ ──────────────────────────────── $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6239}{\htmlId{10872}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6282}{\htmlId{10879}{\htmlClass{Generalizable}{\text{ppolicy}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6337}{\htmlId{10889}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6383}{\htmlId{10894}{\htmlClass{Generalizable}{\text{enactState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6432}{\htmlId{10907}{\htmlClass{Generalizable}{\text{treasury}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#5955}{\htmlId{10918}{\htmlClass{Generalizable}{\text{utxo₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6479}{\htmlId{10926}{\htmlClass{Generalizable}{\text{isTopLevelValid}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6522}{\htmlId{10944}{\htmlClass{Generalizable}{\text{allScripts}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6569}{\htmlId{10957}{\htmlClass{Generalizable}{\text{allData}}}}\, \end{pmatrix}$ ⊢ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#5998}{\htmlId{10971}{\htmlClass{Generalizable}{\text{utxoState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6094}{\htmlId{10984}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6046}{\htmlId{10996}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \end{pmatrix}$ ⇀⦇ stx ,SUBLEDGER⦈ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#5998}{\htmlId{11030}{\htmlClass{Generalizable}{\text{utxoState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6094}{\htmlId{11043}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6046}{\htmlId{11055}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \end{pmatrix}$ _⊢_⇀⦇_,SUBLEDGERS⦈_ : SubLedgerEnv → LedgerState → List SubLevelTx → LedgerState → Type _⊢_⇀⦇_,SUBLEDGERS⦈_ = ReflexiveTransitiveClosure {sts = _⊢_⇀⦇_,SUBLEDGER⦈_} data _⊢_⇀⦇_,LEDGER⦈_ : LedgerEnv → LedgerState → TopLevelTx → LedgerState → Type where LEDGER-V : let utxo₀ : UTxO utxo₀ = UTxOOf utxoState₀ allScripts : ℙ Script allScripts = getAllScripts tx utxo₀ allData : DataHash ⇀ Datum allData = setToMap (mapˢ < hash , id > (getAllData tx utxo₀)) depositsChange : DepositsChange depositsChange = calculateDepositsChange certState₀ certState₁ certState₂ in ∙ IsValidFlagOf tx ≡ true ∙ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6239}{\htmlId{11752}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6282}{\htmlId{11759}{\htmlClass{Generalizable}{\text{ppolicy}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6337}{\htmlId{11769}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6383}{\htmlId{11774}{\htmlClass{Generalizable}{\text{enactState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6432}{\htmlId{11787}{\htmlClass{Generalizable}{\text{treasury}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#11345}{\htmlId{11798}{\htmlClass{Bound}{\text{utxo₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Transaction.html#13837}{\htmlId{11806}{\htmlClass{Field}{\text{IsValidFlagOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6141}{\htmlId{11820}{\htmlClass{Generalizable}{\text{tx}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#11403}{\htmlId{11825}{\htmlClass{Bound}{\text{allScripts}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#11480}{\htmlId{11838}{\htmlClass{Bound}{\text{allData}}}}\, \end{pmatrix}$ ⊢ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#5998}{\htmlId{11852}{\htmlClass{Generalizable}{\text{utxoState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6094}{\htmlId{11865}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6046}{\htmlId{11877}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \end{pmatrix}$ ⇀⦇ SubTransactionsOf tx ,SUBLEDGERS⦈ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6009}{\htmlId{11929}{\htmlClass{Generalizable}{\text{utxoState₁}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6105}{\htmlId{11942}{\htmlClass{Generalizable}{\text{govState₁}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6057}{\htmlId{11954}{\htmlClass{Generalizable}{\text{certState₁}}}}\, \end{pmatrix}$ ∙ $\begin{pmatrix} \,\href{Ledger.Core.Specification.Epoch.html#954}{\htmlId{11977}{\htmlClass{Function}{\text{epoch}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6239}{\htmlId{11983}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6337}{\htmlId{11990}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Transaction.html#12712}{\htmlId{11995}{\htmlClass{Field}{\text{ListOfGovVotesOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6141}{\htmlId{12012}{\htmlClass{Generalizable}{\text{tx}}}}\, \\ \,\href{Ledger.Core.Specification.Address.html#2976}{\htmlId{12017}{\htmlClass{Field}{\text{WithdrawalsOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6141}{\htmlId{12031}{\htmlClass{Generalizable}{\text{tx}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#5002}{\htmlId{12036}{\htmlClass{Function}{\text{allColdCreds}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6105}{\htmlId{12049}{\htmlClass{Generalizable}{\text{govState₁}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6383}{\htmlId{12059}{\htmlClass{Generalizable}{\text{enactState}}}}\, \end{pmatrix}$ ⊢ certState₁ ⇀⦇ DCertsOf tx ,CERTS⦈ certState₂ ∙ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Transaction.html#11441}{\htmlId{12129}{\htmlClass{Field}{\text{TxIdOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6141}{\htmlId{12136}{\htmlClass{Generalizable}{\text{tx}}}}\, \\ \,\href{Ledger.Core.Specification.Epoch.html#954}{\htmlId{12141}{\htmlClass{Function}{\text{epoch}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6239}{\htmlId{12147}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6337}{\htmlId{12154}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6282}{\htmlId{12159}{\htmlClass{Generalizable}{\text{ppolicy}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6383}{\htmlId{12169}{\htmlClass{Generalizable}{\text{enactState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6068}{\htmlId{12182}{\htmlClass{Generalizable}{\text{certState₂}}}}\, \\ \,\href{Class.IsSet.html#916}{\htmlId{12195}{\htmlClass{Function}{\text{dom}}}}\, \,\htmlId{12199}{\htmlClass{Symbol}{\text{(}}}\,\,\href{Ledger.Dijkstra.Specification.Certs.html#3324}{\htmlId{12200}{\htmlClass{Field}{\text{RewardsOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6068}{\htmlId{12210}{\htmlClass{Generalizable}{\text{certState₂}}}}\,\,\htmlId{12220}{\htmlClass{Symbol}{\text{)}}}\, \end{pmatrix}$ ⊢ govState₁ ⇀⦇ GovProposals+Votes tx ,GOVS⦈ govState₂ ∙ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6239}{\htmlId{12288}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6337}{\htmlId{12295}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6432}{\htmlId{12300}{\htmlClass{Generalizable}{\text{treasury}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#11345}{\htmlId{12311}{\htmlClass{Bound}{\text{utxo₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#11588}{\htmlId{12319}{\htmlClass{Bound}{\text{depositsChange}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#11403}{\htmlId{12336}{\htmlClass{Bound}{\text{allScripts}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#11480}{\htmlId{12349}{\htmlClass{Bound}{\text{allData}}}}\, \end{pmatrix}$ ⊢ utxoState₁ ⇀⦇ tx ,UTXOW⦈ utxoState₂ ──────────────────────────────── $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6239}{\htmlId{12448}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6282}{\htmlId{12455}{\htmlClass{Generalizable}{\text{ppolicy}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6337}{\htmlId{12465}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6383}{\htmlId{12470}{\htmlClass{Generalizable}{\text{enactState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6432}{\htmlId{12483}{\htmlClass{Generalizable}{\text{treasury}}}}\, \end{pmatrix}$ ⊢ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#5998}{\htmlId{12498}{\htmlClass{Generalizable}{\text{utxoState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6094}{\htmlId{12511}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6046}{\htmlId{12523}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \end{pmatrix}$ ⇀⦇ tx ,LEDGER⦈ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6020}{\htmlId{12553}{\htmlClass{Generalizable}{\text{utxoState₂}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#4629}{\htmlId{12566}{\htmlClass{Function}{\text{rmOrphanDRepVotes}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6068}{\htmlId{12584}{\htmlClass{Generalizable}{\text{certState₂}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6116}{\htmlId{12595}{\htmlClass{Generalizable}{\text{govState₂}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6068}{\htmlId{12607}{\htmlClass{Generalizable}{\text{certState₂}}}}\, \end{pmatrix}$ LEDGER-I : let utxo₀ : UTxO utxo₀ = UTxOOf utxoState₀ allScripts : ℙ Script allScripts = getAllScripts tx utxo₀ allData : DataHash ⇀ Datum allData = setToMap (mapˢ < hash , id > (getAllData tx utxo₀)) in ∙ IsValidFlagOf tx ≡ false ∙ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6239}{\htmlId{12927}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6282}{\htmlId{12934}{\htmlClass{Generalizable}{\text{ppolicy}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6337}{\htmlId{12944}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6383}{\htmlId{12949}{\htmlClass{Generalizable}{\text{enactState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6432}{\htmlId{12962}{\htmlClass{Generalizable}{\text{treasury}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#12644}{\htmlId{12973}{\htmlClass{Bound}{\text{utxo₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Transaction.html#13837}{\htmlId{12981}{\htmlClass{Field}{\text{IsValidFlagOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6141}{\htmlId{12995}{\htmlClass{Generalizable}{\text{tx}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#12702}{\htmlId{13000}{\htmlClass{Bound}{\text{allScripts}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#12779}{\htmlId{13013}{\htmlClass{Bound}{\text{allData}}}}\, \end{pmatrix}$ ⊢ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#5998}{\htmlId{13027}{\htmlClass{Generalizable}{\text{utxoState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6094}{\htmlId{13040}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6046}{\htmlId{13052}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \end{pmatrix}$ ⇀⦇ SubTransactionsOf tx ,SUBLEDGERS⦈ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#5998}{\htmlId{13104}{\htmlClass{Generalizable}{\text{utxoState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6094}{\htmlId{13117}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6046}{\htmlId{13129}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \end{pmatrix}$ ∙ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6239}{\htmlId{13152}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6337}{\htmlId{13159}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6432}{\htmlId{13164}{\htmlClass{Generalizable}{\text{treasury}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#12644}{\htmlId{13175}{\htmlClass{Bound}{\text{utxo₀}}}}\, \\ \begin{pmatrix} \,\href{Data.Integer.Base.html#1545}{\htmlId{13185}{\htmlClass{Function}{\text{0ℤ}}}}\, \\ \,\href{Data.Integer.Base.html#1545}{\htmlId{13190}{\htmlClass{Function}{\text{0ℤ}}}}\, \end{pmatrix} \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#12702}{\htmlId{13197}{\htmlClass{Bound}{\text{allScripts}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#12779}{\htmlId{13210}{\htmlClass{Bound}{\text{allData}}}}\, \end{pmatrix}$ ⊢ utxoState₀ ⇀⦇ tx ,UTXOW⦈ utxoState₁ ──────────────────────────────── $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6239}{\htmlId{13309}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6282}{\htmlId{13316}{\htmlClass{Generalizable}{\text{ppolicy}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6337}{\htmlId{13326}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6383}{\htmlId{13331}{\htmlClass{Generalizable}{\text{enactState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6432}{\htmlId{13344}{\htmlClass{Generalizable}{\text{treasury}}}}\, \end{pmatrix}$ ⊢ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#5998}{\htmlId{13359}{\htmlClass{Generalizable}{\text{utxoState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6094}{\htmlId{13372}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6046}{\htmlId{13384}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \end{pmatrix}$ ⇀⦇ tx ,LEDGER⦈ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6009}{\htmlId{13414}{\htmlClass{Generalizable}{\text{utxoState₁}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6094}{\htmlId{13427}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6046}{\htmlId{13439}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \end{pmatrix}$ _⊢_⇀⦇_,LEDGERS⦈_ : LedgerEnv → LedgerState → List TopLevelTx → LedgerState → Type _⊢_⇀⦇_,LEDGERS⦈_ = ReflexiveTransitiveClosure {sts = _⊢_⇀⦇_,LEDGER⦈_}