Algebra of Self-Replication
Lawrence S. Moss
TL;DR
The paper investigates decidable equational logics that capture diagonalization phenomena in computability, focusing on a diagonal operator and two proofs of Kleene's Second Recursion Theorem. It develops small, terminating and confluent term-rewriting fragments built from constants $e$, $d$ and binary operators $+$ and $\mathop{\mathrm{@}}$, later extending with $w$, and further with universal and $s^1_1$-style constants, to analyze normal forms, quines, and cycles. By constructing computable and non-computable models (interpreting $\mathop{\mathrm{@}}$ as Kleene application) and proving decidability of the word problem in the core fragments, the work reveals how quines are uniquely determined within these logics and how adding write operations or richer universals generates cycles and twin phenomena. The results highlight a trade-off between expressive power and tractability, illustrate connections between equational logics and fragments of combinatory logic, and raise open questions about extensionality and interpretation in broader programming languages. The methods provide a framework for analyzing self-reproduction and diagonalization in a controlled, computable setting with potential implications for understanding the foundations of self-referential computation.
Abstract
Typical arguments for results like Kleene's Second Recursion Theorem and the existence of self-writing computer programs bear the fingerprints of equational reasoning and combinatory logic. In fact, the connection of combinatory logic and computability theory is very old, and this paper extends this connection in new ways. In one direction, we counter the main trend in both computability theory and combinatory logic of heading straight to undecidability. Instead, this paper proposes using several very small equational logics to examine results in computability theory itself. These logics are decidable via term rewriting. We argue that they have something interesting to say about computability theory. They are closely related to fragments of combinatory logic which are decidable, and so this paper contributes to the study of such fragments. The paper has a few surprising results such as a classification of quine programs (programs which output themselves) in two decidable fragments. The classification goes via examination of normal forms in term rewriting systems, hence the title of the paper. The classification is an explanation of why all quine programs (in any language) are "pretty much the same, except for inessential details." In addition, we study the relational structure whose objects are the programs with the relation "p expresses q" meaning that if the program p is run on nothing, then it eventually outputs the program q.
