module univTypes.Specification.Typing where open import Data.Nat using (ℕ; zero; suc) renaming (_⊔_ to _⊔ℕ_) open import Relation.Binary.PropositionalEquality using (_≡_) open import Data.Fin using (Fin; zero; suc) open import univTypes.Specification.Syntax open import univTypes.Specification.Substitution open import univTypes.Specification.Conversion infix 4 _⊢_⦂_ _⊢ₗ_ infixl 5 _,_ data Context : ℕ → Set where ∅ : Context zero _,_ : ∀ {n} → Context n → Term n → Context (suc n) lookup : ∀ {n} → Context n → Fin n → Term n lookup (Γ , e) zero = ren wk e lookup (Γ , e) (suc x) = ren wk (lookup Γ x) -- Typing of terms, and well-formedness of level expressions (_⊢ₗ_). data _⊢_⦂_ : ∀ {n} → Context n → Term n → Term n → Set data _⊢ₗ_ : ∀ {n} → Context n → Lvl n → Set data _⊢_⦂_ where ⊢-` : ∀ {n t} {Γ : Context n} (x : Fin n) → lookup Γ x ≡ t -------------- → Γ ⊢ ` x ⦂ t -- Every type is in some Setω l (small types via ⊢-Set