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

Contents

Description

Operations for working with Lean environments.

Synopsis

Documentation

data Env Source

A Lean environment

data TrustLevel Source

The level of trust associated with an environment.

trustHigh :: TrustLevel Source

Trust level for all macros implemented in Lean.

Constructing and manipulating environments.

standardEnv :: TrustLevel -> Env Source

Create an empty standard environment with the given trust level.

hottEnv :: TrustLevel -> Env Source

Create an empty hott environment with the given trust level.

envAddUniv :: Name -> Env -> Env Source

Add a new global universe with the given name.

envAddDecl :: CertDecl -> Env -> Env Source

Adding the given certified declaration to the environment.

envReplaceAxiom :: CertDecl -> Env -> Env Source

Replace the axiom that has the name of the given certified declaration with the certified declaration.

This procedure throws an exception if

  • The theorem was certified in an environment which is not an ancestor of the environment.
  • The environment does not contain an axiom with the given name.

Projections

envTrustLevel :: Env -> TrustLevel Source

The trust level of the given environment.

envContainsProofIrrelProp :: Env -> Bool Source

Return true if the given environment has a proof irrelevant Prop such as Type.{0}.

envIsImpredicative :: Env -> Bool Source

Return true iff in the given environment Prop is impredicative.

envContainsDecl :: Env -> Name -> Bool Source

Return true iff the environment contains a declaration with the name.

envLookupDecl :: Name -> Env -> Maybe Decl Source

Lookup the declaration with the given name in the environment.

envContainsUniv :: Env -> Name -> Bool Source

Return true iff the environment contains a global universe with the name.

envIsDescendant :: Env -> Env -> Bool Source

x `envIsDescendant' y return true x is a descendant of y, that is, x was created by adding declarations to y.

Operations

envForget :: Env -> Env Source

Return a new environment, where its "history" has been truncated/forgotten. That is, envForget x envIsDescendant y will return false for any environment y that is not pointer equal to the result envForget x.

envDecls :: Fold Env Decl Source

A fold over the declaration in the environment.

forEnvDecl_ :: Env -> (Decl -> IO ()) -> IO () Source

Run an IO action on each declaration in the environment.

envUnivs :: Fold Env Name Source

Fold over the global universes in the environment.

forEnvUniv_ :: Env -> (Name -> IO ()) -> IO () Source

Run an IO action on each universe in the environment.