One well-known (and perhaps the simplest) fixed point combinator in the untyped lambda calculus is called the Y combinator. It was discovered by Haskell B. Curry, and is defined as
Y = λf·(λx·f (x x)) (λx·f (x x))
We can see that this function acts as a fixed point combinator by expanding it for an example function g:
Y g = (λf . (λx . f (x x)) (λx . f (x x))) g
Y g = (λx . g (x x)) (λx . g (x x)) (β-reduction of λf - applied main function to g)
Y g = (λy . g (y y)) (λx . g (x x)) (α-conversion - renamed bound variable)
Y g = g ((λx . g (x x)) (λx . g (x x))) (β-reduction of λy - applied left function to right function)
Y g = g (Y g) (definition of Y)
És a kedvenc részem a perhaps the simplest :-) :-) :-)
Ám legalább Curry neve imigyen tudatosul (bennem nemrég tudatosult).
Oh my god
És megmagyarázza!:-)
Y = λf·(λx·f (x x)) (λx·f (x x))
We can see that this function acts as a fixed point combinator by expanding it for an example function g:
Y g = (λf . (λx . f (x x)) (λx . f (x x))) g
Y g = (λx . g (x x)) (λx . g (x x)) (β-reduction of λf - applied main function to g)
Y g = (λy . g (y y)) (λx . g (x x)) (α-conversion - renamed bound variable)
Y g = g ((λx . g (x x)) (λx . g (x x))) (β-reduction of λy - applied left function to right function)
Y g = g (Y g) (definition of Y)
És a kedvenc részem a perhaps the simplest :-) :-) :-)
Ám legalább Curry neve imigyen tudatosul (bennem nemrég tudatosult).