Liste des Groupes | Revenir à c theory |
On 2/22/2025 4:59 PM, dbush wrote:But DD also reaches its own return instruction (when run) since the HHH(DD) that it calls will return 0.On 2/22/2025 5:53 PM, olcott wrote:Then is ceases to be analogous to HHH(DD) becauseOn 2/22/2025 2:59 PM, dbush wrote:>On 2/22/2025 3:53 PM, olcott wrote:>On 2/22/2025 2:09 PM, dbush wrote:>On 2/22/2025 3:03 PM, olcott wrote:>
01 int F(int i)
02 {
03 if (i > 10)
04 return 0;
05 else
06 return F(i+1);
07 }
08
09 int no_numbers_greater_than_10()
10 {
11 return F(0);
12 }
13
14 int main()
15 {
16 F((int)no_numbers_greater_than_10);
17 return 0;
18 }
>>>
So if the address of no_numbers_greater_than_10 is greater than 10 then 0 is returned right away, otherwise as most 10 recursive calls will be made before the condition is matched and 0 is returned.
>
This doesn't change the fact that no_numbers_greater_than_10 correctly
simulated by F cannot possibly return so F(no_numbers_greater_than_10)
is correct to report non-halting, which means that there is no natural
number greater than 10.
>
Agreed?
I think that you will find more bugs when you try to
provide the line number by line number execution trace.
>
#1 bug F never simulates anything.
>
It is a verified fact that
F never simulates anything when i > 10.
>
Remember, you agreed that the behavior of X simulated by Y is defined by replacing the code of Y with an unconditional simulator and running Y(X):
>
On 2/22/2025 1:02 PM, olcott wrote:
> On 2/22/2025 11:10 AM, dbush wrote:
>> On 2/22/2025 11:43 AM, olcott wrote:
>>> The first point is DD correctly simulated by HHH cannot
>>> possibly terminate normally by reaching its own "return"
>>> instruction.
>>
>> In other words, if the code of HHH is replaced with an unconditional simulator then it can be shown that DD is non-halting and therefore HHH(DD)==0 is correct.
>>
>
> Wow finally someone that totally gets it.
>
>
So the behavior of no_numbers_greater_than_10 simulated by F is defined by replacing the code of F with an unconditional simulated and running F(no_numbers_greater_than_10).
>
The finite string input to F proves that there are no instructions in no_numbers_greater_than_10 that can break the recursive simulation.
>
Try to show how no_numbers_greater_than_10 correctly simulated by F can possibly halt.
no_numbers_greater_than_10() always terminates normally
by reaching its own "return" instruction.
Unlike HHH(DD) F((int)no_numbers_greater_than_10);
does not need to abort the emulation of its input
to prevent its own non-termination.
Les messages affichés proviennent d'usenet.