Fixed point combinatorA fixed point combinator is a function which computes fixed points of other functions. A 'fixed point' of a function is a value left 'fixed' by that function; for example, 0 and 1 are fixed points of the squaring function. In certain formalizations of mathematics, such as the lambda calculus and combinatorial calculus, every function has a fixed point. In these formalizations, it is possible to produce a function, often denoted Y, which computes a fixed point of any function it is given. Since a fixed point x of a function f is a value that has the property f(x) = x, a fixed point combinator Y is a function with the property that f(Y(f)) = Y(f) for all functions f. From a more practical point of view, fixed point combinators allow the definition of anonymous recursive functions. Somewhat surprisingly, they can be defined with non-recursive lambda abstractions. One well-known fixed point combinator, discovered by Haskell B. Curry, is
and can be expressed in the SKI-calculus as
Another common fixed point combinator is the Turing fixed-point combinator (named for its discoverer Alan Turing):
This combinator is of interest because a variation of it can be used with applicative-order reduction:
Fixed point combinators are not especially rare. Here is one constructed by Jan Willem Klop:
ExampleConsider the factorial function. A single step in the recursion of the factorial function is
which is non-recursive. If the factorial function is like a chain (of factors), then the h function above joins two links. Then the factorial function is simply
The fixed point combinator causes the H combinator to repeat itself indefinitely until it trips itself up with (ISZERO 0) = TRUE.
See alsoExternal link
Categories: Computer science | Lambda calculus | Computability |
|
This article is licensed under the GNU Free Documentation License. It uses material from Wikipedia article. Browse Wikipedia for more information. |