-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBound.agda
More file actions
35 lines (27 loc) · 1.07 KB
/
Copy pathBound.agda
File metadata and controls
35 lines (27 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
module STLC.Bound (Type : Set) where
open import STLC.Syntax Type as S hiding (Expr; module Expr)
open import Data.Nat hiding (_≟_)
open import Data.Fin
open import Data.Vec
open import Data.String
open import Relation.Nullary.Decidable
data Expr (n : ℕ) : Set where
var : (k : Fin n) → Expr n
lam : (τ : Type) → Expr (suc n) → Expr n
_·_ : Expr n → Expr n → Expr n
infixl 20 _·_
Binder : ℕ → Set
Binder = Vec Name
data _⊢_↝_ : ∀ {n} → Binder n → S.Expr → Expr n → Set where
var-zero : ∀ {n x} {Γ : Binder n} →
(x ∷ Γ) ⊢ var x ↝ var zero
var-suc : ∀ {n x y k} {Γ : Binder n} {p : False (x ≟ y)} →
Γ ⊢ var x ↝ var k →
(y ∷ Γ) ⊢ var x ↝ var (suc k)
lam : ∀ {n x τ E E′} {Γ : Binder n} →
(x ∷ Γ) ⊢ E ↝ E′ →
Γ ⊢ (lam (x ∶ τ) E) ↝ (lam τ E′)
_·_ : ∀ {n E E′ F F′} {Γ : Binder n} →
Γ ⊢ E ↝ E′ →
Γ ⊢ F ↝ F′ →
Γ ⊢ E · F ↝ E′ · F′