0% found this document useful (0 votes)
12 views5 pages

A Simple Generator of Incompleteness Theorems

The paper presents a formalization of Turing's proof of the unsolvability of the Halting Problem using M routines, revealing nine program transformations that lead to inherent inconsistencies. It demonstrates that if a program could determine halting, it would create contradictions when applied to itself. The author provides an M routine that generates lists of solvable and unsolvable problems, including the Halting Problem and other notable theorems.

Uploaded by

Dan The Man
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
12 views5 pages

A Simple Generator of Incompleteness Theorems

The paper presents a formalization of Turing's proof of the unsolvability of the Halting Problem using M routines, revealing nine program transformations that lead to inherent inconsistencies. It demonstrates that if a program could determine halting, it would create contradictions when applied to itself. The author provides an M routine that generates lists of solvable and unsolvable problems, including the Halting Problem and other notable theorems.

Uploaded by

Dan The Man
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 5
{TA 27th Annual Conference 1998 TECHNICAL PAPER A Simple Generator of Incompleteness Theorems (Written in M of Course) by Charlie Volkstorf Abstract We present Turing’s proof of the unsolvability of the Halting Problem in the context of M routines. A closer examination of Turing’s proof reveals a set of nine pro- gram transformations that can be applied to any pro- gram, to create a program that is sometimes inherently inconsistent. This process is generalized, formalized and implemented in a 42-line M routine. Running this rou- tine produces lists of problems that the routine discovers, are solvable or unsolvable. This includes the Halting Problem and several other well-known theorems tradi- tionally proven using informal, manual methods, I. Paradoxes, Self-Reference, Incompleteness There is no topic in mathematics (computer science) that is more intriguing than the paradoxes that have plagued ‘man since antiquity. These are proofs that certain state~ ments, that seem to be false, are in fact true. While many of thear merely illustrate flaws in the statement of the paradox, others have uncovered fundamental limitations (incompleteness) in various branches of mathematics, and have spawned significant areas of investigation. The ‘most notable include: 1. Russell’s Paradox: Philosopher Bertrand Russell asked in 1901 [5], “Does the set of all sets that do not contain themselves contain itself ?” By its definition, this state- ment is neither true nor false. (Neither the statement nor its negation is true.) 2. Godel's Ist Incompleteness Theorem: Mathematician Kurt Godel proved in 1931 [5] that typical systems of logic contain statements that are true but not provable. (Neither the statement nor its negation can be proven.) 3. Unsolvability of the Halting Problem: In 1937, math- ematician Alan Turing [1] defined a simple, but com- pletely general model of computer programming, later called a Turing Machine. He proved that itis impossible for any Turing Machine to determine whether or not an arbitrary Turing machine, with its input, will ever halt. http://wwwamtechnologiorg, IL The Halting Problem The unproven premise of Turing Machines is that any computation that can be done can be done with a Turing Machine. Thus any requirement that can’t be carried out bya Turing Machine (such as the Halting Problem) can't be done at all. We will assume the equivalence of Turing Machines and M extrinsic functions with parameter pass- ing, with the following correspondence: 1. The Turing Machine tape (input) is represented by the formal parameters passed to the M extrinsic function. 2. A Turing Machine halting YES or NO is represented by the M extrinsic function returning 1 or 0 (using QUIT ‘with an argument), respectively 3. Aswe are concerned with the Computational power of ‘Mf and not how information is transferred between users and M, we consider the subset of M that excludes the READ and WRITE commands. Let us represent a program within M asa single string (as is done in some M implementations). Now suppose that we have a solution to the Halting Problem, that is, a2 extrinsic function defined as: H(P1,P2) ; Determine whether program Pl halts when P2 is passed to it as a parameter, +++ QUIT 1 or QuIT o Now consider the following one-line subroutine in the same routine: H2(A) NN (A) Q:/SSH(A,A) 1 F What isit doing ? It takes an input A and merely returns if '$$#(A, A), and loops otherwise, Thus #2 (A) halts if A loops on itself, and H2(A) loops if A halts on itself. H2 does the opposite of what its input, interpreted as being the representation of an M extrinsic function, does on itself, with respect to halting or not. M COMPUTING = 43 MTA 27th Annual Conference 1998 Now consider a third subroutine in this routine: H3 Q $$H2($T(H2)) All this does is to call H2 with input that happens to be the representation of subroutine 2. What would this do? As established above, H2(A) halts if A loops on itself and loops if A halts on itself. Since the input A to #2 is H2, itself, then H2_ halts on itself if #2 loops on itself, and loops if it halts on itself. Both of these are inconsistent, so #2 can neither halt nor loop. This is impossible, so these programs cannot exist. Since #2 and #3 do exist, H can- not exist. Thus there is no solution to the Halting Prob- lem. Note that H2 and #3 could be combined to produce one inconsistent subroutine, #4: H4 Q:/SSH("H2(A) N (A) Q:/S$H(A/A) 1 FY “H2(A) N (A) Q2/SSH(A,A) 1 F”) 1 F ILL. Formalization of the Properties of Turing Machines The above is more of less standard Theory of Computa- tion talk. The purpose of this note is to utilize M to extend these results. In particular, we formalize these concepts to the point of being able to write an M routine 10 carry out the synthesis of these, and other theorems. For any predicates P,Q, R, we say that a Turing Machine solves requirement P:Q:R if it halts YES if and only if P holds, halts NO if and only if Q holds, and loops if and only if R holds. (Thus PQ, R must be exclusive and exhaustive.) Furthermore, +P:Q:R means that there is a “Turing Machine that solves P:Q:R, and -P:Q:R. means that no such Turing Machine exists. ‘We define the following relations, using an English state- ment expressing when each holds: ‘YES(a,b)—Turing Machine a eventually halts YES when started on input b. NO(a,b)—Taring Machine a eventually halts NO when started on input b. HALT(a,b)—Turing Machine a eventually halts when started on input b . LOOP(a,b)—Turing Machine a when started on input b never halts. ‘TRUE(a)—a is any value. We use symbols 0 and 1 to represent false and true, respectively. 4M COMPUTING Finally, following the notation introduced in [6], we define, for any predicate P, expressions +P(T), +P (x) ,-P(Z) and -P(x) as follows. (Expressions of the form +P(I,x) or -P(I,x) are not needed in the present note.) Expression +P(I)means that we have a program that decides if F holds for any given value. ‘Thus, there is a “Turing Machine that, when started on an input of I, halts yes if P(I),andhalts NO if ~P(I). (Pisrecur- sive.) Expression +P(xx) means that we have a program that lists out the values x for which P(x) holds, (ie, (x | P(x) }). (Pis recursively enumerable.) The expressions. -P(T) and -P(x) are the formal negations of (I) and P(x) , respectively. +P(Z) is obviously equivalent to +P(I) :~P(I) :0. Itis well known [2] that +P (x) (a set being recursively enu- merable) is equivalent to there being a Turing Machine that halts YES on elements of the set and loops other- wise. Thus +P (x) is equivalent to +P(I):0:~P(I)+ IV. Formalization of Turing’s Theorem ‘Turing’s Theorem, the unsolvability of the Halting Prob- Jem, is -HALT (I,J). But how do we formally prove that -HALT(I,J)? ¥ By definition, solves HALT (I,J) :~HALT(I,J) +0 establishing +HALT(I,J). By construction, H2(1) returns I when ~HALT(T, 7) and loops otherwise. Thus, H2 solves ~HALT(I,I):0:HALT(I,I) establishing +-HALT (x, x). ‘Turing proved -HALT(I,) by constructing #2 and #3 from H, then showing an inconsistency. The transforma- tion from H to H2 may be written as: HALT (I,J) :~HALT(I,J):0 => “HALT (I, 1) :0:HALT(I,T) ‘There are three parts to this transformation: (1) replace I,J with T, 1 (2) direct a return value of 1 from # toa LOOP in H2, (3) direct a return value of 0 from # to return 1 in H2, Thus he transformed: 4¥P:Q:R => 4Q:0:PIR , (i-e-, #020:-0 , ies, +0(x)). When #2 detects #’s output via $$H(A,A) let us con- sider three possibilities as to what #2 is programmed to do for each value, 1 and 0. That is, there is a family of nine programs into which H could be transformed, June 1998 i | MTA 27th Annual Conference 1998 depending on what #2 does when $$(A,A) equals 1 or 0, Then +P29R becomes each of the following nine requirements 21 +0 requise equals thus quit 1 quit 1 Plgr0:R -RrO:R_— R(x) quit 1 guit 0 P:R gait 1 loop —Pr0:0!R Pox) quit 0 quit 1 Q:P:R quit 0 quit 0 0:P19:R quit 0 loop 0: P:9R loop quit 1 Q:0:PIR ons) loop quit 0 0:0:PIR loop loop 0r0zPIQIR 0:0:1 —— ~2RUE(x) Let us define function R9_as: For Turing Machine m, and AY, ANeacheither¥, N orl, R9(m, AY, AN) is the Turing Machine created when each halt YES in m is changed to halt YES, halt NO or a LOOP, depending on AY being ¥, Wor L, respectively, and each halt NO is changed likewise depending on AN. Turing’s proof uses the fact that if m solves P:Q:R then R9(m,"L","Y") solves Q. That is, ("L","¥") in R9‘accomplish- es P:Q:R=> Q:0:~Q. ‘Thus +HALT(I,1) :~HALT(I,1):0 => +-HALT(I,I):0:HALT(I,Z)and RO(ST(R) /"L" ,"¥")=ST(H2). Turing’s proof then proceeds to show that HALT (I,I):0:HALT(I,I), (ies -~HALT(x,x)). This is done by applying the program that solves ~HALT(I,I):0:HALT(I,T), (i¢., H2, to itself, and showing that it can neither halt nor loop). ‘To show that a particular P:Q2R cannot be solved, we consider the three possible results that can occur when it is applied to itself: halt YES, halt NO or Loop. The inconsistency occurs when the fact of the result (Yes, No, Loop) implies how it will halt (or not) according to its, own definition. In Turing’s case, a result of Yes would mean that we Loop (since HALT(I,1) is true), No implies Loop (still BALT(I,) is true). and Loop implies Yes (~HALT(Z, I) is true). All three are incon- sistent, Only if the predicates in P:Q:R involve relations YES, NO, HALT and LOOP can we make a new conclusion about how a program will halt on itself based on how it, will halt on itself. We first consider if YES(I,1) where I is the program purporting to solve P:Q:R. If YES (I, I) logic P then we are okay. If YES(I,1) impli (ie. ~P), then we have an inconsistency. The conclusion is that YES(I, I) is false. bttp://www.ntechnology.org, When we also prove that both NO(x,z) and LOOP(I, I) are false, we have an inconsistency for the entire Turing Machine, It cannot exist. Let us define symbols ¥, N, Ito represent ¥ES(T,T), NO(I,I) and LOOP(T, I), respectively. When P, Q and Rare functions of £, NW, 1 then there is the possi- bility that the above requirement is met for the unsolv- ability of P:0:R. Any predicate that depends only on (is a function of) ¥, N,_ Lill be defined by the result of running m against m. This result is either YES, NO of LOOP. That is, exact- lyone of ¥, N, is true. The predicate is defined by whether it holds for each result ¥, N, , There are eight such predicates, with specific expressions, as fol- lows. €# Y Zz expression name ~TRUE LOOP No ~vES YES =NO YIN HALT 1 ‘TRUE bekere We generate -P:9 Rin five ste 1. Consider different values for predicates P, Q, R. 2. Consider transformations of P:9:R via the nine func- tions in R9. 3. Consider the three possible results of running m against m , viz, ¥, N, L 4. What is the result of running m against m? a, We are considering a specific result in step 3. b. Which of P, Q, Ris true for this result? (P,Q,R mean a result of ¥ NL, respectively.) c.Is the resull consistent ? That is, are (a.) and (b.) consistent ? 5. If all three possible results are inconsistent, then the requirements in step 2, and thus also step 1, are unsolv- able. An M routine, TURING, to perform this is listed below (see Figure 1). If you DO CHECKSUM “TURING, you get: 43726* 300 219732 61880 750 120684* 112637 1379744 1746 320 723910* 1775724 67301 448 1432920 1960464 734587 COMPUTING 45 MTA 27th Annual Conference 1998 SS 3217266 1913756* 3245080* 672 3923436* | 77418 3333504 800 3233126" 4692627 3532284 2508384 1045920* 992 7451200* 1056 6999750* 4857580 6398316 5488765 7372 809328" 2726000 1704739 160860 75967104 The first 42 numbers are the checksums for the 42 lines in routine TURING. ‘The last number (after “=") is the grand total for the routine, An asterisk by a number ‘means that line has a tag in the routine. 16. -HALT:-HALT Ifyou DO TP~TURING, the output is: | Can solve: Can't solve: 1. 40:0 1. -0:~HALT | 2. 4+0:NO ‘HALT :NO 6. +NO:0 TURING ; » "58 NTA Meeting paper } mexpr(1-8) = M expression £(¥,N) = {0/1} i (0) = Wane Tj Theoren-Prover KD INIT K (nexpr) F CAN@0,1 D CAN? Print solvable & unsolvable requirenents Q CAN Wott,*can” We'CAN "'t" WH solver" $ cP=0 . F pwiielsl:8 F ONt D POR; values for P:Q (implicit R) wire -re POR ; see if mexpr(PNM):mexpr(QNM) is solvable F RES@*Y","N","L" D RESKY T @nexpr(PNM) , @mexpr(QNM) G INC 5 SOLVE=1"; no PM,QNM overlap F avery", mie, L" F ANS"E,ni","L" D SOLVE G TRY:'SOLVE ; 9 transforms TRY D PRINT:CAN=GOLVE ; Print if’ Can/can’t solve TNC Q 7 PNM and QNM overlap - can’t both Halt YES and Halt NO PRINT ; AY+AN transformation has no consistent value for 8 creer W 1 ,$0(CT,5)/". “)SE("=+" ,CANAL) jmexPE(PNK, 0), "2" mexpe(QNM,0) © SOLVE ; apply R9(mexpr(PNM) :mexpz (QM) ,AY,AN) => E("Y") 2E(-") F ESry" oN" 'S B(E)=nexpr(AYeE*PNM) "I" mexpr(AN-E*QNM) ; create E(*) F Reserie,*N") "LY D RESKY T @(E(*Y") Y="), @(E(*N")_"=N") G OKRES $ SOLVE=D'; No consistent result £6F OKRES Qj could be RES RESXY § Y=(RES=*Y"),N=(RES="N") Q ; translate Result into Y/N for mexpr(*) INIT ; : mexpr(*) < Initialize universe of primitive predicates > 5 ALL="0=0, '(¥IN)=-HALT, NNO, 'Y=-YES, Y=YES, "NO-NO, YINeHALT, 1=1" K mexpr S mexpr(0)=0 ; | to get M expr or 0 from mexpr(boolean#) F Ael1:8 § BSSP(ALL,”,",A) mexpr(A)=SP(B,"=") ,mexpr (A, 0)=SP(B,"=",2) 9 CHECKSUM = § AeO F Be1:1:42 D + § C=gT(4B),D=0 F Ee1:1:$L(C) S D-BYE*SA(C,E)4D 1 |S_ASAYD W $5(D,9),$B(" *,SE(C)=" #1) we="R Figure 1 G6 M_ COMPUTING Tune 1998 MTA 27th Annual Conference 1998 7. +NO: YES 8. +YES:0 9. +¥ES:NO 10. +HALT:0 Al. +120 ‘A requirement of the form P:~P:0 means that P(I), (ie. the set P is recursive). Requirement P means that P(x), (ie. set P is recursively enumerable). These formats occur in unsolvable requirements 4, 7, 9, 10, 11, 13, 14, 15 and 16. Thus these are equivalent to: 1. --HALT(x,x) 2. --HALT(I,I) 3. -NO(I,Z) 4. --YES(x,x) 5. --¥YES(I,I) 6. -YES(I,1) 7. --NO(x,x) 8. --NO(I,T) 9. -HALT(I,I) Since P(t,3) => P(I,T) -P(I,1)=>=P(I,3). Thus 2, 3,5, 6, 8, 9 above easily imply -~HALT(I,J), etc. Many of these are theorems familiar to the Theory of Computation, informally proven by hand in the past. For example, HALT (I,J), HALT(I,1) and YES(T, J) are often called the halting, self-applicability, and membership problems [2,34]. by substitution, then Routine TURING also lists requirements for which it did not find an inconsistency, stating “Can solve.” Can we really solve all of these? Looking through this list we see still more of our friends from the Theory of Compute tion: 1. +-TRUE(X) 2. +NO(x,x) 3. YES (x, x) 4, +HALT(x,x) 5. +TRUE(x) Number 9 +YES(I,I) :NO(T, 1) is the so-called Uni- versal Turing Machine. The key to being able to solve all of these is the fact that a Turing Machine can be con- structed that interprets the running of another Turing Machine (just as interpreters are written for computer languages), http://www.mtechnology.org References 1, Martin Davis, (ed.), The Undecidable (New York: Raven Press, 1965.) 2. Dexter C. Kozen, Automata and Computability Springer (1997). 3. Marvin L. Minsky, Computation: Finite and Infinite ‘Machines (New York: Prentice-Hall Inc., 1967). 4, Rozenberg, Grzegorz and Salomaa, Arto Comerstones of Undecidabiliy ( New York: Prentice-Hall Inc., 1994), . Jean van Heijenoort, From Frege to Godel: A Source Book in Mathematical Logic 1879-1931 (Cambridge: Harvard University Press 1967). 6. Charles Volkstorf, “Debugger: A MUMPS Program ‘at Detects Errors in MUMPS Programs,” MUG Quar- terly, 12, 2, Summer 1982. Transform Your M Systems to Object Technology Protect your M investment while you migrate to 3-tier client/server, intemet & Object Technology including, Java, VB, Delphi and others. ESI has the knowledge, experience und sources to start today! ESI Technology Corp. 5 Commonwealth Rd Natick, MA 01760 M computing #7

You might also like