hegg-0.3.0.0: Fast equality saturation in Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Equality.Graph.Nodes

Description

Module defining e-nodes (ENode), the e-node function symbol (Operator), and mappings from e-nodes (NodeMap).

Synopsis

E-node

newtype ENode l Source #

An e-node is a function symbol paired with a list of children e-classes.

We define an e-node to be the base functor of some recursive data type parametrized over ClassId, i.e. all recursive fields are rather e-class ids.

Constructors

Node 

Fields

Instances

Instances details
Show1 l => Show (ENode l) Source # 
Instance details

Defined in Data.Equality.Graph.Nodes

Methods

showsPrec :: Int -> ENode l -> ShowS #

show :: ENode l -> String #

showList :: [ENode l] -> ShowS #

Eq1 l => Eq (ENode l) Source # 
Instance details

Defined in Data.Equality.Graph.Nodes

Methods

(==) :: ENode l -> ENode l -> Bool #

(/=) :: ENode l -> ENode l -> Bool #

Ord1 l => Ord (ENode l) Source # 
Instance details

Defined in Data.Equality.Graph.Nodes

Methods

compare :: ENode l -> ENode l -> Ordering #

(<) :: ENode l -> ENode l -> Bool #

(<=) :: ENode l -> ENode l -> Bool #

(>) :: ENode l -> ENode l -> Bool #

(>=) :: ENode l -> ENode l -> Bool #

max :: ENode l -> ENode l -> ENode l #

min :: ENode l -> ENode l -> ENode l #

children :: Traversable l => ENode l -> [ClassId] Source #

Get the children e-class ids of an e-node

Operator

newtype Operator l Source #

An operator is solely the function symbol part of the e-node. Basically, this means children e-classes are ignored.

Constructors

Operator 

Fields

Instances

Instances details
Show1 l => Show (Operator l) Source # 
Instance details

Defined in Data.Equality.Graph.Nodes

Methods

showsPrec :: Int -> Operator l -> ShowS #

show :: Operator l -> String #

showList :: [Operator l] -> ShowS #

Eq1 l => Eq (Operator l) Source # 
Instance details

Defined in Data.Equality.Graph.Nodes

Methods

(==) :: Operator l -> Operator l -> Bool #

(/=) :: Operator l -> Operator l -> Bool #

Ord1 l => Ord (Operator l) Source # 
Instance details

Defined in Data.Equality.Graph.Nodes

Methods

compare :: Operator l -> Operator l -> Ordering #

(<) :: Operator l -> Operator l -> Bool #

(<=) :: Operator l -> Operator l -> Bool #

(>) :: Operator l -> Operator l -> Bool #

(>=) :: Operator l -> Operator l -> Bool #

max :: Operator l -> Operator l -> Operator l #

min :: Operator l -> Operator l -> Operator l #

operator :: Traversable l => ENode l -> Operator l Source #

Get the operator (function symbol) of an e-node

Node Map

newtype NodeMap (l :: Type -> Type) a Source #

A mapping from e-nodes of l to a

Constructors

NodeMap 

Fields

Instances

Instances details
Foldable (NodeMap l) Source # 
Instance details

Defined in Data.Equality.Graph.Nodes

Methods

fold :: Monoid m => NodeMap l m -> m #

foldMap :: Monoid m => (a -> m) -> NodeMap l a -> m #

foldMap' :: Monoid m => (a -> m) -> NodeMap l a -> m #

foldr :: (a -> b -> b) -> b -> NodeMap l a -> b #

foldr' :: (a -> b -> b) -> b -> NodeMap l a -> b #

foldl :: (b -> a -> b) -> b -> NodeMap l a -> b #

foldl' :: (b -> a -> b) -> b -> NodeMap l a -> b #

foldr1 :: (a -> a -> a) -> NodeMap l a -> a #

foldl1 :: (a -> a -> a) -> NodeMap l a -> a #

toList :: NodeMap l a -> [a] #

null :: NodeMap l a -> Bool #

length :: NodeMap l a -> Int #

elem :: Eq a => a -> NodeMap l a -> Bool #

maximum :: Ord a => NodeMap l a -> a #

minimum :: Ord a => NodeMap l a -> a #

sum :: Num a => NodeMap l a -> a #

product :: Num a => NodeMap l a -> a #

Traversable (NodeMap l) Source # 
Instance details

Defined in Data.Equality.Graph.Nodes

Methods

traverse :: Applicative f => (a -> f b) -> NodeMap l a -> f (NodeMap l b) #

sequenceA :: Applicative f => NodeMap l (f a) -> f (NodeMap l a) #

mapM :: Monad m => (a -> m b) -> NodeMap l a -> m (NodeMap l b) #

sequence :: Monad m => NodeMap l (m a) -> m (NodeMap l a) #

Functor (NodeMap l) Source # 
Instance details

Defined in Data.Equality.Graph.Nodes

Methods

fmap :: (a -> b) -> NodeMap l a -> NodeMap l b #

(<$) :: a -> NodeMap l b -> NodeMap l a #

Ord1 l => Monoid (NodeMap l a) Source # 
Instance details

Defined in Data.Equality.Graph.Nodes

Methods

mempty :: NodeMap l a #

mappend :: NodeMap l a -> NodeMap l a -> NodeMap l a #

mconcat :: [NodeMap l a] -> NodeMap l a #

Ord1 l => Semigroup (NodeMap l a) Source # 
Instance details

Defined in Data.Equality.Graph.Nodes

Methods

(<>) :: NodeMap l a -> NodeMap l a -> NodeMap l a #

sconcat :: NonEmpty (NodeMap l a) -> NodeMap l a #

stimes :: Integral b => b -> NodeMap l a -> NodeMap l a #

(Show1 l, Show a) => Show (NodeMap l a) Source # 
Instance details

Defined in Data.Equality.Graph.Nodes

Methods

showsPrec :: Int -> NodeMap l a -> ShowS #

show :: NodeMap l a -> String #

showList :: [NodeMap l a] -> ShowS #

insertNM :: Ord1 l => ENode l -> a -> NodeMap l a -> NodeMap l a Source #

Insert a value given an e-node in a NodeMap

lookupNM :: Ord1 l => ENode l -> NodeMap l a -> Maybe a Source #

Lookup an e-node in a NodeMap

deleteNM :: Ord1 l => ENode l -> NodeMap l a -> NodeMap l a Source #

Delete an e-node in a NodeMap

insertLookupNM :: Ord1 l => ENode l -> a -> NodeMap l a -> (Maybe a, NodeMap l a) Source #

Insert a value and lookup by e-node in a NodeMap

foldlWithKeyNM' :: Ord1 l => (b -> ENode l -> a -> b) -> b -> NodeMap l a -> b Source #

foldrWithKeyNM' :: Ord1 l => (ENode l -> a -> b -> b) -> b -> NodeMap l a -> b Source #

sizeNM :: NodeMap l a -> Int Source #

Get the number of entries in a NodeMap.

This operation takes constant time (O(1))

traverseWithKeyNM :: Applicative t => (ENode l -> a -> t b) -> NodeMap l a -> t (NodeMap l b) Source #