k-combinator

convert flip lambda into SKI terms

百般思念 提交于 2020-01-02 06:58:24
问题 I'm having trouble converting the lambda for flip into the SKI combinators (I hope that makes sense). Here is my conversion: /fxy.fyx /f./x./y.fyx /f./x.S (/y.fy) (/y.x) /f./x.S f (/y.x) /f./x.S f (K x) /f.S (/x.S f) (/x.K x) /f.S (/x.S f) K /f.S (S (/x.S) (/x.f)) K /f.S (S (K S) (K f)) K S (/f.S (S (K S) (K f))) (/f.K) S (/f.S (S (K S) (K f))) (K K) S (S (/f.S) (/f.S (K S) (K f))) (K K) S (S (K S) (/f.S (K S) (K f))) (K K) S (S (K S) (S (/f.S (K S)) (/f.K f))) (K K) S (S (K S) (S (/f.S (K S)

To prove SKK and II are beta equivalent, lambda calculus

浪尽此生 提交于 2019-12-22 10:12:08
问题 I am new to lambda calculus and struggling to prove the following. SKK and II are beta equivalent. where S = lambda xyz.xz(yz) K = lambda xy.x I = lambda x.x I tried to beta reduce SKK by opening it up, but got nowhere, it becomes to messy. Dont think SKK can be reduced further without expanding S, K. 回答1: SKK = (λxyz.xz(yz))KK → λz.Kz(Kz) (in two steps actually, for the two parameters) Kz = (λxy.x)z → λy.z λz.Kz(Kz) → λz.(λy.z)(λy.z) (again, several steps) → λz.z = I (You should be able to

Function signature of Tap (K-combinator)

前提是你 提交于 2019-12-21 21:43:23
问题 I've read in a book that the function signature of tap function (also called K-Combinator) is below: tap :: (a -> *) -> a -> a "This function takes an input object a and a function that performs some action on a. It runs the given function with the supplied object and then returns the object." Can someone help me to explain what is the meaning of star (*) in the function signature? Are below implementation correct? If all the three implementation are correct, which one should be used when?

To prove SKK and II are beta equivalent, lambda calculus

孤街醉人 提交于 2019-12-05 20:10:16
I am new to lambda calculus and struggling to prove the following. SKK and II are beta equivalent. where S = lambda xyz.xz(yz) K = lambda xy.x I = lambda x.x I tried to beta reduce SKK by opening it up, but got nowhere, it becomes to messy. Dont think SKK can be reduced further without expanding S, K. SKK = (λxyz.xz(yz))KK → λz.Kz(Kz) (in two steps actually, for the two parameters) Kz = (λxy.x)z → λy.z λz.Kz(Kz) → λz.(λy.z)(λy.z) (again, several steps) → λz.z = I (You should be able to prove that II → I ) ;another approach with fewer steps, first reduce SK to λyz.z; SKK = (λxyz.xz(yz))KK → λyz

convert flip lambda into SKI terms

情到浓时终转凉″ 提交于 2019-12-05 19:37:08
I'm having trouble converting the lambda for flip into the SKI combinators (I hope that makes sense). Here is my conversion: /fxy.fyx /f./x./y.fyx /f./x.S (/y.fy) (/y.x) /f./x.S f (/y.x) /f./x.S f (K x) /f.S (/x.S f) (/x.K x) /f.S (/x.S f) K /f.S (S (/x.S) (/x.f)) K /f.S (S (K S) (K f)) K S (/f.S (S (K S) (K f))) (/f.K) S (/f.S (S (K S) (K f))) (K K) S (S (/f.S) (/f.S (K S) (K f))) (K K) S (S (K S) (/f.S (K S) (K f))) (K K) S (S (K S) (S (/f.S (K S)) (/f.K f))) (K K) S (S (K S) (S (/f.S (K S)) K)) (K K) S (S (K S) (S (S (/f.S) (/f.K S)) K)) (K K) S (S (K S) (S (S (K S) (/f.K S)) K)) (K K) S (S