Browse Source

Start constructing world.

gas-move-test
Thomas Kerber 11 months ago
parent
commit
85e9f09f32
Signed by: Thomas Kerber <t.kerber@ed.ac.uk> GPG Key ID: 8489B911F9ED617B
4 changed files with 53 additions and 0 deletions
  1. 1
    0
      Yggdrasil.agda
  2. 9
    0
      Yggdrasil/List.agda
  3. 41
    0
      Yggdrasil/World.agda
  4. 2
    0
      yggdrasil.agda-lib

+ 1
- 0
Yggdrasil.agda View File

@@ -0,0 +1 @@
module Yggdrasil where

+ 9
- 0
Yggdrasil/List.agda View File

@@ -0,0 +1,9 @@
module Yggdrasil.List where

open import Data.List using (List; _∷_)
open import Level using (Level)

data _∈_ {ℓ : Level} {A : Set ℓ} : A → List A → Set ℓ where
--here : {x : A} {xs : List A} → (x ∷ xs) ∈ x
--there : {x y : A} {xs : List A} → xs ∈ y → (x ∷ xs) ∈ y


+ 41
- 0
Yggdrasil/World.agda View File

@@ -0,0 +1,41 @@
module Yggdrasil.World where

open import Data.List using (List; _∷_; []; map)
open import Data.Product using (_×_)
open import Level using (Level; suc)
open import Yggdrasil.List using (_∈_)

record WorldType (ℓ : Level) : Set (suc ℓ)
data Action {ℓ : Level} : (WorldType ℓ) → Set ℓ → Set (suc ℓ)

record Call (ℓ : Level) (Σ : Set ℓ) (Γ : List (WorldType ℓ)) : Set (suc ℓ) where
field
A : Set ℓ
B : A → Set ℓ
δ : Σ → (x : A) → Σ × B x

record WorldType ℓ where
inductive
field
root : Set ℓ
children : List (WorldType ℓ)
adv : List (Call ℓ root children)
hon : List (Call ℓ root children)

open WorldType

data Action {ℓ} where
abort : ∀ {W A} → Action W A
pure : ∀ {W A} → A → Action W A
call : ∀ {W f} → f ∈ (hon W) → (x : Call.A f) → Action W (Call.B f x)

data WorldState {ℓ : Level} : WorldType ℓ → Set (suc ℓ)
data WorldStates {ℓ : Level} : List (WorldType ℓ) → Set (suc ℓ)

data WorldStates {ℓ} where
[] : WorldStates []
_∷_ : {W : WorldType ℓ} {Ws : List (WorldType ℓ)} → WorldState W →
WorldStates Ws → WorldStates (W ∷ Ws)

data WorldState {ℓ} where
node : {T : WorldType ℓ} → root T → WorldStates (children T) → WorldState T

+ 2
- 0
yggdrasil.agda-lib View File

@@ -0,0 +1,2 @@
depend: standard-library
include: .

Loading…
Cancel
Save