Skip to content

Instantly share code, notes, and snippets.

@larrytheliquid
Created October 13, 2012 23:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larrytheliquid/3886590 to your computer and use it in GitHub Desktop.
Save larrytheliquid/3886590 to your computer and use it in GitHub Desktop.
inductive-recursive universe for dependent types
module IRDTT where
open import Level
open import Data.Product public using ( Σ ; _,_ ; proj₁ ; proj₂ )
open import Data.Sum public using ( _⊎_ ; inj₁ ; inj₂ )
record ⊤ {a} : Set a where
constructor tt
data Type {a} : Set (suc a)
⟦_⟧ : ∀{a} → Type {a} → Set a
data Type {a} where
`[_] : Set a → Type
`⊤ : Type
_`⊎_ : (τ τ′ : Type) → Type
`Σ `Π : (τ : Type) (τ′ : ⟦ τ ⟧ → Type) → Type
⟦ `[ A ] ⟧ = A
⟦ `⊤ ⟧ = ⊤
⟦ τ `⊎ τ′ ⟧ = ⟦ τ ⟧ ⊎ ⟦ τ′ ⟧
⟦ `Σ τ τ′ ⟧ = Σ ⟦ τ ⟧ λ ρ → ⟦ τ′ ρ ⟧
⟦ `Π τ τ′ ⟧ = (ρ : ⟦ τ ⟧) → ⟦ τ′ ρ ⟧
Id : Type
Id = `Π `[ Set ] λ A → `Π `[ Lift A ] λ _ → `[ Lift A ]
id : ⟦ Id ⟧
id A x = x
{-
⟦ Id ⟧ = (A : Set) → Lift A → Lift A
can we make it (A : Set) → A → A ?
-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment