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.Decl

Contents

Description

Operations for working with Lean declarations.

Synopsis

Documentation

newtype Env Source

A Lean environment

Constructors

Env (ForeignPtr Env) 

data Decl Source

A Lean declaration

Constructors

axiom Source

Arguments

:: Name

Name of axiom

-> List Name

Universe parameters

-> Expr

Type of axiom

-> Decl 

Create an axiom.

constant Source

Arguments

:: Name

Name of constant

-> List Name

Universe parameters

-> Expr

Type of constant

-> Decl 

Create a constant.

Constants and axioms in Lean are essentially the same thing.

definition Source

Arguments

:: Name

Name of the definition

-> List Name

Universe parameters for defintion

-> Expr

Type of definition

-> Expr

Value of definition

-> Word32

Definitional height

-> Bool

Flag that indicates if definition should be lazily unfolded

-> Decl 

Create a definition with an explicit definitional height

definitionWith Source

Arguments

:: Env

The environment

-> Name

Name of the definition

-> List Name

Universe parameters for defintion

-> Expr

Type of definition

-> Expr

Value of definition

-> Bool

Flag that indicates if definition should be lazily unfolded

-> Decl 

Create a definition with a definitional height computed from the environment.

The definitional height is computed using information from the environment.

theorem Source

Arguments

:: Name

Name of the theorem

-> List Name

Universe parameters for theorem

-> Expr

Type of the theorem

-> Expr

Proof of the theorem

-> Word32

Definitional height

-> Decl 

Creates a theorem with an explicit definitional height.

Theorems and definitions are essentially the same thing in Lean, except in the way the normalizer treats them. The normalizer will only unfold theroem if there is nothing else to be done when checking whether two terms are definitionally equal or not.

theoremWith Source

Arguments

:: Env

The environment

-> Name

The name of the theorem

-> List Name

Universe parameters for theorem

-> Expr

Type of the theorem

-> Expr

Proof of the theorem

-> Decl 

theoremWith creates a theorem that is relative to an environment.

Theorems and definitions are essentially the same thing in Lean, except in the way the normalizer treats them. The normalizer will only unfold theroem if there is nothing else to be done when checking whether two terms are definitionally equal or not.

The definitional height is computed from environment.

Projections

declName :: Decl -> Name Source

The name of a declaration.

declUnivParams :: Decl -> List Name Source

The list of universe params for a declaration.

declType :: Decl -> Expr Source

The type of a declaration.

data DeclView Source

Information about a declaration

Constructors

Constant

A constant

Axiom

An axiom

Definition Expr Word32 Bool

A definition with the associated value, definitional height, and whether to lazy unfold it.

Theorem Expr Word32

A theorem with the associated value and definitional height.

declView :: Decl -> DeclView Source

Return information about a declaration.

Certified declarations

data CertDecl Source

A Lean certified declaration

check :: Env -> Decl -> CertDecl Source

Creates a cerified declaration by type checking it within a given environment.