Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class (Eq s, Show s, Enum s, PrettyPrec s) => Specification s where
- specificationDoc :: Specification s => s -> PrettyM Doc
- star_ :: Specification s => s
- class Specification s => HasBox s where
- class HasBox s => HasTriangle s where
PTS Specifications
class (Eq s, Show s, Enum s, PrettyPrec s) => Specification s where Source #
Specification of a Pure Type System.
Laws
axiom
typeSort
= JusttypeSortSort
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).
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 =
induces a typing ruleaxiom
s1
\[ \frac{}{ \Gamma \vdash s_1 \Rightarrow s_2 }\;\mathsf{Axiom} \]
rule :: s -> s -> Maybe s Source #
Rules for products. \(\mathcal{R}\).
Just s3 =
induces a typing rulerule
s1 s2
\[ \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
specificationDoc :: Specification s => s -> PrettyM Doc Source #
Pretty-print specification
Individual universes.
star_ :: Specification s => s Source #
class Specification s => HasBox s where Source #
Instances
HasBox SystemU Source # | |
Defined in Language.PTS.Systems | |
HasBox HOL Source # | |
Defined in Language.PTS.Systems | |
HasBox MartinLof Source # | |
Defined in Language.PTS.Systems | |
HasBox CoC Source # | |
Defined in Language.PTS.Systems | |
HasBox HindleyMilner Source # | |
Defined in Language.PTS.Systems box_ :: HindleyMilner Source # | |
HasBox SystemF Source # | |
Defined in Language.PTS.Systems | |
HasBox STLC Source # | |
Defined in Language.PTS.Systems |
class HasBox s => HasTriangle s where Source #
Instances
HasTriangle SystemU Source # | |
Defined in Language.PTS.Systems | |
HasTriangle HOL Source # | |
Defined in Language.PTS.Systems | |
HasTriangle MartinLof Source # | |
Defined in Language.PTS.Systems |