| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Rzk.Check.Rules
Description
The typing rules: check and infer on raw terms, with types as
values, producing core terms.
The algorithm is Coquand's bidirectional one (/An algorithm for
type-checking dependent types/, 1996), in the form of free-foil-NBE's DependentTypes.Elaborate
(Renata Shakirova and Nikolai Kudasov): a λ is checked against a Π
value by entering its binder with the domain and checking the body
against the codomain at the bound names; an inferred type is compared
with the expected one by subtyping (Rzk.Check.Conversion). The rules
mirror those of Rzk.TypeCheck.Judgements case by case, on values.
The modal constructs and match are not covered yet.
Synopsis
- check :: forall (n :: S). Distinct n => Raw n -> Value n -> Check n (Core n)
- infer :: forall (n :: S). Distinct n => Raw n -> Check n (Core n, Value n)
- inferAs :: forall (n :: S). Distinct n => Value n -> Raw n -> Check n (Core n, Value n)
- checkTopeAgainstContext :: forall (n :: S). Distinct n => String -> Value n -> Check n ()
- contextEntails :: forall (n :: S). Distinct n => Value n -> Check n ()
- ensureTypeAtU :: forall (n :: S). Distinct n => String -> Value n -> Check n ()
- data DomainKind
- classifyType :: forall (n :: S). Distinct n => Scope n -> Context n -> Value n -> DomainKind
- evalM :: forall (n :: S). Distinct n => Core n -> Check n (Value n)
- quoteM :: forall (n :: S). Distinct n => Value n -> Check n (Core n)
- underRawScope :: forall (n :: S) r. Distinct n => TModality -> Value n -> Maybe (Value n) -> ScopedRaw n -> (forall (l :: S). (Distinct l, DExt n l) => Pattern n l -> Raw l -> Check l r) -> Check n r
Documentation
inferAs :: forall (n :: S). Distinct n => Value n -> Raw n -> Check n (Core n, Value n) Source #
Infer a term and compare its type's sort with the expected one.
checkTopeAgainstContext :: forall (n :: S). Distinct n => String -> Value n -> Check n () Source #
Diagnose a recOR guard or a restriction face against the context: a
tope disjoint from a consistent context is vacuous, an error; a tope
that overhangs the context is reported when the option asks.
contextEntails :: forall (n :: S). Distinct n => Value n -> Check n () Source #
The context entails the tope, or the tope mentions a hole and cannot be decided.
ensureTypeAtU :: forall (n :: S). Distinct n => String -> Value n -> Check n () Source #
Reject a universe kind standing where an ordinary type is required.
data DomainKind Source #
The kind of a type standing at U: the universes and the families
into them are U-sorted but are not ordinary types.
Constructors
| DomainType | an ordinary type in |
| DomainCubeUniverse | the universe |
| DomainCubeFamily | a family valued in |
| DomainTopeUniverse | the universe |
| DomainTopeFamily | a tope family over a cube |
| DomainOtherTopeFamily | a tope family over a domain that is not a cube |
| DomainModalTope | a modal cube or tope kind |
Instances
| Show DomainKind Source # | |
Defined in Rzk.Check.Rules Methods showsPrec :: Int -> DomainKind -> ShowS # show :: DomainKind -> String # showList :: [DomainKind] -> ShowS # | |
| Eq DomainKind Source # | |
Defined in Rzk.Check.Rules | |
classifyType :: forall (n :: S). Distinct n => Scope n -> Context n -> Value n -> DomainKind Source #
Classify a type value.