rzk-0.11.4: An experimental proof assistant for synthetic ∞-categories
Safe HaskellNone
LanguageHaskell2010

Rzk.Check.Conversion

Description

Subtyping and conversion, in the checker's monad.

The library's conversion decides the common case: two values compared in the context's variance. Where it answers no, the checker explains the failure on the heads, with the term whose type is compared where a restriction needs it: a term of an unrestricted type stands at a restricted one when it agrees with each face, and a function does so when its applications do. There is no unification: a mismatch is an error.

Synopsis

Documentation

subtype :: forall (n :: S). Distinct n => Core n -> Value n -> Value n -> Check n () Source #

Check that the actual type of a term is a subtype of the expected type. The arguments are the term, its expected type, and its actual inferred type.

subtypeValues :: forall (n :: S). Distinct n => Value n -> Value n -> Check n () Source #

Check that the second type (actual) is a subtype of the first (expected), with no term at hand.

convertTerms :: forall (n :: S). Distinct n => Value n -> Value n -> Check n () Source #

Two terms are convertible.

convertTypes :: forall (n :: S). Distinct n => Value n -> Value n -> Check n () Source #

Two types are convertible.

holesTolerated :: forall (n :: S). Core n -> Check n Bool Source #

In a lenient hole mode, a term that still carries a hole is work in progress, and a mismatch around it is tolerated.