Browse Source

Start thinking about security definition.

gas-move-test
Thomas Kerber 6 months ago
parent
commit
1d3de4eac2
Signed by: Thomas Kerber <t.kerber@ed.ac.uk> GPG Key ID: 8489B911F9ED617B
3 changed files with 47 additions and 2 deletions
  1. 0
    1
      Yggdrasil/List.agda
  2. 40
    0
      Yggdrasil/Security.agda
  3. 7
    1
      Yggdrasil/World.agda

+ 0
- 1
Yggdrasil/List.agda View File

@@ -6,4 +6,3 @@ open import Level using (Level)
6 6
 data _∈_ {ℓ : Level} {A : Set ℓ} : A → List A → Set ℓ where
7 7
   here : {x : A} {xs : List A} → x ∈ (x ∷ xs)
8 8
   there : {x y : A} {xs : List A} → y ∈ xs → y ∈ (x ∷ xs)
9
-

+ 40
- 0
Yggdrasil/Security.agda View File

@@ -0,0 +1,40 @@
1
+module Yggdrasil.Security where
2
+
3
+open import Data.List using (map)
4
+open import Data.Product using (_×_; Σ; Σ-syntax; proj₁; proj₂; ∃; ∃-syntax)
5
+open import Level using (Level) renaming (suc to lsuc)
6
+open import Relation.Binary.PropositionalEquality using (_≡_)
7
+open import Yggdrasil.List using (_∈_)
8
+open import Yggdrasil.World using (WorldType; World; Call; Strategy; weaken)
9
+open WorldType
10
+
11
+data Guess {ℓ : Level} : Set ℓ where
12
+  real? ideal? : Guess
13
+
14
+data Outcome : Set where
15
+  ↯ ✔ : Outcome
16
+
17
+record RouterConfig {ℓ : Level} : Set (lsuc ℓ) where
18
+  field
19
+    ref   : Guess {ℓ}
20
+    real  : World ℓ
21
+    ideal : World ℓ
22
+    sim   : Σ[ σ ∈ Set ℓ ] (σ × (∀ {c} → σ → c ∈ adv (proj₁ ideal) →
23
+      σ × (Σ (Call ℓ (node (proj₁ real))) (_∈ adv (proj₁ real)))))
24
+    hon-≡ : map weaken (hon (proj₁ ideal)) ≡ map weaken (hon (proj₁ real))
25
+
26
+open RouterConfig
27
+
28
+router-world-type : ∀ {ℓ} → RouterConfig {ℓ} → WorldType ℓ
29
+router-world-type = ?
30
+
31
+router-world : ∀ {ℓ} → RouterConfig {ℓ} → Guess {ℓ} → World ℓ
32
+router-world = ?
33
+
34
+router-strategy : ∀ {ℓ A} → (rc : RouterConfig {ℓ}) →
35
+  Strategy (proj₁ (ideal rc)) A → Strategy (router-world-type rc) A
36
+router-strategy = ?
37
+
38
+yggdrasil-game : ∀ {ℓ} → (rc : RouterConfig {ℓ}) →
39
+  Strategy (proj₁ (ideal rc)) Guess → Guess {ℓ} → Outcome
40
+yggdrasil-game = ?

+ 7
- 1
Yggdrasil/World.agda View File

@@ -5,7 +5,7 @@ open import Data.Empty using (⊥-elim)
5 5
 open import Data.List using (List; _∷_; []; map)
6 6
 open import Data.Maybe using (Maybe; nothing; just)
7 7
 open import Data.Nat using (ℕ; zero; suc)
8
-open import Data.Product using (_×_; ∃; ∃-syntax) renaming (_,_ to ⟨_,_⟩)
8
+open import Data.Product using (_×_; Σ; ∃; ∃-syntax) renaming (_,_ to ⟨_,_⟩)
9 9
 open import Data.Sum using (_⊎_; inj₁; inj₂)
10 10
 open import Relation.Binary.PropositionalEquality using (_≡_; _≢_; refl)
11 11
 open import Level using (Level) renaming (suc to lsuc)
@@ -43,6 +43,9 @@ record Call (ℓ : Level) (N : Node ℓ) : Set (lsuc ℓ) where
43 43
     B : A → Set ℓ
44 44
     δ : (state N) → (x : A) → (state N) × Action↑ N (B x)
45 45
 
46
+weaken : ∀ {ℓ N} → Call ℓ N → Query ℓ
47
+weaken c = record { A = Call.A c; B = Call.B c }
48
+
46 49
 record WorldType ℓ where
47 50
   inductive
48 51
   field
@@ -84,6 +87,9 @@ data WorldStates {ℓ} where
84 87
 data WorldState {ℓ} Γ where
85 88
   stnode : state (node Γ) → WorldStates (chld (node Γ)) → WorldState Γ
86 89
 
90
+World : (ℓ : Level) → Set (lsuc ℓ)
91
+World ℓ = Σ (WorldType ℓ) WorldState
92
+
87 93
 data _∈↑_ {ℓ : Level} (q : Query ℓ) (Γ : WorldType ℓ) : Set (lsuc ℓ) where
88 94
   path : ∀ {Γ′} → Γ′ ⊑ Γ → q ∈ qry (node Γ′) → q ∈↑ Γ
89 95
 

Loading…
Cancel
Save