Copyright | (c) Galois Inc, 2015 |
---|---|
License | Apache-2 |
Maintainer | jhendrix@galois.com, lcasburn@galois.com |
Safe Haskell | Trustworthy |
Language | Haskell98 |
Operations for working with Lean environments.
- data Env
- data TrustLevel
- trustHigh :: TrustLevel
- standardEnv :: TrustLevel -> Env
- hottEnv :: TrustLevel -> Env
- envAddUniv :: Name -> Env -> Env
- envAddDecl :: CertDecl -> Env -> Env
- envReplaceAxiom :: CertDecl -> Env -> Env
- envTrustLevel :: Env -> TrustLevel
- envContainsProofIrrelProp :: Env -> Bool
- envIsImpredicative :: Env -> Bool
- envContainsDecl :: Env -> Name -> Bool
- envLookupDecl :: Name -> Env -> Maybe Decl
- envContainsUniv :: Env -> Name -> Bool
- envIsDescendant :: Env -> Env -> Bool
- envForget :: Env -> Env
- envDecls :: Fold Env Decl
- forEnvDecl_ :: Env -> (Decl -> IO ()) -> IO ()
- envUnivs :: Fold Env Name
- forEnvUniv_ :: Env -> (Name -> IO ()) -> IO ()
Documentation
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 `
return true envIsDescendant'
yx
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
will return false for any environment
envIsDescendant
yy
that is not pointer equal to the result envForget x
.