This file contains hidden or 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 DataKinds #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE Rank2Types #-} | |
import Data.String (IsString, fromString) | |
import GHC.TypeLits (KnownSymbol, Symbol, someSymbolVal, symbolVal) | |
This file contains hidden or 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 DataKinds #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE Rank2Types #-} | |
-- Naturals. | |
data Nat :: * where | |
Zero :: Nat |
This file contains hidden or 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 GADTs #-} | |
{-# LANGUAGE KindSignatures #-} | |
data Nat :: * where | |
Zero :: Nat | |
Suc :: Nat -> Nat | |
instance Eq Nat where | |
Zero == Zero = True | |
Suc n == Suc n' = n == n' |
This file contains hidden or 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 ScopedTypeVariables #-} | |
data Zero | |
data Suc n | |
type One = Suc Zero | |
type Two = Suc One | |
type Three = Suc Two | |
class Nat n where |
This file contains hidden or 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
module BasicIPC.Syntax.GentzenNormalForm3 where | |
open import BasicIPC.Syntax.GentzenNormalForm public | |
data Re {Γ} : ∀ {A} → Γ ⊢ A → Γ ⊢ A → Set where | |
conglamʳᵉ : ∀ {A B} {t t′ : Γ , A ⊢ B} → | |
Re t t′ → Re (lam t) (lam t′) | |
congappʳᵉ : ∀ {A B} {t t′ : Γ ⊢ A ▻ B} {u u′ : Γ ⊢ A} → |
This file contains hidden or 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
module BasicIPC.Syntax.GentzenWithProofTerms where | |
open import BasicIPC.Syntax.Common public | |
data Tm : Set where | |
VAR : Atom → Tm | |
LAM : Atom → Tm → Tm | |
APP : Tm → Tm → Tm | |
PAIR : Tm → Tm → Tm |
This file contains hidden or 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
module Intuition where | |
open import Data.Empty using (⊥) | |
open import Data.Product using (_,_ ; proj₁ ; proj₂) renaming (_×_ to _∧_) | |
open import Data.Sum using (inj₁ ; inj₂) renaming (_⊎_ to _∨_) | |
open import Relation.Nullary using (¬_) | |
foo : ∀ {a} {A : Set a} → ¬ ¬ (A ∨ ¬ A) | |
foo x = x (inj₂ (λ y → x (inj₁ y))) |
This file contains hidden or 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
module BasicIPC.Syntax.GentzenNormalForm2 where | |
open import BasicIPC.Syntax.GentzenNormalForm public | |
data NfNe⁼ {A Γ} (t : Γ ⊢ A) : Set where | |
nfⁿᶠⁿᵉ⁼ : (t′ : Γ ⊢ⁿᶠ A) → {{_ : nf→tm t′ ≡ t}} → NfNe⁼ t | |
neⁿᶠⁿᵉ⁼ : (t′ : Γ ⊢ⁿᵉ A) → {{_ : ne→tm t′ ≡ t}} → NfNe⁼ t | |
This file contains hidden or 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
module Experiments where | |
open import BasicIS4.Syntax.DyadicGentzen public | |
-- A strict total order on types. | |
mutual | |
infix 3 _<ᵀˣᵀ_ | |
_<ᵀˣᵀ_ : Ty × Ty → Ty × Ty → Set |
This file contains hidden or 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
{- | |
Nordström, B. (1988) “Terminating general recursion” | |
http://dx.doi.org/10.1007/BF01941137 | |
Mu, S-C. (2008) “Well-founded recursion and accessibility” | |
http://www.iis.sinica.edu.tw/~scm/2008/well-founded-recursion-and-accessibility/ | |
-} |