while true:
n += 1In fact, this unboundedness is a core part of what makes these models of computation so expressive. In the Gödel's incompleteness theorem analogy, you can say "there is an integer such that ..." or "there is no integer such that ...". In the Turing machine model, you can write programs that search for counterexamples to mathematical claims. Because these programs are written to try every integer, you can only tell if they eventually halt by yourself resolving the mathematical claim.
For example, we can write a program that tests the Goldbach conjecture or the 3n+1 conjecture by brute force. Determining if these programs' search through all integers will halt or not is equivalent to resolving the status of these conjectures!
start = i = 1
visited = []
while True:
if i in visited:
if 1 not in visited:
break
else:
print(start, visited)
visited = []
start += 1
i = start
continue
visited.append(i)
if i % 2:
i = 3*i + 1
else:
i //= 2
On an actual computer's Python interpreter, I believe this will eventually halt with a MemoryError exception (although I'm not at all sure that you can actually run it long enough to hit that, as it will probably take many years!), failing to resolve the mathematical question. That potential for the MemoryError is why it matters whether your model has infinite memory or not!(You can make a considerably more memory-efficient version of this which should be able to search much further before hitting a MemoryError, but I don't expect it changes the ultimate fate of the program when run on a real physical computer.)
The binary requirement comes from the question, not a failure to think differently. The consequences of binary requirement with completeness (correct output for every input) is the point.
If you modify the question as you suggest, to output UNRESOLVABLE in exactly the cases where the input is a paradox, that doesn't work either. It is not possible to reliably detect every self-referential paradox, for reasons analogous to (but more complicated than) it not being possible to reliably say for every program if it will eventually halt.
Even so, it is possible to write a program which outputs UNRESOLVABLE in cases where that particular implementation of a halt-test program gets stumped and gives up despite there being another correct answer it hasn't found, or when it detects specific patterns. But that's more about hitting arbitrary limits of a particular implementation, so not as interesting theoretically. It is what you'd do in practice, if someone asked you to write a halting detector in the real world.
The halting problem computation model has unlimited memory. Sometimes people say this means you can "solve" the halting problem in practice because real machines have bounded memory, therefore finite states, which must eventually repeat if a program does not halt. But this isn't really a solution, because the halt-test program needs exponentially more memory than the input program would be allowed if run. However you look at it, that is not "in practice", it is prevented by computational inaccessibility, and it also doesn't satisfy the principle of the halting problem, which is to ask if halt-test can be written in the same kind of universal programming system as the programs it analyses. (Besides, you can run programs with unlimited memory, by always being willing to pause, upgrade machine, and resume, whenever current memory is filled.)
When analysed with denotational semantics, there actually is a third output called "bottom" (⊥) which means "mathematical value representing doesn't terminate". But even using mathematical approaches, there is no way to calculate when that's the output for all possible inputs to a correct halt-test function.
So of course, there are more to-the-point resources for the technical concepts that Hofstadter employs. It's an understandable misconception to have when people so often say GEB is a must-read for techies and when it has a name that includes "Godel". So remember - GEB is about Hofstadter trying to argue for a point about a particular thesis (how the mind ("I") arises from the brain), and to that end, he employs many different concepts (many of which are from computer science) and explains them poetically (at least, a lot of people think so). But teaching you these concepts is just a secondary, even tertiary, goal of his. If you find his writing engaging, it might be a more fun way to learn about that stuff - but if not, don't worry, GEB wasn't primarily written to teach you anyway. I'm sure even the biggest GEB fans will agree.
I'd argue the plot is entirely about Godel's incompleteness theorem. It's not just "mentioned in passing", the entire book is centered around a series of increasingly complex explanations that culminate in explaining the actual theorem itself.
But just like a good novel is way, way more than just the plot, GEB is way more than just the Godel incompleteness theorem.
Personally I didn't really find any other thesis or theme that compelling. However, I absolutely loved the clever ways in which he illustrated each concept. Others may have appreciated other aspects of it, and that's great too. Many people can enjoy the book for different reasons.
The Godel proof chapter feels like the apotheosis of the book. The rest almost feels tacked on, e.g. the whole dna-computing ... , even the "strange loops" part, which I would not think is the main crux of the book.
But anyway - you and anyone else of course are free to enjoy Hofstadter's explanations of Godel's incompleteness theorem - maybe you even think that it is the best/most interesting/most fun/most insightful explanation. I just mean to say that Hofstadter isn't writing this book primarily to explain technical concepts - his explanations are a means to an end. So someone who struggles to get through this book shouldn't feel bad - its main goal was never to be a "must-read for programmers" anyway.
https://www.youtube.com/watch?v=92WHN-pAFCs
And it's an absolutely brilliant - and very direct - exposition of Alan Turing's Halting theorem.
(unfortunately I can't find analogues of this for many other related subjects)
Some people are saying that GEB is too convoluted, but the base material absolutely doesn't need to be.