Per.Typechecker (per v5.3.21)

Copy Markdown

Core typechecker for the Per language, implementing cubical type theory. Includes evaluation, conversion checking, and type checking.

Summary

Functions

Checks an expression against a type in a given context.

Checks all declarations in a module.

Cubical composition operation.

Checks if two values are convertible (equivalent).

Asserts that two values are convertible, raising an error if not.

Evaluates an expression in a given context.

Evaluates AND formula.

Evaluates OR formula.

Extracts level from Universe or Dir.

Extracts path, u0, and u1 from a PathP type.

Extracts domain and name/codomain from a Pi type.

Helper for Set or Kan types.

Extracts domain and name/codomain from a Sigma type.

Cubical homogeneous composition operation.

Cubical hfill operation.

Identity value constructor.

Maximum of two universe levels.

Implication value constructor (non-dependent Pi).

Infers the type of an expression in a given context.

Infers the type of a value (in empty context).

Negates a formula.

Normalizes a term by evaluating it and then reading it back.

Converts a value back to an AST term (readback/reify).

Cubical transFill operation.

Cubical generalized transport operation.

First projection evaluator.

Second projection evaluator.

Functions

check(ctx, e0, t0)

Checks an expression against a type in a given context.

check_module(module, env)

Checks all declarations in a module.

comp(t, r, u, u0)

Cubical composition operation.

conv(v1, v2)

Checks if two values are convertible (equivalent).

convInd(v1, v2)

eqNf(v1, v2)

Asserts that two values are convertible, raising an error if not.

eval(expr, ctx)

Evaluates an expression in a given context.

evalAnd(v1, v2)

Evaluates AND formula.

evalOr(v1, v2)

Evaluates OR formula.

extKan(v)

Extracts level from Universe or Dir.

extPathP(v)

Extracts path, u0, and u1 from a PathP type.

extPiG(u)

Extracts domain and name/codomain from a Pi type.

extSet_or_Kan(v)

Helper for Set or Kan types.

extSigG(u)

Extracts domain and name/codomain from a Sigma type.

hcomp(t, r, u, u0)

Cubical homogeneous composition operation.

hfill(t, r, u, u0, j)

Cubical hfill operation.

idv(t, x, y)

Identity value constructor.

imax(u, v)

Maximum of two universe levels.

implv(a, b)

Implication value constructor (non-dependent Pi).

infer(ctx, e)

Infers the type of an expression in a given context.

inferV(v)

Infers the type of a value (in empty context).

negFormula(v)

Negates a formula.

normalize(env, term)

Normalizes a term by evaluating it and then reading it back.

readback(val)

Converts a value back to an AST term (readback/reify).

transFill(p, phi, u0, j)

Cubical transFill operation.

transport(p, phi, u0)

Cubical generalized transport operation.

vfst(v)

First projection evaluator.

vsnd(v)

Second projection evaluator.