square x = x * x |
The role of the computer is to evaluate and display the results of expressions that the programmer forms by composition of various functions, effectively like a sophisticated calculator.
Such expressions are evaluated through a series of reduction steps, for example, using the above function, the following expression:
square 6 |
Would be evaluated as follows:
| (1) |
...finding the result of . The complexity of this expression is set as
then, since the total number of reduction steps required to evaluate this expression is
.
Note that the expression normal form, refers to the form of an expression which
cannot be reduced any further.