GCD: Termination example #
As an example of proving termination, we define the function hcf
that computes the greatest common divisor of two natural numbers. We prove that hcf
terminates by showing that the argument decreases in each recursive call.
@[irreducible]
The function hcf
computes the greatest common divisor of two natural numbers. We have to prove that it terminates.
Equations
Instances For
We cannot always make partial definitions.