Induction Variable (orphan)
Induction variable or recursive strength reduction replaces a function of some systematically changing variable with a simpler calculation using previous values of the function. In a procedural programming language this would apply to an expression involving a loop variable and in a declarative language it would apply to the argument of a recursive function. For example,
f x = ... (2 ** x) ... (f (x + 1)) ...becomes
f x = f' x 1 where f' x z = ... z ... (f' (x + 1) (2 * z)) ...Here the expensive operation (2 ** x) has been replaced by the cheaper (2 * z) in the recursive function f'. This maintains the invariant that z = 2 ** x for any call to f'.
Read more about this topic: Strength Reduction
Famous quotes containing the words induction and/or variable:
“One might get the impression that I recommend a new methodology which replaces induction by counterinduction and uses a multiplicity of theories, metaphysical views, fairy tales, instead of the customary pair theory/observation. This impression would certainly be mistaken. My intention is not to replace one set of general rules by another such set: my intention is rather to convince the reader that all methodologies, even the most obvious ones, have their limits.”
—Paul Feyerabend (19241994)
“Walked forth to ease my pain
Along the shore of silver streaming Thames,
Whose rutty bank, the which his river hems,
Was painted all with variable flowers,”
—Edmund Spenser (1552?1599)