Agda-2.6.1: A dependently typed functional programming language and proof assistant

Agda.TypeChecking.CheckInternal

Description

A bidirectional type checker for internal syntax.

Performs checking on unreduced terms. With the exception that projection-like function applications have to be reduced since they break bidirectionality.

Synopsis

# Documentation

checkType :: MonadCheckInternal m => Type -> m () Source #

Entry point for e.g. checking WithFunctionType.

Check a type and infer its sort.

Necessary because of PTS rule (SizeUniv, Set i, Set i) but SizeUniv is not included in any Set i.

This algorithm follows Abel, Coquand, Dybjer, MPC 08, Verifying a Semantic βη-Conversion Test for Martin-Löf Type Theory

checkSort :: MonadCheckInternal m => Action m -> Sort -> m Sort Source #

Check if sort is well-formed.

checkInternal :: MonadCheckInternal m => Term -> Comparison -> Type -> m () Source #

Entry point for term checking.

data Action m Source #

checkInternal traverses the whole Term, and we can use this traversal to modify the term.

Constructors

 Action FieldspreAction :: Type -> Term -> m TermCalled on each subterm before the checker runs.postAction :: Type -> Term -> m TermCalled on each subterm after the type checking.relevanceAction :: Relevance -> Relevance -> RelevanceCalled for each ArgInfo. The first Relevance is from the type, the second from the term.

The default action is to not change the Term at all.

infer :: MonadCheckInternal m => Term -> m Type Source #

Infer type of a neutral term.

Compute the sort of a type.