Go backward to Recursive Definitions Go up to Top Go forward to Example |
Recursive function definition
with termination function t(x, y) := y.
*: N x N -> N x * y := if y = 0 then 0 else x + x * (y-1)
Reduction sequence:
2*3 = 2+(2*2) = 2+(2+2*1) = 2+(2+(2+(2*0))) = 2+(2+(2+0)) = 6.
Termination after a finite number of unfoldings.