Safe Haskell | None |
---|---|

Language | Haskell98 |

## Synopsis

- funs :: Rule f v -> [f]
- funsDL :: Rule f v -> [f] -> [f]
- vars :: Rule f v -> [v]
- varsDL :: Rule f v -> [v] -> [v]
- left :: (Term f v -> a) -> Rule f v -> a
- right :: (Term f v -> a) -> Rule f v -> a
- rename :: (v -> v') -> Rule f v -> Rule f v'
- both :: (Term f v -> Bool) -> Rule f v -> Bool
- isLinear :: Ord v => Rule f v -> Bool
- isLeftLinear :: Ord v => Rule f v -> Bool
- isRightLinear :: Ord v => Rule f v -> Bool
- isGround :: Rule f v -> Bool
- isLeftGround :: Rule f v -> Bool
- isRightGround :: Rule f v -> Bool
- isErasing :: Ord v => Rule f v -> Bool
- isCreating :: Ord v => Rule f v -> Bool
- isDuplicating :: Ord v => Rule f v -> Bool
- isCollapsing :: Rule f v -> Bool
- isExpanding :: Rule f v -> Bool
- isValid :: Ord v => Rule f v -> Bool
- isInstanceOf :: (Eq f, Ord v, Ord v') => Rule f v -> Rule f v' -> Bool
- isVariantOf :: (Eq f, Ord v, Ord v') => Rule f v -> Rule f v' -> Bool

# Operations on Rules

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

Difference List version of `funs`

.
We have `funsDL r vs = funs r ++ vs`

.

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

Difference List version of `vars`

.
We have `varsDL r vs = vars r ++ vs`

.

# Predicates on Rules

both :: (Term f v -> Bool) -> Rule f v -> Bool Source #

Test whether the given predicate is true for both sides of a rule.

isLinear :: Ord v => Rule f v -> Bool Source #

Check whether both sides of the given rule are linear.

isLeftLinear :: Ord v => Rule f v -> Bool Source #

Check whether the left hand side of the given rule is linear.

isRightLinear :: Ord v => Rule f v -> Bool Source #

Check whether the right hand side of the given rule is linear.

isGround :: Rule f v -> Bool Source #

Check whether both sides of the given rule is are ground terms.

isLeftGround :: Rule f v -> Bool Source #

Check whether the left hand side of the given rule is a ground term.

isRightGround :: Rule f v -> Bool Source #

Check whether the right hand side of the given rule is a ground term.

isErasing :: Ord v => Rule f v -> Bool Source #

Check whether the given rule is erasing, i.e., if some variable occurs in the left hand side but not in the right hand side.

isDuplicating :: Ord v => Rule f v -> Bool Source #

Check whether the given rule is duplicating, i.e., if some variable occurs more often in its right hand side than in its left hand side.

isCollapsing :: Rule f v -> Bool Source #

Check whether the given rule is collapsing, i.e., if its right hand side is a variable.

isExpanding :: Rule f v -> Bool Source #

Check whether the given rule is expanding, i.e., if its left hand sides is a variable.

This is the dual of `isCollapsing`

. The term *expanding* is non-standard.
Expanding rules are usually forbidden. See also `isValid`

.

isValid :: Ord v => Rule f v -> Bool Source #

Check whether the given rule is non-creating and non-expanding.
See also `isCreating`

and `isExpanding`