Skip to content

Commit de995cd

Browse files
committed
Remove postulates; import module from Epoch.Properties
1 parent aba7685 commit de995cd

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

src/Ledger/Conway/Specification/Epoch/Properties.agda

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ module Ledger.Conway.Specification.Epoch.Properties where
44

55
open import Ledger.Conway.Specification.Epoch.Properties.Computational
66
open import Ledger.Conway.Specification.Epoch.Properties.ConstRwds
7+
open import Ledger.Conway.Specification.Epoch.Properties.ExpiredDReps
78
open import Ledger.Conway.Specification.Epoch.Properties.GovDepsMatch
89
open import Ledger.Conway.Specification.Epoch.Properties.NoPropSameDReps

src/Ledger/Conway/Specification/Epoch/Properties/ExpiredDReps.agda

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
-- {-# OPTIONS --without-K #-}
1+
{-# OPTIONS --safe #-}
2+
23
open import Ledger.Conway.Specification.Transaction
34
open import Ledger.Conway.Specification.Abstract
45

@@ -26,10 +27,6 @@ open import Ledger.Conway.Specification.Gov.Actions govStructure using (Vote)
2627
open import Axiom.Set.Properties th
2728
open import Relation.Binary.PropositionalEquality hiding (cong)
2829

29-
postulate
30-
e<sucᵉ : {e : Epoch} e < sucᵉ e
31-
≤-predᵉ : {e e' : Epoch} sucᵉ e ≤ sucᵉ e' e ≤ e'
32-
3330
-- | Epoch indexed relation.
3431
-- Two DReps (Map Credential Epoch) are related iff: Non-expired DReps are the same.
3532
DReps-[_]_≈_ : Epoch B.Rel DReps 0ℓ

src/Ledger/Core/Specification/Epoch.agda

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ open import Ledger.Prelude hiding (compare; Rel)
66

77
open import Agda.Builtin.FromNat
88
open import Algebra using (Semiring)
9-
open import Relation.Binary
10-
open import Data.Nat.Properties using (+-*-semiring)
9+
open import Data.Nat.Properties using (+-monoˡ-≤; +-cancelˡ-<; +-*-semiring; suc-injective)
1110
open import Data.Rational using (ℚ)
1211
import Data.Rational as ℚ
1312
import Data.Rational.Properties as ℚ
13+
open import Data.Sum using ([_,_]′)
1414

1515
additionVia : {A : Set} (A A) A A
1616
additionVia sucFun zero r = r
@@ -49,6 +49,10 @@ record EpochStructure : Type₁ where
4949
; <-resp-≈ = (λ where refl id) , (λ where refl id)
5050
}
5151

52+
field
53+
e<sucᵉ : {e : Epoch} e < sucᵉ e
54+
≤-predᵉ : {e e' : Epoch} sucᵉ e ≤ sucᵉ e' e ≤ e'
55+
5256
_ = _<_ {A = Slot} ⁇² ∋ it
5357
_ = _≤_ {A = Slot} ⁇² ∋ it
5458
_ = _<_ {A = Epoch} ⁇² ∋ it
@@ -94,12 +98,15 @@ record GlobalConstants : Type₁ where
9498
ℕEpochStructure : EpochStructure
9599
ℕEpochStructure = λ where
96100
.Slotʳ +-*-semiring
101+
.DecPo-Slot ℕ-hasDecPartialOrder
97102
.Epoch
98103
.epoch slot slot / SlotsPerEpochᶜ
99104
.firstSlot e e * SlotsPerEpochᶜ
100105
.RandomnessStabilisationWindow RandomnessStabilisationWindowᶜ
101106
.StabilityWindow StabilityWindowᶜ
102107
.sucᵉ suc
108+
.e<sucᵉ +-monoˡ-≤ _ (>-nonZero⁻¹ SlotsPerEpochᶜ)
109+
.≤-predᵉ [ (λ p inj₁ (+-cancelˡ-< _ _ _ p)) , (λ p inj₂ (suc-injective p)) ]′
103110
._+ᵉ'_ _+_
104111
.+ᵉ≡+ᵉ' {a} {b} ℕ+ᵉ≡+ᵉ' {a} {b}
105112

0 commit comments

Comments
 (0)