The Universe of Discourse : The road to epsilon-zero: Productive programs and well-founded orders
The Universe of Discourse
Mark Dominus (陶敏修)
mjd@pobox.com
About me
RSS<br>Atom
12 recent entries
The road to epsilon-zero: Productive programs and well-founded orders<br>There are two kinds of theorems<br>The road to epsilon-zero: Coin-moving games with no coins<br>Seven books I keep close because I love them<br>The road to epsilon-zero: Infinite Nim as a coin-moving game<br>“Steph Curry: fluke or breakthrough” ten years later<br>The road to epsilon-zero: Nim always ends, even with infinite ordinals<br>The road to epsilon-zero: ordinals as nim-heaps<br>Starting to understand epsilon-zero<br>It's our language now!<br>I owe my life to a 1913 road rage incident<br>Deciphering basmala
Archive:
2026:<br>JFMAMJ<br>JA<br>2025:<br>JFMAMJ<br>JASOND<br>2024:<br>JFMAMJ<br>JASOND<br>2023:<br>JFMAMJ<br>JASOND<br>2022:<br>JFMAMJ<br>JASOND<br>2021:<br>JFMAMJ<br>JASOND<br>2020:<br>JFMAMJ<br>JASOND<br>2019:<br>JFMAMJ<br>JASOND<br>2018:<br>JFMAMJ<br>JASOND<br>2017:<br>JFMAMJ<br>JASOND<br>2016:<br>JFMAMJ<br>JASOND<br>2015:<br>JFMAMJ JASOND<br>2014:<br>JFMAMJ JASOND<br>2013:<br>JFMAMJ JASOND<br>2012:<br>JFMAMJ<br>JASOND<br>2011:<br>JFMAMJ<br>JASOND<br>2010:<br>JFMAMJ<br>JASOND<br>2009:<br>JFMAMJ<br>JASOND<br>2008:<br>JFMAMJ<br>JASOND<br>2007:<br>JFMAMJ<br>JASOND<br>2006:<br>JFMAMJ<br>JASOND<br>2005: OND
Subtopics:
Mathematics252<br>Programming102<br>Language98<br>Miscellaneous75<br>Book51<br>Tech49<br>Etymology36<br>Haskell33<br>Oops30<br>Unix27<br>Cosmic Call25<br>Math SE25<br>Law23<br>Physics21<br>Perl17<br>Biology16<br>Brain15<br>Calendar15<br>Food15
-->
-->
Technorati Profile<br>-->
Comments disabled
Thu, 13 Aug 2026
The road to epsilon-zero: Productive programs and well-founded orders
Previously:
Ordinal numbers and basic set theory
Ordinals as nim-heaps
Nim always ends, even with infinite ordinals
Infinite Nim as a coin-moving game
Coin-moving games without the coins
Previously we saw how to interpret the difficult-seeming ordinal<br>!!ω^ω!! as a particular ordering of the set of finite sequences of<br>numbers, revealing what seemed like a scary monster as gentle and<br>straightforward.
Now we're going to take a sidetrack into one of my favorite topics,<br>computation with infinite lists. I wrote about this for The<br>Perl Journal in 1997 and then it turned into chapter 6 of<br>Higher-Order Perl and here we are again. Gosh! it just keeps<br>coming back. Like John the Baptist.
Infinite lists
Suppose you have an infinite set of strings — we'll call this set<br>!!S!! for the rest of the article — and you want a program to<br>print them all out. Of course the program can't exactly print them<br>all out, because it will only run for a finite amount of time. But<br>there are more and less useful ways for the program to try.
For each string that the program is supposed to print,<br>we should at least be able to guarantee that the the program will<br>print it, eventually, if we just wait long enough. If this is true then we'll say<br>that the program is “productive”.
Here's a productive program to print the base-10 numerals for all the<br>positive integers:
# Python
i = 1<br>while True:<br>print(i)<br>i += 1
What would a non-productive program look like? Here's an example of a<br>non-productive program to print the base-10 numerals for all the<br>positive integers:
# Python, silly
i = 1<br>while True: # print all the odd numbers<br>print(i)<br>i += 2
i = 2<br>while True: # then print all the even numbers<br>print(i)<br>i += 2
This one tries to print all the odd numbers first, and then all the<br>even numbers. Obviously that doesn't work because it never finishes<br>with the odd numbers. If you were to sit around waiting for the<br>number !!14!!, you'd wait forever. Whereas with the first program,<br>whatever number you are waiting for, even if it is very very big, it<br>will come out eventually.
That's what I meant when I said there are more and less useful ways<br>for a program to try to print an infinite set. The first one never<br>finishes, true, but the way in which it never finishes is much more<br>useful than the way in which the second one never finishes.
Okay, that was a silly example. But there are less silly examples.
Printing strings in sorted order
A productive program is always semidecidable: if a user wants to<br>know if some particular string !!s!! is in !!S!!, and they wait long<br>enough, !!s!! will come out and they have the answer. But if !!s!!<br>isn't in !!S!!, they never find that out! They just wait and wait,<br>wondering if it will come out, and never getting a definitive answer.
If we can get a productive program to produce its strings in sorted<br>order, we can make a better guarantee. The program will be<br>decidable: the user will eventually get an answer, one way<br>or the other. If !!s\in S!! the productive program will eventually<br>produce !!s!!, and the user can stop watching. But if !!s\notin S!!,<br>the program must eventually produce a string that comes after !!s!! in<br>sorted order, and they can quit then. And the program must<br>eventually produce some string that comes after !!s!!, because,<br>being productive, it eventually produces every string in !!S!!.
(What if there is no string in !!S!! that comes after !!s!! in sorted<br>order? Then the productive...