Reducible expression
From HaskellWiki
(Difference between revisions)
(HaWiki conversion) |
m (Removing archaic wiki syntax) |
||
| Line 1: | Line 1: | ||
| - | A reducible expression (redex | + | A reducible expression (redex for short) is an expression which matches the left-hand-side of some reduction rule or definition. |
For example, given the definitions: | For example, given the definitions: | ||
Current revision
A reducible expression (redex for short) is an expression which matches the left-hand-side of some reduction rule or definition.
For example, given the definitions:
fac 0 = 1 fac n = n * fac (n-1)
fac 3
fac
Operationally, a redex is any expression whose evaluation requires work to be done. For example, a function call with all of its arguments supplied is a redex, but a constant is not. This is useful, for example, in common subexpression elimination, which only saves work if the common subexpression is a redex.
