Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem with lambda expressions is that they cannot be interpreted as functions in a mathematical sense, i.e. mappings from one set to another.</p> <p>The reason is the cardinality of the set of functions from a set <code>A</code> on itself is always larger than the cardinality of <code>A</code>, so not all functions from <code>A</code> to <code>A</code> can be an element of <code>A</code>. That is, there is a function <code>f: A -&gt; A</code> for which the expression <code>f(f)</code> does not make sense.</p> <p>This is like the "set of all sets not containing itself", which does not make sense logically.</p> <p>JavaScript is not a model of the lambda calculus.</p> <p>The problem with your example is that</p> <pre><code>(lambda x.g(x x)) (lambda x.g(x x)) </code></pre> <p>should be equivalent to</p> <pre><code>g((lambda x.g(x x)) (lambda x.g(x x))) </code></pre> <p>but it is not in your JavaScript program where <code>g</code> is the indicator function of <code>0</code>.</p> <p><code>x x</code> is always <code>undefined</code>. Hence the first line evaluates to <code>g (undefined) = 0</code>. The second line evaluates to <code>g (g (undefined)) = g (0) = 1</code>. This means that your JavaScript model of the lambda calculus is, in fact, not really a model.</p> <p>Since for each non-empty set <code>D</code> there is a function from <code>D</code> to <code>D</code> without a fixed point, obviously there can be no model of the lambda calculus. I think it should be even possible to prove that there cannot be an implementation of the Y-combinator in any Turing-complete language.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload