This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Polarized lambda calculus to A-normal form | |
-- With eta-expansion and call-saturation | |
type Ix = Int | |
type Lvl = Int | |
data Ty = TInt | |
deriving (Show) | |
data TFun = TFun [Ty] Ty | |
deriving (Show) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE PatternSynonyms #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
import Data.String (IsString(..)) | |
type Ix = Int | |
type Lvl = Int | |
type ULvl = Int | |
data Sort = Type ULvl | Prop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS --type-in-type #-} | |
open import Agda.Builtin.Unit | |
open import Agda.Builtin.Sigma | |
open import Agda.Builtin.Equality | |
open import Data.Product | |
data IxCtx : Set where | |
Nil : IxCtx | |
Cons : Set -> IxCtx -> IxCtx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS --type-in-type #-} | |
open import Agda.Builtin.Unit | |
open import Agda.Builtin.Sigma | |
open import Agda.Builtin.Equality | |
open import Data.Product | |
data Ind (I : Set) : Set where | |
U : I -> Ind I | |
Pi : (A : Set) -> (A -> Ind I) -> Ind I |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS --type-in-type #-} | |
open import Agda.Builtin.Unit | |
open import Agda.Builtin.Sigma | |
open import Data.Product | |
data Ix : Set where | |
U : Ix | |
Pi : (A : Set) -> (A -> Ix) -> Ix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS --type-in-type #-} | |
open import Agda.Builtin.Unit | |
open import Agda.Builtin.Sigma | |
open import Data.Product | |
data Ty : Set where | |
U : Ty | |
Pi : (A : Set) -> (A -> Ty) -> Ty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS --type-in-type #-} | |
open import Agda.Builtin.Unit | |
open import Agda.Builtin.Sigma | |
open import Data.Product | |
record Ty : Set where | |
instance constructor U | |
data Ctx : Set where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS --type-in-type #-} | |
open import Agda.Builtin.Unit | |
open import Agda.Builtin.Sigma | |
open import Data.Product | |
data Ind : Set where | |
U : Ind | |
Pi : (A : Set) -> (A -> Ind) -> Ind |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS --type-in-type #-} | |
open import Agda.Builtin.Unit | |
open import Agda.Builtin.Sigma | |
open import Data.Product | |
data Ty : Set where | |
U : Ty | |
Pi : (A : Set) -> (A -> Ty) -> Ty | |
PiInd : Ty -> Ty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- universe polymorphism | |
module UnivPoly where | |
-- core language | |
type Ix = Int | |
data Term | |
= Var Ix | |
| Abs Term | |
| App Term Term |
NewerOlder