algebra-dag-0.1.0.0: Infrastructure for DAG-shaped relational algebra plans

Safe HaskellNone
LanguageHaskell98

Database.Algebra.Rewrite.Traversal

Synopsis

Documentation

preOrder :: Operator o => Rewrite o e (NodeMap p) -> RuleSet o p e -> Rewrite o e Bool Source

Infer properties, then traverse the DAG in preorder fashion and apply the rule set at every node. Properties are re-inferred after every change.

postOrder :: Operator o => Rewrite o e (NodeMap p) -> RuleSet o p e -> Rewrite o e Bool Source

Infer properties, then traverse the DAG in a postorder fashion and apply the rule set at every node. Properties are re-inferred after every change.

applyToAll :: Rewrite o e (NodeMap p) -> RuleSet o p e -> Rewrite o e Bool Source

topologically :: Operator o => Rewrite o e (NodeMap p) -> RuleSet o p e -> Rewrite o e Bool Source

Map a ruleset over the nodes of a DAG in topological order. This function assumes that the structur of the DAG is not changed during the rewrites. Properties are only inferred once.

iteratively :: Rewrite o e Bool -> Rewrite o e Bool Source

Iteratively apply a rewrite, until no further changes occur.

sequenceRewrites :: [Rewrite o e Bool] -> Rewrite o e Bool Source

Sequence a list of rewrites and propagate information about wether one of them applied.