Skip to content
Open
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
16 changes: 11 additions & 5 deletions src/Ledger/Conway/Specification/Ratify.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,11 @@ utilizes the following auxiliary definitions.

+ all commitee members vote `no`{.AgdaInductiveConstructor}.

+ `mT`{.AgdaFunction}: This is the threshold of the `CC`{.AgdaInductiveConstructor}.
It may be `nothing`{.AgdaInductiveConstructor}.
+ `mT`{.AgdaFunction}: This is the threshold of the
`CC`{.AgdaInductiveConstructor}. In case it is
`nothing`{.AgdaInductiveConstructor}, the `CC`{.AgdaInductiveConstructor} is
not allowed to vote and the action is accepted automatically (e.g., for
`NoConfidence` or `UpdateCommittee` actions).

+ `stakeDistr`{.AgdaFunction} computes the stake distribution. Note that every
constitutional committe member has a stake of 1, giving them equal voting power.
Expand Down Expand Up @@ -363,8 +366,7 @@ module AcceptedByCC (currentEpoch : Epoch)
acceptedStake = ∑[ x ← stakeDistr ∣ actualVotes ⁻¹ Vote.yes ] x
totalStake = ∑[ x ← stakeDistr ∣ dom (actualVotes ∣^ (❴ Vote.yes ❵ ∪ ❴ Vote.no ❵)) ] x

accepted = (acceptedStake /₀ totalStake) ≥ t
× (sizeActiveCC ≥ ccMinSize ⊎ (Is-nothing mT × ccMinSize ≡ 0))
accepted = Is-just mT → (sizeActiveCC ≥ ccMinSize) × (acceptedStake /₀ totalStake) ≥ t
```

```agda
Expand Down Expand Up @@ -667,8 +669,12 @@ opaque
Is-nothing? {x = x} = All.dec (const $ no id) x
where import Data.Maybe.Relation.Unary.All as All

Is-just? : ∀ {A : Set} {x : Maybe A} → Dec (Is-just x)
Is-just? {x = x} = Any.dec (const $ yes tt) x
where import Data.Maybe.Relation.Unary.Any as Any

acceptedByCC? : ∀ Γ es st → Dec (acceptedByCC Γ es st)
acceptedByCC? _ _ _ = _ ℚ.≤? _ ×-dec (_ ≥? _ ⊎-dec (Is-nothing? ×-dec ¿ _ ¿))
acceptedByCC? _ _ _ = Is-just? →-dec (_ ≥? _ ×-dec _ ℚ.≤? _ )

acceptedByDRep? : ∀ Γ es st → Dec (acceptedByDRep Γ es st)
acceptedByDRep? _ _ _ = _ ℚ.≤? _
Expand Down