Skip to content

Commit 5d01aca

Browse files
committed
Renaming V-Role to VT-Role
1 parent d73f582 commit 5d01aca

File tree

4 files changed

+37
-23
lines changed

4 files changed

+37
-23
lines changed

formal-spec/Leios/Short.lagda.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ module Leios.Short (⋯ : SpecStructure 1)
2727
```
2828
```agda
2929
data SlotUpkeep : Type where
30-
Base IB-Role EB-Role V-Role : SlotUpkeep
30+
Base IB-Role EB-Role VT-Role : SlotUpkeep
3131
3232
unquoteDecl DecEq-SlotUpkeep = derive-DecEq ((quote SlotUpkeep , DecEq-SlotUpkeep) ∷ [])
3333
3434
allUpkeep : ℙ SlotUpkeep
35-
allUpkeep = (((∅ ∪ ❴ IB-Role ❵) ∪ ❴ EB-Role ❵) ∪ ❴ V-Role ❵) ∪ ❴ Base
35+
allUpkeep = fromList (IB-Role EB-Role ∷ VT-Role Base ∷ [])
3636
```
3737
```agda
3838
open import Leios.Protocol (⋯) SlotUpkeep public
@@ -88,11 +88,11 @@ data _↝_ : LeiosState → LeiosState → Type where
8888
EBs' = filter (allIBRefsKnown s) $ filter (_∈ᴮ slice L slot 1) EBs
8989
votes = map (vote sk-V ∘ hash) EBs'
9090
in
91-
∙ needsUpkeep V-Role
91+
∙ needsUpkeep VT-Role
9292
∙ canProduceV slot sk-V (stake s)
9393
∙ ffds FFD.-⟦ Send (vHeader votes) nothing / SendRes ⟧⇀ ffds'
9494
─────────────────────────────────────────────────────────────────────────
95-
s ↝ addUpkeep record s { FFDState = ffds' } V-Role
95+
s ↝ addUpkeep record s { FFDState = ffds' } VT-Role
9696
```
9797
#### Negative Block/Vote production rules
9898
```agda
@@ -111,10 +111,10 @@ data _↝_ : LeiosState → LeiosState → Type where
111111
```
112112
```agda
113113
No-VT-Role : let open LeiosState s in
114-
∙ needsUpkeep V-Role
114+
∙ needsUpkeep VT-Role
115115
∙ ¬ canProduceV slot sk-V (stake s)
116116
─────────────────────────────────────────────
117-
s ↝ addUpkeep s V-Role
117+
s ↝ addUpkeep s VT-Role
118118
```
119119
### Uniform short-pipeline
120120
```agda

formal-spec/Leios/Short/Deterministic.agda

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,18 +190,18 @@ data _-⟦V-Role⟧⇀_ : LeiosState → LeiosState → Type where
190190
∙ canProduceV slot sk-V (stake s)
191191
∙ ffds FFD.-⟦ Send (vHeader votes) nothing / SendRes ⟧⇀ ffds'
192192
────────────────────────────────────────────────────────────────────
193-
s -⟦V-Role⟧⇀ addUpkeep record s { FFDState = ffds' } V-Role
193+
s -⟦V-Role⟧⇀ addUpkeep record s { FFDState = ffds' } VT-Role
194194

195195
No-V-Role : let open LeiosState s in
196196
∙ ¬ canProduceV slot sk-V (stake s)
197197
────────────────────────────────────────
198-
s -⟦V-Role⟧⇀ addUpkeep s V-Role
198+
s -⟦V-Role⟧⇀ addUpkeep s VT-Role
199199

200-
V-Role⇒ND : LeiosState.needsUpkeep s V-Role s -⟦V-Role⟧⇀ s' just s ND.-⟦ SLOT / EMPTY ⟧⇀ s'
200+
V-Role⇒ND : LeiosState.needsUpkeep s VT-Role s -⟦V-Role⟧⇀ s' just s ND.-⟦ SLOT / EMPTY ⟧⇀ s'
201201
V-Role⇒ND u (V-Role x₁ x₂) = Roles (VT-Role u x₁ x₂)
202202
V-Role⇒ND u (No-V-Role x₁) = Roles (No-VT-Role u x₁)
203203

204-
V-Role-Upkeep : {u} u ≢ V-Role LeiosState.needsUpkeep s u s -⟦V-Role⟧⇀ s'
204+
V-Role-Upkeep : {u} u ≢ VT-Role LeiosState.needsUpkeep s u s -⟦V-Role⟧⇀ s'
205205
LeiosState.needsUpkeep s' u
206206
V-Role-Upkeep u≢V-Role h (V-Role _ _) u∈su = case Equivalence.from ∈-∪ u∈su of λ where
207207
(inj₁ x) h x
@@ -216,7 +216,7 @@ opaque
216216
(yes p) -, V-Role p (proj₂ FFD.FFD-Send-total)
217217
(no ¬p) -, No-V-Role ¬p
218218

219-
V-Role-total' : ∃[ ffds ] s -⟦V-Role⟧⇀ addUpkeep record s { FFDState = ffds } V-Role
219+
V-Role-total' : ∃[ ffds ] s -⟦V-Role⟧⇀ addUpkeep record s { FFDState = ffds } VT-Role
220220
V-Role-total' {s = s} = let open LeiosState s in case Dec-canProduceV of λ where
221221
(yes p) -, V-Role p (proj₂ FFD.FFD-Send-total)
222222
(no ¬p) -, No-V-Role ¬p

formal-spec/Leios/Trace/Decidable.agda

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@ module _ {s : LeiosState} (let open LeiosState s renaming (FFDState to ffds; Bas
5353
let EBs' = filter (allIBRefsKnown s) $ filter (_∈ᴮ slice L slot 1) EBs
5454
votes = map (vote sk-V ∘ hash) EBs'
5555
in
56-
{ _ : auto∶ needsUpkeep V-Role }
56+
{ _ : auto∶ needsUpkeep VT-Role }
5757
{ _ : auto∶ canProduceV slot sk-V (stake s) }
5858
{ _ : auto∶ ffds FFD.-⟦ FFD.Send (GenFFD.vHeader votes) nothing / FFD.SendRes ⟧⇀ ffds' }
5959
─────────────────────────────────────────────────────────────────────────
60-
s ↝ addUpkeep record s { FFDState = ffds' } V-Role
60+
s ↝ addUpkeep record s { FFDState = ffds' } VT-Role
6161
V-Role? {_} {p} {q} {r} = VT-Role (toWitness p) (toWitness q) (toWitness r)
6262

6363
No-V-Role? :
64-
{ _ : auto∶ needsUpkeep V-Role }
64+
{ _ : auto∶ needsUpkeep VT-Role }
6565
{ _ : auto∶ ¬ canProduceV slot sk-V (stake s) }
6666
─────────────────────────────────────────────
67-
s ↝ addUpkeep s V-Role
67+
s ↝ addUpkeep s VT-Role
6868
No-V-Role? {p} {q} = No-VT-Role (toWitness p) (toWitness q)
6969

7070
{-

formal-spec/Leios/Trace/Verifier.agda

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ data ValidAction : Action → LeiosState → LeiosInput → Type where
4848
EBs' = filter (allIBRefsKnown s) $ filter (_∈ᴮ slice L slot 1) EBs
4949
votes = map (vote sk-V ∘ hash) EBs'
5050
ffds' = proj₁ (send-total {ffds} {vHeader votes} {nothing})
51-
in .(needsUpkeep V-Role)
51+
in .(needsUpkeep VT-Role)
5252
.(canProduceV slot sk-V (stake s))
5353
.(ffds FFD.-⟦ FFD.Send (vHeader votes) nothing / FFD.SendRes ⟧⇀ ffds')
5454
ValidAction VT-Role-Action s SLOT
@@ -64,7 +64,7 @@ data ValidAction : Action → LeiosState → LeiosInput → Type where
6464
ValidAction No-EB-Role-Action s SLOT
6565

6666
No-VT-Role : let open LeiosState s
67-
in needsUpkeep V-Role
67+
in needsUpkeep VT-Role
6868
(¬ canProduceV slot sk-V (stake s))
6969
ValidAction No-VT-Role-Action s SLOT
7070

@@ -113,12 +113,12 @@ private variable
113113
EBs' = filter (allIBRefsKnown s) $ filter (_∈ᴮ slice L slot 1) EBs
114114
votes = map (vote sk-V ∘ hash) EBs'
115115
ffds' = proj₁ (send-total {ffds} {vHeader votes} {nothing})
116-
in addUpkeep record s { FFDState = ffds' } V-Role , EMPTY
116+
in addUpkeep record s { FFDState = ffds' } VT-Role , EMPTY
117117
⟦ No-IB-Role {s} _ _ ⟧ = addUpkeep s IB-Role , EMPTY
118118
⟦ No-EB-Role {s} _ _ ⟧ = addUpkeep s EB-Role , EMPTY
119-
⟦ No-VT-Role {s} _ _ ⟧ = addUpkeep s V-Role , EMPTY
119+
⟦ No-VT-Role {s} _ _ ⟧ = addUpkeep s VT-Role , EMPTY
120120
⟦ Slot {s} _ _ _ ⟧ =
121-
let open LeiosState s renaming (FFDState to ffds; BaseState to bs)
121+
let open LeiosState s renaming (FFDState to ffds)
122122
(msgs , (ffds' , _)) = fetch-total {ffds}
123123
in
124124
(record s
@@ -277,10 +277,24 @@ private
277277
opaque
278278
unfolding List-Model
279279

280-
test : Bool
281-
test = ¿ ValidTrace ((IB-Role-Action , SLOT) ∷ []) ¿ᵇ
280+
test₁ : Bool
281+
test₁ = ¿ ValidTrace ((IB-Role-Action , SLOT) ∷ []) ¿ᵇ
282+
283+
_ : test₁ ≡ true
284+
_ = refl
282285

283-
_ : test ≡ true
286+
test₂ : Bool
287+
test₂ =
288+
let t = L.reverse $
289+
(IB-Role-Action , SLOT)
290+
∷ (EB-Role-Action , SLOT)
291+
∷ (VT-Role-Action , SLOT)
292+
∷ (Base₂b-Action , SLOT)
293+
∷ (Slot-Action , SLOT)
294+
∷ []
295+
in ¿ ValidTrace t ¿ᵇ
296+
297+
_ : test₂ ≡ true
284298
_ = refl
285299

286300
getLabel : just s -⟦ i / o ⟧⇀ s′ Action

0 commit comments

Comments
 (0)