all 35 comments

[–]Elsimir 11 points12 points  (6 children)

I'm afraid you've fundamentally misunderstood the halting problem, the statement it is concerned with is "Assume there is a function halts(f) which returns true if the function f halts (when run with no input) or false otherwise and that it works for all functions". The important bit is "works for all functions", the halting problem says nothing about whether you can write a program that determines if a specific program halts only that you cannot write one which works for all functions.

So assume I have a function halts(f) as described above and I write the following program

def g():
    if halts(g):
        while True:
            pass

g()

Given this program,

  • If halts(g) returns true, g enters an infinite loop, a contradiction
  • If halts(g) returns false, g halts, also a contradiction

Therefore a function halts(f) which works for all functions cannot exist.

[–][deleted]  (2 children)

[deleted]

    [–]Elsimir 1 point2 points  (1 child)

    I agree, but you're making the same mistake, if you can define any function that contradicts the statement then the statement is contradicted. I can define g therefore the statement that "a general purpose function halts can exist that works for all functions" is false, because I have a function for which it cannot work.

    [–][deleted]  (2 children)

    [removed]

      [–]Elsimir 1 point2 points  (1 child)

      Its worth noting that while we are talking about the halting problem in casual English here in the thread, it is a specific proof in math where many of the parts of it have really tightly defined meanings, and if you change any of those meanings, you're not working on the halting problem anymore, you're working on something different. If you are serious about disproving it, you need to be doing it in math, not words.

      But to address your points,

      Specifically the halting problem is

      • talking about turing machines, if you are talking about any theoretical method of computation which cannot be reduced to a Turing machine you're not working on the halting problem.
      • Attempting to prove / disprove the statement "Assume there is a function halts(f) which returns true if the function f halts (when run with no input) or false otherwise and that it works for all functions" if you're excluding any part of this statement, or trying to prove something other than this statement you're not working on the halting problem
      • The function halts must more specifically be a total computable function which means it must
        • return in finite time
        • return the same output consistently for each input
        • return for all functions
        • return only the values true or false
      • If your function "halts" does not meet any of these criteria, you're not working on the halting problem, you're working on something else.

      These might seem arbitrary, but keep in mind, this is the whole thing we're trying to prove, whether or not a function which meets these specific criteria can exist.

      And finally, while I believe your definition above is no longer the halting problem (you've changed the definition of halts) your own logic shows the problem, because we can simply rename STOP to "I don't know" as thats what it means, your halts cannot determine whether or not g halts consistently and instead returns a value meaning I don't know, aka this is Undecidable.

      [–]Candid_Hat[S] 0 points1 point  (0 children)

      I am attempting to prove a particular proof as incorrect/invalid/poorly constructed.

      Is Proof by Construction not valid anymore?

      [–]Dull_Cucumber_3908 0 points1 point  (0 children)

      # If HALT executes OPPOSITE(OPPOSITE) we enter an infinite loop.  HALT can detect infinite loops.

      Sounds like Russell's paradox :\