twee-lib-2.4.2: An equational theorem prover
Safe HaskellSafe-Inferred
LanguageHaskell2010

Twee.Rule.Index

Synopsis

Documentation

data RuleIndex f a Source #

Constructors

RuleIndex 

Fields

Instances

Instances details
(Labelled f, Show f, Show a) => Show (RuleIndex f a) Source # 
Instance details

Defined in Twee.Rule.Index

Methods

showsPrec :: Int -> RuleIndex f a -> ShowS #

show :: RuleIndex f a -> String #

showList :: [RuleIndex f a] -> ShowS #

insert :: forall f a. (Symbolic a, ConstantOf a ~ f, Has a (Rule f)) => Term f -> a -> RuleIndex f a -> RuleIndex f a Source #

delete :: forall f a. (Symbolic a, ConstantOf a ~ f, Eq a, Has a (Rule f)) => Term f -> a -> RuleIndex f a -> RuleIndex f a Source #

matches :: Term f -> Index f a -> [(Subst f, a)] Source #

Look up a term in the index. Like lookup, but returns the exact value that was inserted into the index, not an instance. Also returns a substitution which when applied to the value gives you the matching instance.

lookup :: (Has a b, Symbolic b, Has b (TermOf b)) => TermOf b -> Index (ConstantOf b) a -> [b] Source #

Look up a term in the index. Finds all key-value such that the search term is an instance of the key, and returns an instance of the the value which makes the search term exactly equal to the key.