Re: DD specifies non-terminating behavior to HHH --- RECURSIVE CHAIN --- Saving Democracy

Liste des GroupesRevenir à theory 
Sujet : Re: DD specifies non-terminating behavior to HHH --- RECURSIVE CHAIN --- Saving Democracy
De : polcott333 (at) *nospam* gmail.com (olcott)
Groupes : comp.theory
Date : 22. Feb 2025, 23:53:49
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vpdkhv$5kr2$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
User-Agent : Mozilla Thunderbird
On 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.
--
Copyright 2025 Olcott "Talent hits a target no one else can hit; Genius
hits a target no one else can see." Arthur Schopenhauer

Date Sujet#  Auteur
18 Apr 26 o 

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal