 |
|
| |
|
 |
 |
at Global Oneness Community.
Share your dreams and let others help you with the interpretation!
Dream Sharing Forum
|
 |
Fixed point combinator - Example |  | Fixed point combinator - Example: Encyclopedia II - Fixed point combinator - Example |  | Consider the factorial function (under Church encoding). The usual recursive mathematical equation is
fact(n) = if n=0 then 1 else n * fact(n-1)
We can express a "single step" of this recursion in lambda calculus as
F = λf. λx. (ISZERO x) 1 (MULT x (f (PRED x))),
where "f" is a place-holder argument for the factorial function to be passed to itself. The function F performs a single step in the evaluation of the recursive formula. A ...
See also:Fixed point combinator, Fixed point combinator - Existence of fixed point combinators, Fixed point combinator - Example, Fixed point combinator - Other fixed point combinators |  | | Fixed point combinator, Fixed point combinator - Example, Fixed point combinator - Existence of fixed point combinators, Fixed point combinator - Other fixed point combinators, combinatory logic, untyped lambda calculus, typed lambda calculus, anonymous recursion |  | |
|  |  | Fixed point combinator: Encyclopedia II - Fixed point combinator - Example
Fixed point combinator - Example
Consider the factorial function (under Church encoding). The usual recursive mathematical equation is
fact(n) = if n=0 then 1 else n * fact(n-1)
We can express a "single step" of this recursion in lambda calculus as
F = λf. λx. (ISZERO x) 1 (MULT x (f (PRED x))),
where "f" is a place-holder argument for the factorial function to be passed to itself. The function F performs a single step in the evaluation of the recursive formula. Applying the fix operator gives
fix(F)(n) = F(fix(F))(n)
fix(F)(n) = λx. (ISZERO x) 1 (MULT x (fix(F) (PRED x)))(n)
fix(F)(n) = (ISZERO n) 1 (MULT n (fix(F) (PRED n)))
We can abbreviate fix(F) as fact, and we have
fact(n) = (ISZERO n) 1 (MULT n (fact(PRED n)))
So we see that a fixed-point operator really does turn our non-recursive "factorial step" function into a recursive function satisfying the intended equation.
Other related archivesAlan Turing, Church encoding, Haskell B. Curry, SKI-calculus, Standard ML, anonymous recursion, applicative-order, call-by-name, call-by-value, combinatorial calculus, combinatory logic, example, fixed point, higher-order function, lambda abstractions, recursive functions, recursive types, simply typed lambda calculus, typed lambda calculus, untyped lambda calculus, η-expansion
 Adapted from the Wikipedia article "Example", under the G.N U Free Docmentation License. Please also see http://en.wikipedia.org/wiki |
|
|
More material related to Fixed Point Combinator can be found here:
|
|
« Back
|
Search the Global Oneness web site |
|
|
|
|
 |
Sneak-Peek of Global Oneness Community
Hi friend! The Global Oneness Community, the place for information and sharing about Oneness is not really launched yet (you will see there is still some clean up to do) ...but it is now open for a sneak-peek! And if you wish - please register and become one of the very first members to do so! Jonas
Forum Home,
Articles,
Photo Gallery,
Videos,
News,
Sitemap
...and much more!
|