Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Clause
- mkClause :: [CoreBndr] -> CoreExpr -> CoreExpr -> Clause
- mkForall :: [CoreBndr] -> Clause -> Clause
- forallQs :: Clause -> [CoreBndr]
- instClause :: MonadCatch m => VarSet -> (Var -> Bool) -> CoreExpr -> Clause -> m Clause
- instsClause :: MonadCatch m => VarSet -> [(Var, CoreExpr)] -> Clause -> m Clause
- discardUniVars :: Clause -> Clause
- freeVarsClause :: Clause -> VarSet
- clauseSyntaxEq :: Clause -> Clause -> Bool
- substClause :: Var -> CoreArg -> Clause -> Clause
- substClauses :: [(Var, CoreArg)] -> Clause -> Clause
- dropBinders :: Clause -> Clause
- redundantDicts :: Clause -> Clause
- newtype LemmaName = LemmaName String
- data Lemma = Lemma {}
- data Proven
- andP :: Proven -> Proven -> Proven
- orP :: Proven -> Proven -> Proven
- data Used
- type Lemmas = Map LemmaName Lemma
- type NamedLemma = (LemmaName, Lemma)
Clause
mkClause :: [CoreBndr] -> CoreExpr -> CoreExpr -> Clause Source
Build a Clause from a list of universally quantified binders and two expressions. If the head of either expression is a lambda expression, it's binder will become a universally quantified binder over both sides. It is assumed the two expressions have the same type.
Ex. mkClause [] (x. foo x) bar === forall x. foo x = bar x mkClause [] (baz y z) (x. foo x x) === forall x. baz y z x = foo x x mkClause [] (x. foo x) (y. bar y) === forall x. foo x = bar x
instClause :: MonadCatch m => VarSet -> (Var -> Bool) -> CoreExpr -> Clause -> m Clause Source
Instantiate one of the universally quantified variables in a Clause
.
Note: assumes implicit ordering of variables, such that substitution happens to the right
as it does in case alternatives. Only first variable that matches predicate is
instantiated.
instsClause :: MonadCatch m => VarSet -> [(Var, CoreExpr)] -> Clause -> m Clause Source
Instantiate a set of universally quantified variables in a Clause
.
It is important that all type variables appear before any value-level variables in the first argument.
discardUniVars :: Clause -> Clause Source
freeVarsClause :: Clause -> VarSet Source
clauseSyntaxEq :: Clause -> Clause -> Bool Source
Syntactic Equality of clauses.
substClause :: Var -> CoreArg -> Clause -> Clause Source
Assumes Var is free in Clause. If not, no substitution will happen, though uniques might be freshened.
dropBinders :: Clause -> Clause Source
redundantDicts :: Clause -> Clause Source
Lemmas
A name for lemmas. Use a newtype so we can tab-complete in shell.
An equality with a proven/used status.
Obligation | this MUST be proven immediately |
UnsafeUsed | used, but can be proven later (only introduced in unsafe shell) |
NotUsed |
type NamedLemma = (LemmaName, Lemma) Source
A LemmaName, Lemma pair.