hermit-1.0.0.0: Haskell Equational Reasoning Model-to-Implementation Tunnel

Safe HaskellNone
LanguageHaskell2010

HERMIT.Lemma

Contents

Synopsis

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.

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.

Lemmas

newtype LemmaName Source

A name for lemmas. Use a newtype so we can tab-complete in shell.

Constructors

LemmaName String 

data Lemma Source

An equality with a proven/used status.

Constructors

Lemma 

Fields

lemmaC :: Clause
 
lemmaP :: Proven
 
lemmaU :: Used
 

data Proven Source

Constructors

Proven 
Assumed

Assumed by user

BuiltIn

Assumed by library/HERMIT

NotProven 

data Used Source

Constructors

Obligation

this MUST be proven immediately

UnsafeUsed

used, but can be proven later (only introduced in unsafe shell)

NotUsed 

Instances

type Lemmas = Map LemmaName Lemma Source

A collection of named lemmas.

type NamedLemma = (LemmaName, Lemma) Source

A LemmaName, Lemma pair.