lean-bindings-0.1: Haskell bindings to the Lean Theorem Prover.

Copyright(c) Galois Inc, 2015
LicenseApache-2
Maintainerjhendrix@galois.com, lcasburn@galois.com
Safe HaskellTrustworthy
LanguageHaskell98

Language.Lean.Typechecker

Description

Interface to Lean typechecker

Synopsis

Documentation

data Typechecker Source

A Lean typechecker

data ConstraintSeq Source

A sequence of constraints

typechecker :: Env -> Typechecker Source

Create a type checker object for the given environment.

inferType :: Typechecker -> Expr -> (Expr, ConstraintSeq) Source

inferType t e infers the type of e using t. This returns the type and any constraints generated.

The expression e must not contain any free variables (subexpressions with type ExprVar).

checkType :: Typechecker -> Expr -> (Expr, ConstraintSeq) Source

inferType t e checks and infers the type of e using t. This returns the type and any constraints generated.

The expression e must not contain any free variables (subexpressions with type ExprVar).

whnf :: Typechecker -> Expr -> (Expr, ConstraintSeq) Source

whnf t e computes the weak-head-normal-form of e using t, returning the form and any generated constraints.

The expression e must not contain any free variables (subexpressions with type ExprVar).

isDefEq :: Typechecker -> Expr -> Expr -> (Bool, ConstraintSeq) Source

is_def_eq t e1 e2 returns True iff e1 and e2 are definitionally equal along with any generated constraints.

The expressions e1 and e2 must not contain any free variables (subexpressions with type ExprVar).