Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Lisp is Turing-complete

Name: Anonymous 2011-07-13 22:46

This is what /prog/ actually believes.

Name: Anonymous 2011-07-13 22:49

SATAN CLAUS ISREAL

Name: Anonymous 2011-07-13 23:06

SK calculus is Turing-complete.[1]
A computational system is Turing-complete if it can simulate an universal Turing machine.
We now simulate a call-by-value SK calculus in Scheme, a dialect of Lisp:
(define (((S x) y) z) ((x z) (y z)))
(define ((K x) y) x)

Therefore, Lisp is Turing-complete.

[1] Any λ-calculus expression can be converted into S and K by using the following equivalences:
(λx.M) = (KM), if x does not occur free in M.
(λx.x) = (SKK)
(λx.MN) = (S(λx.M)(λx.N))
λ-calculus is Turing-complete. Proving it is left as an exercise for the reader.

Name: Anonymous 2011-07-14 13:04

>>1
I can write a Brainfuck compiler in Common Lisp.
Brainfuck is essentially a Turing machine (it reads a symbol on a limited memory tape and can change it).

Name: Anonymous 2011-07-15 1:02

>>3
implying Scheme is a dialect of Lisp
implying all Lisps have lambda

farts? farts.

Name: Anonymous 2011-07-15 1:20

>>5
It is, they do, and now it works with dynamic scope:
(define (S x)
  (eval
   `(lambda (y)
      (let ((x ,x))
        (eval
         `(lambda (z)
            ((,x z) (,y z))))))))
(define (K x)
  (eval
   `(lambda (y) ,x)))

Name: Anonymous 2011-07-15 8:05

>>2
SATAN CLAUS ISRAEL

Don't change these.
Name: Email:
Entire Thread Thread List