s-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

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

S combinator in Haskell

拟墨画扇 提交于 2019-11-29 03:00:04
问题 Can an analog of the S combinator be expressed in Haskell using only standard functions (without defining it by equation) and without using lambda (anonymous function)? I expect it to by of type (a -> b -> c) -> (a -> b) -> a -> c . For example, an analog of the K combinator is just const . In fact i am trying to express the function \f x -> f x x using standard functions, but cannot think of any standard non-linear function to start with (that is a function that uses its argument more than