language-pts-0: Pure Type Systems

Safe HaskellNone
LanguageHaskell2010

Language.PTS.Systems

Contents

Description

Various type systems as PTS.

This module isn't re-exported by Language.PTS.

Synopsis

Consistent

data STLC Source #

Simply typed lambda calculus, \(\lambda^\to\).

\[ \mathcal{S} = \star, \square \qquad \mathcal{A} = \star : \square \qquad \mathcal{R} = (\star, \star, \star) \]

>>> prettyPut $ specificationDoc STLCStar
𝓢: ⋆, □
𝓐: ⋆ : □
𝓡: (⋆,⋆,⋆)

Constructors

STLCStar 
STLCBox 
Instances
Bounded STLC Source # 
Instance details

Defined in Language.PTS.Systems

Enum STLC Source # 
Instance details

Defined in Language.PTS.Systems

Eq STLC Source # 
Instance details

Defined in Language.PTS.Systems

Methods

(==) :: STLC -> STLC -> Bool Source #

(/=) :: STLC -> STLC -> Bool Source #

Show STLC Source # 
Instance details

Defined in Language.PTS.Systems

PrettyPrec STLC Source # 
Instance details

Defined in Language.PTS.Systems

Methods

ppp :: Prec -> STLC -> PrettyM Doc Source #

HasBox STLC Source # 
Instance details

Defined in Language.PTS.Systems

Methods

box_ :: STLC Source #

Specification STLC Source # 
Instance details

Defined in Language.PTS.Systems

data SystemF Source #

System F, \(\lambda2\).

\[ \mathcal{S} = \star, \square \qquad \mathcal{A} = \star : \square \qquad \mathcal{R} = (\star, \star, \star), (\square, \star, \star) \]

>>> prettyPut $ specificationDoc SysFStar
𝓢: ⋆, □
𝓐: ⋆ : □
𝓡: (⋆,⋆,⋆), (□,⋆,⋆)

Constructors

SysFStar 
SysFBox 

data HindleyMilner Source #

Hindley-Milner as PTS.

HindleyMilner is a truncated MartinLof: with only two universes.

\[ \mathcal{S} = M, P \qquad \mathcal{A} = M : P \qquad \mathcal{R} = (M,M,M), (P,M,P), (P,P,P) \]

>>> prettyPut $ specificationDoc HMMono
𝓢: M, P
𝓐: M : P
𝓡: (M,M,M), (P,M,P), (P,P,P)

Constructors

HMMono 
HMPoly 
Instances
Bounded HindleyMilner Source # 
Instance details

Defined in Language.PTS.Systems

Enum HindleyMilner Source # 
Instance details

Defined in Language.PTS.Systems

Eq HindleyMilner Source # 
Instance details

Defined in Language.PTS.Systems

Show HindleyMilner Source # 
Instance details

Defined in Language.PTS.Systems

PrettyPrec HindleyMilner Source # 
Instance details

Defined in Language.PTS.Systems

HasBox HindleyMilner Source # 
Instance details

Defined in Language.PTS.Systems

Specification HindleyMilner Source # 
Instance details

Defined in Language.PTS.Systems

data CoC Source #

Calculus of Constructions, \(\lambda C\).

\[ \mathcal{S} = \star, \square \qquad \mathcal{A} = \star : \square \qquad \mathcal{R} = (\star, \star, \star), (\square, \star, \star), (\star, \square, \square), (\square, \square, \square) \]

>>> prettyPut $ specificationDoc CoCStar
𝓢: ⋆, □
𝓐: ⋆ : □
𝓡: (⋆,⋆,⋆), (⋆,□,□), (□,⋆,⋆), (□,□,□)

Constructors

CoCStar 
CoCBox 
Instances
Bounded CoC Source # 
Instance details

Defined in Language.PTS.Systems

Enum CoC Source # 
Instance details

Defined in Language.PTS.Systems

Eq CoC Source # 
Instance details

Defined in Language.PTS.Systems

Methods

(==) :: CoC -> CoC -> Bool Source #

(/=) :: CoC -> CoC -> Bool Source #

Show CoC Source # 
Instance details

Defined in Language.PTS.Systems

PrettyPrec CoC Source # 
Instance details

Defined in Language.PTS.Systems

Methods

ppp :: Prec -> CoC -> PrettyM Doc Source #

HasBox CoC Source # 
Instance details

Defined in Language.PTS.Systems

Methods

box_ :: CoC Source #

Specification CoC Source # 
Instance details

Defined in Language.PTS.Systems

newtype MartinLof Source #

Martin-Löf type system.

\[ \mathcal{S} = \mathbb{N} \qquad \mathcal{A} = n : n + 1; n \in \mathbb{N} \qquad \mathcal{R} = (n, m, \max n\, m); n, m \in \mathbb{N} \]

>>> prettyPut $ specificationDoc (star_ :: MartinLof)
𝓢: 𝓤, 𝓤₁, 𝓤₂
𝓐: 𝓤 : 𝓤₁, 𝓤₁ : 𝓤₂, 𝓤₂ : 𝓤₃
𝓡: (𝓤,𝓤,𝓤),
   (𝓤,𝓤₁,𝓤₁),
   (𝓤₁,𝓤,𝓤₁),
   (𝓤₁,𝓤₁,𝓤₁),
   (𝓤,𝓤₂,𝓤₂),
   (𝓤₂,𝓤,𝓤₂),
   (𝓤₁,𝓤₂,𝓤₂),
   (𝓤,𝓤₃,𝓤₃),
   (𝓤₃,𝓤,𝓤₃), ...

Constructors

MartinLof Natural 

data HOL Source #

λHOL

\[ \begin{align} \mathcal{S} &= \star, \square, \triangle \newline \mathcal{A} &= \star : \square, \square : \triangle \newline \mathcal{R} &= (\star, \star, \star), (\square, \star, \star), (\square, \square, \square), (\triangle, \star, \star) \end{align} \]

The $(triangle, star, star)$ is an extension rule.

>>> prettyPut $ specificationDoc HOLStar
𝓢: ⋆, □, △
𝓐: ⋆ : □, □ : △
𝓡: (⋆,⋆,⋆), (□,⋆,⋆), (□,□,□), (△,⋆,⋆)

Constructors

HOLStar 
HOLBox 
HOLTri 
Instances
Bounded HOL Source # 
Instance details

Defined in Language.PTS.Systems

Enum HOL Source # 
Instance details

Defined in Language.PTS.Systems

Eq HOL Source # 
Instance details

Defined in Language.PTS.Systems

Methods

(==) :: HOL -> HOL -> Bool Source #

(/=) :: HOL -> HOL -> Bool Source #

Show HOL Source # 
Instance details

Defined in Language.PTS.Systems

PrettyPrec HOL Source # 
Instance details

Defined in Language.PTS.Systems

Methods

ppp :: Prec -> HOL -> PrettyM Doc Source #

HasTriangle HOL Source # 
Instance details

Defined in Language.PTS.Systems

Methods

triangle_ :: HOL Source #

HasBox HOL Source # 
Instance details

Defined in Language.PTS.Systems

Methods

box_ :: HOL Source #

Specification HOL Source # 
Instance details

Defined in Language.PTS.Systems

Inconsistent

data LambdaStar Source #

\(\lambda^\star\) system.

Inconsistent.

\[ \mathcal{S} = \star \qquad \mathcal{A} = \star : \star \qquad \mathcal{R} = (\star, \star, \star) \]

>>> prettyPut $ specificationDoc LambdaStar
𝓢: ⋆
𝓐: ⋆ : ⋆
𝓡: (⋆,⋆,⋆)

Constructors

LambdaStar 

data SystemU Source #

System U, \(\lambda U\).

Inconsistent.

\[ \begin{align} \mathcal{S} &= \star, \square, \triangle \newline \mathcal{A} &= \star : \square, \square : \triangle \newline \mathcal{R} &= (\star, \star, \star), (\square, \star, \star), (\square, \square, \square), (\triangle, \star, \star), (\triangle, \square, \square) \end{align} \]

>>> prettyPut $ specificationDoc SysUStar
𝓢: ⋆, □, △
𝓐: ⋆ : □, □ : △
𝓡: (⋆,⋆,⋆), (□,⋆,⋆), (□,□,□), (△,⋆,⋆), (△,□,□)

Constructors

SysUStar 
SysUBox 
SysUTri 
Instances
Bounded SystemU Source # 
Instance details

Defined in Language.PTS.Systems

Enum SystemU Source # 
Instance details

Defined in Language.PTS.Systems

Eq SystemU Source # 
Instance details

Defined in Language.PTS.Systems

Show SystemU Source # 
Instance details

Defined in Language.PTS.Systems

PrettyPrec SystemU Source # 
Instance details

Defined in Language.PTS.Systems

Methods

ppp :: Prec -> SystemU -> PrettyM Doc Source #

HasTriangle SystemU Source # 
Instance details

Defined in Language.PTS.Systems

HasBox SystemU Source # 
Instance details

Defined in Language.PTS.Systems

Methods

box_ :: SystemU Source #

Specification SystemU Source # 
Instance details

Defined in Language.PTS.Systems