• DDD simulated by HHH cannot possibly halt (Halting Problem)

    From olcott@polcott333@gmail.com to comp.theory,comp.lang.c,comp.lang.c++ on Thu Apr 3 20:27:15 2025
    From Newsgroup: comp.lang.c++

    void DDD()
    {
    HHH(DDD);
    return;
    }

    Do you really think that anyone knowing the C
    programming language is too stupid to see that
    DDD simulated by HHH cannot possibly return?

    01 int DD(int (*x)())
    02 {
    03 int Halt_Status = HH(x, x);
    04 if (Halt_Status)
    05 HERE: goto HERE;
    06 return Halt_Status;
    07 }
    08
    09 int main()
    10 {
    11 Output("Input_Halts = ", HH(DD,DD));
    12 }

    DD simulated by HHH has the same behavior
    as DDD simulated by HHH.

    CAR T infusion tomorrow.
    (drastic cancer treatment)
    --
    Copyright 2025 Olcott "Talent hits a target no one else can hit; Genius
    hits a target no one else can see." Arthur Schopenhauer

    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From olcott@polcott333@gmail.com to comp.theory,comp.lang.c,comp.lang.c++ on Thu Apr 3 21:06:52 2025
    From Newsgroup: comp.lang.c++

    On 4/3/2025 8:59 PM, Richard Damon wrote:
    On 4/3/25 9:27 PM, olcott wrote:
    void DDD()
    {
        HHH(DDD);
        return;
    }

    Do you really think that anyone knowing the C
    programming language is too stupid to see that
    DDD simulated by HHH cannot possibly return?

    But if HHH doesn't do a complete emulation, it doesn't show that its
    input is non-halting,

    In other words you're convinced that a C
    program cannot see what every C programmer sees?
    --
    Copyright 2025 Olcott "Talent hits a target no one else can hit; Genius
    hits a target no one else can see." Arthur Schopenhauer
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From olcott@polcott333@gmail.com to comp.lang.c,comp.lang.c++ on Thu Apr 3 23:08:31 2025
    From Newsgroup: comp.lang.c++

    On 4/3/2025 9:58 PM, Richard Heathfield wrote:
    [Post in comp.lang.c, read in comp.lang.c]

    On 04/04/2025 03:45, olcott wrote:
    On 4/3/2025 9:39 PM, Richard Heathfield wrote:
    [Post in comp.lang.c, read in comp.lang.c]

    On 04/04/2025 02:27, olcott wrote:
    void DDD()
    {
        HHH(DDD);
        return;
    }

    Do you really think that anyone knowing the C
    programming language is too stupid to see that
    DDD simulated by HHH cannot possibly return?

    Anyone knowing the C language will know on seeing your code that

    I am correct

    Oh, I see. Yes, of course you are. Well done.

    "DDD simulated by HHH cannot possibly return".

    Then HHH cannot possibly simulate DDD.

    everything else is off-topic for this post.

    And HHH() is off-topic for this newsgroup. You started the thread in comp.lang.c, so to make it topical you'd have to rewrite HHH() in C
    instead of peppering your code with assembly language calls.


    The halting problem in C would seem to be relevant to C groups

    typedef void (*ptr)();
    int HHH(ptr P);


    int DD()
    {
    int Halt_Status = HHH(DD);
    if (Halt_Status)
    HERE: goto HERE;
    return Halt_Status;
    }

    int main()
    {
    HHH(DD);
    }

    DD simulated by HHH gets stuck on its first line.
    --
    Copyright 2025 Olcott "Talent hits a target no one else can hit; Genius
    hits a target no one else can see." Arthur Schopenhauer
    --- Synchronet 3.20c-Linux NewsLink 1.2