language-pts-0: Pure Type Systems

Safe HaskellNone
LanguageHaskell2010

Language.PTS.Specification

Contents

Synopsis

PTS Specifications

class (Eq s, Show s, Enum s, PrettyPrec s) => Specification s where Source #

Specification of a Pure Type System.

Laws

axiom typeSort = Just typeSortSort

By requiring \(\mathcal{A} \subset \mathcal{S}\times\mathcal{S}\) and \(\mathcal{R} \subset (\mathcal{S}\times\mathcal{S})\times\mathcal{R}\) to be functions, we get uniqueness of types in PTS. (And let's us make bi-directional type-system).

Minimal complete definition

typeSort, typeSortSort, axiom, rule

Methods

typeSort :: s Source #

Sort of types. Usually \(\star\).

\[ \mathit{True} : \mathit{Bool} : \star \]

typeSortSort :: s Source #

Sort of sort of types.

In lambda cube systems we have \(\star : \square\); in \(\lambda^\star\) we have \(\star : \star\).

Note that in STLC, \(\lambda^\to\) we don't have \((\square, \star, -) \in \mathcal{R}\) so we cannot have forAll, \(\forall\).

axiom :: s -> Maybe s Source #

Some sorts have a types. \(\mathcal{A}\).

Just s2 = axiom s1 induces a typing rule

\[ \frac{}{ \Gamma \vdash s_1 \Rightarrow s_2 }\;\mathsf{Axiom} \]

rule :: s -> s -> Maybe s Source #

Rules for products. \(\mathcal{R}\).

Just s3 = rule s1 s2 induces a typing rule

\[ \frac{ \Gamma \vdash \alpha \Leftarrow s_1 \qquad \alpha \Downarrow \alpha' \qquad \Gamma,x:\alpha' \vdash \beta \Leftarrow s_2 }{ \Gamma \vdash \forall x : \alpha.\beta \Rightarrow s_3 }\;\mathsf{Pi} \]

Instances
Specification SystemU Source # 
Instance details

Defined in Language.PTS.Systems

Specification HOL Source # 
Instance details

Defined in Language.PTS.Systems

Specification MartinLof Source # 
Instance details

Defined in Language.PTS.Systems

Specification CoC Source # 
Instance details

Defined in Language.PTS.Systems

Specification HindleyMilner Source # 
Instance details

Defined in Language.PTS.Systems

Specification SystemF Source # 
Instance details

Defined in Language.PTS.Systems

Specification STLC Source # 
Instance details

Defined in Language.PTS.Systems

Specification LambdaStar Source # 
Instance details

Defined in Language.PTS.Systems

specificationDoc :: Specification s => s -> PrettyM Doc Source #

Pretty-print specification

Individual universes.

class Specification s => HasBox s where Source #

Minimal complete definition

box_

Methods

box_ :: s Source #

Instances
HasBox SystemU Source # 
Instance details

Defined in Language.PTS.Systems

Methods

box_ :: SystemU Source #

HasBox HOL Source # 
Instance details

Defined in Language.PTS.Systems

Methods

box_ :: HOL Source #

HasBox MartinLof Source # 
Instance details

Defined in Language.PTS.Systems

HasBox CoC Source # 
Instance details

Defined in Language.PTS.Systems

Methods

box_ :: CoC Source #

HasBox HindleyMilner Source # 
Instance details

Defined in Language.PTS.Systems

HasBox SystemF Source # 
Instance details

Defined in Language.PTS.Systems

Methods

box_ :: SystemF Source #

HasBox STLC Source # 
Instance details

Defined in Language.PTS.Systems

Methods

box_ :: STLC Source #

class HasBox s => HasTriangle s where Source #

Minimal complete definition

triangle_

Methods

triangle_ :: s Source #

Instances
HasTriangle SystemU Source # 
Instance details

Defined in Language.PTS.Systems

HasTriangle HOL Source # 
Instance details

Defined in Language.PTS.Systems

Methods

triangle_ :: HOL Source #

HasTriangle MartinLof Source # 
Instance details

Defined in Language.PTS.Systems