Academia.eduAcademia.edu

can u solve this halting paradox?

can u solve this halting paradox? Nicholas K. Swenson [email protected] 0 // implementation assumed, set of possible returns denoted instead 1 halts = (m: function) -> { 2 true: iff (m halts && m will halt after true return), 3 false: iff (m does not halt || m will halt after false return), 4 } 5 6 // implementation assumed, set of possible returns denoted instead 7 loops = (m: function) -> { 8 true: iff (m loops && m will loop after true return), 9 false: iff (m does not loop || m will loop after false return), 10 } 11 12 paradox = () -> { if ( halts(paradox) || loops(paradox) ) { 13 14 if ( halts(paradox) ) 15 loop_forever() else if ( loops(paradox) ) 16 17 return 18 else 19 loop_forever() 20 } 21 } 22 23 main = () -> { 24 loops(paradox) 25 halts(paradox) 26 } As opposed to traditional thought, halts/loops oracles have become context sensitive functions. They account for the computational context they are called within, by looking up the call stack to determine the particular call location they are responding to. They are especially concerned with whether they are being called self-referentially, implying their response will directly impact the truthiness of their prediction. If they determine this to be the case, they enter a branch guard mode where they only return true iff the branch executed after true, will certainly result in the prediction being true, otherwise they return false. Instead of trying to return an overall prediction of the input function in a detached manner, they are instead participating in guiding the execution to a predictable result. In non-self referential cases, they respond to overall input machine performance, as one would expect. This code only has one correct runtime path. It can be thought of as a dynamic programming problem, where each call location only needs to be evaluated once, and the solution builds on itself. List out the various return values for these halts/loops calls: ● L16 - loops(paradox) ● L24 - loops(paradox) ● L14 - halts(paradox) ● L25 - halts(paradox) ● L13 - loops(paradox) ● L13 - halts(paradox)