term-rewriting-0.1.2: Term Rewriting Library

Safe HaskellNone

Data.Rewriting.Rules.Ops

Contents

Synopsis

Operations on Rules

funs :: [Rule f v] -> [f]Source

Lifting of Term.funs to list of rules.

funsDL :: [Rule f v] -> [f] -> [f]Source

Difference List version of funs. We have funsDL r vs = funs r ++ vs.

vars :: [Rule f v] -> [v]Source

Lifting of Term.vars to list of rules.

varsDL :: [Rule f v] -> [v] -> [v]Source

Difference List version of vars. We have varsDL r vs = vars r ++ vs.

lhss :: [Rule f v] -> [Term f v]Source

lhss rs returns the list of left-hand sides of rs

rhss :: [Rule f v] -> [Term f v]Source

lhss rs returns the list of right-hand sides of rs

restrictFuns :: (f -> Bool) -> [Rule f v] -> [Rule f v]Source

Restrict the rules to those only using function symbols satisfying the given predicate.

Predicates on Rules

isLinear :: Ord v => [Rule f v] -> BoolSource

Returns True iff all given rules satisfy isLinear

isLeftLinear :: Ord v => [Rule f v] -> BoolSource

Returns True iff all given rules satisfy isLeftLinear

isRightLinear :: Ord v => [Rule f v] -> BoolSource

Returns True iff all given rules satisfy isRightLinear

isGround :: [Rule f v] -> BoolSource

Returns True iff all given rules satisfy isGroundLinear

isLeftGround :: [Rule f v] -> BoolSource

Returns True iff all given rules satisfy isLeftGround

isRightGround :: [Rule f v] -> BoolSource

Returns True iff all given rules satisfy isRightGround

isErasing :: Ord v => [Rule f v] -> BoolSource

Returns True iff any of the given rules satisfy isErasing

isCreating :: Ord v => [Rule f v] -> BoolSource

Returns True iff any of the given rules satisfy isCreating

isDuplicating :: Ord v => [Rule f v] -> BoolSource

Returns True iff any of the given rules satisfy isDuplicating

isCollapsing :: [Rule f v] -> BoolSource

Returns True iff any of the given rules satisfy isCollapsing

isValid :: Ord v => [Rule f v] -> BoolSource

Returns True iff all rules satisfy isValid