(defun ack (x y) (cond ((zp x) (1+ y)) ((zp y) (ack (1- x) 1)) (t (ack (1- x) (ack x (1- y)))))) (defthm ack0 (equal (ack 0 y) (1+ y))) (defun nat-ind (x) (if (zp x) x (nat-ind (- x 1)))) (defthm ack1 (implies (natp y) (equal (ack 1 y) (+ y 2))) :hints (("goal" :induct (nat-ind y)))) (defthm ack2 (implies (natp y) (equal (ack 2 y) (+ 3 (* y 2)))) :hints (("goal" :induct (nat-ind y)))) (defthm app-associative (equal (append (append a b) c) (append a (append b c)))) (defthm ack3 (implies (natp y) (equal (ack 3 y) (- (expt 2 (+ y 3)) 3))) :hints (("goal" :induct (nat-ind y)))) ; (thm (equal (ack 3 11) z)) (in-theory (disable (:executable-counterpart ack))) ; (thm (equal (ack 3 11) z)) (defthm ack4 (equal (ack 4 y) (cond ((zp y) (ack 3 1)) (t (ack 3 (ack 4 (1- y))))))) (defthm ack3-lemma (< (expt 2 n) (ack 3 n))) (defthm ack4-lemma (implies (posp n) (< (expt 2 (ack 4 (- n 1))) (ack 4 n))) :hints (("goal" :expand (ack 4 n) :in-theory (disable ack4 ack3)))) (thm (< (expt 2 (ack 4 2)) (ack 4 3)) :hints (("goal" :use (:instance ack4-lemma (n 3))))) (thm (< (* (expt 10 1000) (expt 10 1000)) (ack 4 2)))#|ACL2s-ToDo-Line|# #| The number of bits required to represent the number n is about log n. Now, (ack 4 3), as per above, is greater than (expt 2 (ack 4 2)) So the number of bits required to represent (ack 4 3) is more than the number of bits required to represent (expt 2 (ack 4 2)), which is about (ack 4 2) bits. The number of particles in the universe is estimated to be between 10^78 and 10^81, but even if it is 10^1,000 and we had 10^1,000 universes at our disposal, and if we could mark each of the particles in each of the universes with a 0 or a 1, we still wouldn't have enough particles to write down (ack 4 3) because 10^1,000 * 10^1,000 < (ack 4 2) Also one can computer (ack 3 n) for very large n, e.g., (thm (equal (ack 3 100000) z)) computes (ack 3 100000) in under a second. |#