This type represents a potential single step reduction from any
input. If there is no single step then the return value is the
input together with False. Otherwise, the successor is returned
together with True.

This function tries to match the given rule against the given term
(resp. context in general) at the root. If successful, the function
returns the right hand side of the rule and the matching
substitution.

This function tries to match the rules of the given TRS against
the given term (resp. context in general) at the root. The first
rule in the TRS that matches is then used and the corresponding
right-hand side as well the matching substitution is returned.

This function tries to apply one of the rules in the given TRS at
the root of the given term (resp. context in general) by trying each
rule one by one using appRule until one rule is applicable. If no
rule is applicable Nothing is returned.

This is an auxiliary function that turns function f of type
(t -> Maybe t) into functions f' of type t -> (t,Bool). f' x
evaluates to (y,True) if f x evaluates to Just y, and to
(x,False) if f x evaluates to Nothing. This function is useful
to change the output of functions that apply rules such as appTRS.

This function performs a parallel reduction step by trying to
apply rules of the given system to all outermost redexes and then
recursively in the variable positions of the redexes. If the given
term does not contain any redexes, Nothing is returned.