Ian Clifton <
ian.c...@chem.ox.ac.uk> writes:
> Sorry! I just thought it was interesting that such a scheme could (I
> think) be implemented (although you’d have to work out how to do
> indexing of data structures by bignum etc), even though we all know it
> couldn’t possibly work in any useful sense. I recall that Bart Simpson
> once lined up several police bull‐horns, the output of one feeding into
> the microphone of the next, in order to produce a stupendously loud
> sound. Of course this wouldn’t work either, but you could attempt the
> experiment.
Well we're speaking of lisp here, so there's a solution. It's easy to
represent a number bigger than the universe in lisp: just use a sexp!
(↑↑↑↑ 3 3)
(↑27↑ 3 3)
(lessp '(↑27↑ 3 3) (add '(↑27↑ 3 3) '(↑↑↑↑ 3 3)))
(defun ↑ (x y) (expt x y))
(defun ↑↑ (x y) (expt x (expt y y)))
(defun ↑↑↑ (x y) (expt x (expt y (expt y y))))
(defun ↑↑↑↑ (x y) (expt x (expt y (expt y (expt y y)))))
(↑↑ 3 3) --> 7625597484987
(↑↑↑ 3 3) can't be computed on current hardware, but you can still
represent this number, as the sexp (↑↑↑ 3 3), like you can represent 100
as: (* (expt 5 2) (expt 2 2)) or some other sexp.
And you can write functions like add and lessp that compute
symbolically. (You can use a theorem prover to implement them).
(defun add (a b)
(cond
((and (numberp a) (numberp b))
(+ a b))
((and (numberp a) (zerop a)) b)
((and (numberp b) (zerop b)) a)
(t `(+ ,a ,b))))
(add '(↑27↑ 3 3) '(↑↑↑↑ 3 3))
--> (+ (↑27↑ 3 3) (↑↑↑↑ 3 3))