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
1 change: 1 addition & 0 deletions formal-spec/Leios/Base.agda
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ record BaseAbstract : Type₁ where
_-⟦_/_⟧⇀_ : State → Input → Output → State → Type
⦃ Dec-_-⟦_/_⟧⇀_ ⦄ : {s : State} → {i : Input} → {o : Output} → {s' : State} → (s -⟦ i / o ⟧⇀ s') ⁇
SUBMIT-total : ∀ {s b} → ∃[ s' ] s -⟦ SUBMIT b / EMPTY ⟧⇀ s'
FTCH-total : ∀ {s} → ∃[ r ] (∃[ s' ] (s -⟦ FTCH-LDG / BASE-LDG r ⟧⇀ s'))

open Input public
open Output public
1 change: 1 addition & 0 deletions formal-spec/Leios/Defaults.agda
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ d-BaseFunctionality =
; _-⟦_/_⟧⇀_ = λ _ _ _ _ → ⊤
; Dec-_-⟦_/_⟧⇀_ = ⁇ (yes tt)
; SUBMIT-total = tt , tt
; FTCH-total = [] , tt , tt
}

open import Leios.FFD public
Expand Down
18 changes: 12 additions & 6 deletions formal-spec/Leios/Short/Trace/Verifier.agda
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ data ValidAction : Action → LeiosState → LeiosInput → Type where
ValidAction No-VT-Role-Action s SLOT

Slot : let open LeiosState s renaming (FFDState to ffds; BaseState to bs)
(res , (bs' , _)) = B.FTCH-total {bs}
(msgs , (ffds' , _)) = FFD.Fetch-total {ffds}
in .(allDone s) →
.(bs B.-⟦ B.FTCH-LDG / B.BASE-LDG [] ⟧⇀ tt) →
.(bs B.-⟦ B.FTCH-LDG / B.BASE-LDG res ⟧⇀ bs') →
.(ffds FFD.-⟦ FFD.Fetch / FFD.FetchRes msgs ⟧⇀ ffds') →
ValidAction (Slot-Action slot) s SLOT

Expand Down Expand Up @@ -142,21 +143,26 @@ private variable
⟦ No-EB-Role {s} _ _ ⟧ = addUpkeep s EB-Role , EMPTY
⟦ No-VT-Role {s} _ _ ⟧ = addUpkeep s VT-Role , EMPTY
⟦ Slot {s} _ _ _ ⟧ =
let open LeiosState s renaming (FFDState to ffds)
let open LeiosState s renaming (FFDState to ffds; BaseState to bs)
(res , (bs' , _)) = B.FTCH-total {bs}
(msgs , (ffds' , _)) = FFD.Fetch-total {ffds}
in
(record s
{ FFDState = ffds'
; BaseState = tt
; Ledger = constructLedger []
; BaseState = bs'
; Ledger = constructLedger res
; slot = suc slot
; Upkeep = ∅
} ↑ L.filter (isValid? s) msgs
, EMPTY)
⟦ Ftch {s} ⟧ = s , FTCH-LDG (LeiosState.Ledger s)
⟦ Base₁ {s} {txs} ⟧ = record s { ToPropose = txs } , EMPTY
⟦ Base₂a {s} _ _ _ ⟧ = addUpkeep record s { BaseState = tt } Base , EMPTY
⟦ Base₂b {s} _ _ _ ⟧ = addUpkeep record s { BaseState = tt } Base , EMPTY
⟦ Base₂a {s} {eb} _ _ _ ⟧ =
let (bs' , _) = B.SUBMIT-total {LeiosState.BaseState s} {this eb}
in addUpkeep record s { BaseState = bs' } Base , EMPTY
⟦ Base₂b {s} _ _ _ ⟧ =
let (bs' , _) = B.SUBMIT-total {LeiosState.BaseState s} {that (LeiosState.ToPropose s)}
in addUpkeep record s { BaseState = bs' } Base , EMPTY

open LeiosState
open FFDBuffers
Expand Down