Skip to main content
More demystification
Source Link
Anders Kaseorg
  • 40.1k
  • 3
  • 75
  • 146

40 combinators

S(S(SI(K(S(S(KS)K)(K(S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))))))))(K(S(SI(K(KI)))(K(KI)))))(KK)

Try it online!

Generated with thea little help offrom a slightly modified version of my answer to Combinatory Conundrum:

$$\begin{align*} \textit{zero} &= λf. λx. x = KI \\ \textit{succ} &= λn. λf. λx. f\,(n\,f\,x) = S(S(KS)K) \\ \textit{zero-pair} &= λf. f\,\textit{zero}\,\textit{zero} = S(SI(K(KI)))(K(KI)) \\ \textit{next-pair-helper} &= λf. λm. λn. f\,n\,(\textit{succ}\,m) \\ &= S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))) \\ \textit{next-pair} &= λp. λf. p\,(\textit{next-pair-helper}\,f) \\ &= S(S(KS)K)(K(S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))))) \\ \textit{half} &= λn. n\,\textit{next-pair}\,\textit{zero-pair}\,K \end{align*}$$$$\begin{align*} \textit{zero} &= λf. λx. x = KI \\ \textit{succ} &= λn. λf. λx. f\,(n\,f\,x) = S(S(KS)K) \\ \textit{zero-pair} &= λf. f\,\textit{zero}\,\textit{zero} = S(SI(K\,\textit{zero}))(K\,\textit{zero}) \\ \textit{next-pair-helper} &= λf. λm. λn. f\,n\,(\textit{succ}\,m) \\ &= S(S(KS)(S(KK)S))(K(S(KK)\,\textit{succ})) \\ \textit{next-pair} &= λp. λf. p\,(\textit{next-pair-helper}\,f) \\ &= S(S(KS)K)(K\,\textit{next-pair-helper}) \\ \textit{half} &= λn. n\,\textit{next-pair}\,\textit{zero-pair}\,K \\ &= S(S(SI(K\,\textit{next-pair}))(K\,\textit{zero-pair}))(KK) \end{align*}$$

40 combinators

S(S(SI(K(S(S(KS)K)(K(S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))))))))(K(S(SI(K(KI)))(K(KI)))))(KK)

Try it online!

Generated with the help of a slightly modified version of my answer to Combinatory Conundrum:

$$\begin{align*} \textit{zero} &= λf. λx. x = KI \\ \textit{succ} &= λn. λf. λx. f\,(n\,f\,x) = S(S(KS)K) \\ \textit{zero-pair} &= λf. f\,\textit{zero}\,\textit{zero} = S(SI(K(KI)))(K(KI)) \\ \textit{next-pair-helper} &= λf. λm. λn. f\,n\,(\textit{succ}\,m) \\ &= S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))) \\ \textit{next-pair} &= λp. λf. p\,(\textit{next-pair-helper}\,f) \\ &= S(S(KS)K)(K(S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))))) \\ \textit{half} &= λn. n\,\textit{next-pair}\,\textit{zero-pair}\,K \end{align*}$$

40 combinators

S(S(SI(K(S(S(KS)K)(K(S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))))))))(K(S(SI(K(KI)))(K(KI)))))(KK)

Try it online!

Generated with a little help from a slightly modified version of my answer to Combinatory Conundrum:

$$\begin{align*} \textit{zero} &= λf. λx. x = KI \\ \textit{succ} &= λn. λf. λx. f\,(n\,f\,x) = S(S(KS)K) \\ \textit{zero-pair} &= λf. f\,\textit{zero}\,\textit{zero} = S(SI(K\,\textit{zero}))(K\,\textit{zero}) \\ \textit{next-pair-helper} &= λf. λm. λn. f\,n\,(\textit{succ}\,m) \\ &= S(S(KS)(S(KK)S))(K(S(KK)\,\textit{succ})) \\ \textit{next-pair} &= λp. λf. p\,(\textit{next-pair-helper}\,f) \\ &= S(S(KS)K)(K\,\textit{next-pair-helper}) \\ \textit{half} &= λn. n\,\textit{next-pair}\,\textit{zero-pair}\,K \\ &= S(S(SI(K\,\textit{next-pair}))(K\,\textit{zero-pair}))(KK) \end{align*}$$

Clarify some variable names
Source Link
Anders Kaseorg
  • 40.1k
  • 3
  • 75
  • 146

40 combinators

S(S(SI(K(S(S(KS)K)(K(S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))))))))(K(S(SI(K(KI)))(K(KI)))))(KK)

Try it online!

Generated with the help of a slightly modified version of my answer to Combinatory Conundrum:

$$\begin{align*} \textit{zero} &= λf. λx. x = KI \\ \textit{succ} &= λn. λf. λx. f\,(n\,f\,x) = S(S(KS)K) \\ \textit{zero-pair} &= λf. f\,\textit{zero}\,\textit{zero} = S(SI(K(KI)))(K(KI)) \\ \textit{next-pair-helper} &= λg. λx. λy. g\,y\,(\textit{succ}\,x) \\ &= S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))) \\ \textit{next-pair} &= λf. λg. f(\textit{next-pair-helper}\,g) \\ &= S(S(KS)K)(K(S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))))) \\ \textit{half} &= λn. n\,\textit{next-pair}\,\textit{zero-pair}\,K \end{align*}$$$$\begin{align*} \textit{zero} &= λf. λx. x = KI \\ \textit{succ} &= λn. λf. λx. f\,(n\,f\,x) = S(S(KS)K) \\ \textit{zero-pair} &= λf. f\,\textit{zero}\,\textit{zero} = S(SI(K(KI)))(K(KI)) \\ \textit{next-pair-helper} &= λf. λm. λn. f\,n\,(\textit{succ}\,m) \\ &= S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))) \\ \textit{next-pair} &= λp. λf. p\,(\textit{next-pair-helper}\,f) \\ &= S(S(KS)K)(K(S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))))) \\ \textit{half} &= λn. n\,\textit{next-pair}\,\textit{zero-pair}\,K \end{align*}$$

40 combinators

S(S(SI(K(S(S(KS)K)(K(S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))))))))(K(S(SI(K(KI)))(K(KI)))))(KK)

Try it online!

Generated with the help of a slightly modified version of my answer to Combinatory Conundrum:

$$\begin{align*} \textit{zero} &= λf. λx. x = KI \\ \textit{succ} &= λn. λf. λx. f\,(n\,f\,x) = S(S(KS)K) \\ \textit{zero-pair} &= λf. f\,\textit{zero}\,\textit{zero} = S(SI(K(KI)))(K(KI)) \\ \textit{next-pair-helper} &= λg. λx. λy. g\,y\,(\textit{succ}\,x) \\ &= S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))) \\ \textit{next-pair} &= λf. λg. f(\textit{next-pair-helper}\,g) \\ &= S(S(KS)K)(K(S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))))) \\ \textit{half} &= λn. n\,\textit{next-pair}\,\textit{zero-pair}\,K \end{align*}$$

40 combinators

S(S(SI(K(S(S(KS)K)(K(S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))))))))(K(S(SI(K(KI)))(K(KI)))))(KK)

Try it online!

Generated with the help of a slightly modified version of my answer to Combinatory Conundrum:

$$\begin{align*} \textit{zero} &= λf. λx. x = KI \\ \textit{succ} &= λn. λf. λx. f\,(n\,f\,x) = S(S(KS)K) \\ \textit{zero-pair} &= λf. f\,\textit{zero}\,\textit{zero} = S(SI(K(KI)))(K(KI)) \\ \textit{next-pair-helper} &= λf. λm. λn. f\,n\,(\textit{succ}\,m) \\ &= S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))) \\ \textit{next-pair} &= λp. λf. p\,(\textit{next-pair-helper}\,f) \\ &= S(S(KS)K)(K(S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))))) \\ \textit{half} &= λn. n\,\textit{next-pair}\,\textit{zero-pair}\,K \end{align*}$$

Explanation
Source Link
Anders Kaseorg
  • 40.1k
  • 3
  • 75
  • 146

40 combinators

S(S(SI(K(S(S(KS)K)(K(S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))))))))(K(S(SI(K(KI)))(K(KI)))))(KK)

Try it online!

Generated with the help of a slightly modified version of my answer to Combinatory Conundrum:

$$\begin{align*} \textit{zero} &= λf. λx. x = KI \\ \textit{succ} &= λn. λf. λx. f\,(n\,f\,x) = S(S(KS)K) \\ \textit{zero-pair} &= λf. f\,\textit{zero}\,\textit{zero} = S(SI(K(KI)))(K(KI)) \\ \textit{next-pair-helper} &= λg. λx. λy. g\,y\,(\textit{succ}\,x) \\ &= S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))) \\ \textit{next-pair} &= λf. λg. f(\textit{next-pair-helper}\,g) \\ &= S(S(KS)K)(K(S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))))) \\ \textit{half} &= λn. n\,\textit{next-pair}\,\textit{zero-pair}\,K \end{align*}$$

40 combinators

S(S(SI(K(S(S(KS)K)(K(S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))))))))(K(S(SI(K(KI)))(K(KI)))))(KK)

Try it online!

40 combinators

S(S(SI(K(S(S(KS)K)(K(S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))))))))(K(S(SI(K(KI)))(K(KI)))))(KK)

Try it online!

Generated with the help of a slightly modified version of my answer to Combinatory Conundrum:

$$\begin{align*} \textit{zero} &= λf. λx. x = KI \\ \textit{succ} &= λn. λf. λx. f\,(n\,f\,x) = S(S(KS)K) \\ \textit{zero-pair} &= λf. f\,\textit{zero}\,\textit{zero} = S(SI(K(KI)))(K(KI)) \\ \textit{next-pair-helper} &= λg. λx. λy. g\,y\,(\textit{succ}\,x) \\ &= S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))) \\ \textit{next-pair} &= λf. λg. f(\textit{next-pair-helper}\,g) \\ &= S(S(KS)K)(K(S(S(KS)(S(KK)S))(K(S(KK)(S(S(KS)K)))))) \\ \textit{half} &= λn. n\,\textit{next-pair}\,\textit{zero-pair}\,K \end{align*}$$

Source Link
Anders Kaseorg
  • 40.1k
  • 3
  • 75
  • 146
Loading