Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions src-lib-exts/abstract-set-theory/Axiom/Set/Properties.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{-# OPTIONS --safe --no-import-sorts #-}
open import Axiom.Set using (Theory)

module abstract-set-theory.Axiom.Set.Properties {ℓ} (th : Theory {ℓ}) where

open import abstract-set-theory.Prelude hiding (isEquivalence; trans; map; map₂)
open Theory th

open Equivalence

private variable
A B C : Type ℓ
X Y Z : Set A

module _ {P Q : A → Type} {sp-P : specProperty P} {sp-Q : specProperty Q} where

open import Relation.Unary using (_⇒_; Universal)

filter-⇒ : (P⇒Q : Universal (P ⇒ Q)) → filter sp-P (filter sp-Q X) ≡ᵉ filter sp-P X
filter-⇒ P⇒Q = filter-⇒-⊆ , filter-⇒-⊇
where
filter-⇒-⊆ : filter sp-P (filter sp-Q X) ⊆ filter sp-P X
filter-⇒-⊆ p with from ∈-filter p
... | (q , p) with from ∈-filter p
... | (_ , p) = to ∈-filter (q , p)

filter-⇒-⊇ : filter sp-P X ⊆ filter sp-P (filter sp-Q X)
filter-⇒-⊇ p with from ∈-filter p
... | (q , p) = to ∈-filter (q , (to ∈-filter (P⇒Q _ q , p)))

module _ {P : A → Type} {sp-P : specProperty P} {Q : B → Type} {sp-Q : specProperty Q} where

open import Relation.Unary using (_⇒_; Universal)

filter-map : ∀ {f : A → B} (Qf⇒P : Universal ((Q ∘ f) ⇒ P))
→ filter sp-Q (map f X) ≡ᵉ filter sp-Q (map f (filter sp-P X))
filter-map {f = f} Qf⇒P = filter-map-⊆ , filter-map-⊇
where
filter-map-⊆ : filter sp-Q (map f X) ⊆ filter sp-Q (map f (filter sp-P X))
filter-map-⊆ p with from ∈-filter p
... | Qa , p with from ∈-map p
... | (a , refl , p) = to ∈-filter (Qa , (to ∈-map (_ , (refl , (to ∈-filter (Qf⇒P a Qa , p))))))

filter-map-⊇ : filter sp-Q (map f (filter sp-P X)) ⊆ filter sp-Q (map f X)
filter-map-⊇ p with from ∈-filter p
... | Qfa , p with from ∈-map p
... | (a , refl , p) with from ∈-filter p
... | (Pa , p) = to ∈-filter (Qfa , (to ∈-map (a , (refl , p))))
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ open EnactState

open Computational ⦃...⦄

module _ {Γ : EnactEnv} {eSt : EnactState} {ga : GovAction} where

-- TODO: Make this follow from computationalness or viceversa
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just happened to see this PR, we actually have a lemma for this already: computational⇒rightUnique in Interface.ComputationalRelation.

ENACT-deterministic : ∀ {eSt' eSt''}
→ Γ ⊢ eSt ⇀⦇ ga ,ENACT⦈ eSt'
→ Γ ⊢ eSt ⇀⦇ ga ,ENACT⦈ eSt''
→ eSt' ≡ eSt''
ENACT-deterministic Enact-NoConf Enact-NoConf = refl
ENACT-deterministic (Enact-UpdComm _) (Enact-UpdComm _) = refl
ENACT-deterministic Enact-NewConst Enact-NewConst = refl
ENACT-deterministic Enact-HF Enact-HF = refl
ENACT-deterministic Enact-PParams Enact-PParams = refl
ENACT-deterministic (Enact-Wdrl _) (Enact-Wdrl _) = refl
ENACT-deterministic Enact-Info Enact-Info = refl

instance
Computational-ENACT : Computational _⊢_⇀⦇_,ENACT⦈_ String
Computational-ENACT .computeProof Γᵉ s =
Expand Down
23 changes: 12 additions & 11 deletions src/Ledger/Conway/Specification/Epoch.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -713,34 +713,35 @@ module Post-POOLREAPUpdate (es : EnactState)
```agda
open LState
open Governance-Update govUpd
opaque
```
-->
```agda
opaque
govActionReturns : RwdAddr ⇀ Coin
govActionReturns =
aggregate₊ (mapˢ (λ (a , _ , d) → a , d) removedGovActions ᶠˢ)

payout : RwdAddr ⇀ Coin
payout = govActionReturns ∪⁺ WithdrawalsOf es

opaque
refunds : Credential ⇀ Coin
refunds = pullbackMap payout toRwdAddr (dom (RewardsOf dState'))

dState'' : DState
dState'' = ⟦ VoteDelegsOf dState' , StakeDelegsOf dState' , RewardsOf dState' ∪⁺ refunds ⟧
dState'' : DState
dState'' = ⟦ VoteDelegsOf dState' , StakeDelegsOf dState' , RewardsOf dState' ∪⁺ refunds ⟧

unclaimed : Coin
unclaimed = getCoin payout - getCoin refunds
unclaimed : Coin
unclaimed = getCoin payout - getCoin refunds

totWithdrawals : Coin
totWithdrawals = ∑[ x ← WithdrawalsOf es ] x
totWithdrawals : Coin
totWithdrawals = ∑[ x ← WithdrawalsOf es ] x

acnt'' : Acnt
acnt'' = ⟦ TreasuryOf acnt' ∸ totWithdrawals + DonationsOf ls + unclaimed , ReservesOf acnt' ⟧
acnt'' : Acnt
acnt'' = ⟦ TreasuryOf acnt' ∸ totWithdrawals + DonationsOf ls + unclaimed , ReservesOf acnt' ⟧

updates : Post-POOLREAP-Update
updates = Post-POOLREAPUpdate dState'' acnt''
updates : Post-POOLREAP-Update
updates = Post-POOLREAPUpdate dState'' acnt''
```

### Transition Rule
Expand Down
1 change: 1 addition & 0 deletions src/Ledger/Conway/Specification/Epoch/Properties.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module Ledger.Conway.Specification.Epoch.Properties where

open import Ledger.Conway.Specification.Epoch.Properties.Computational
open import Ledger.Conway.Specification.Epoch.Properties.ConstRwds
open import Ledger.Conway.Specification.Epoch.Properties.ExpiredDReps
open import Ledger.Conway.Specification.Epoch.Properties.GovDepsMatch
open import Ledger.Conway.Specification.Epoch.Properties.NoPropSameDReps
```
Loading