Questions tagged [halting-problem]

The halting problem is a famous problem in theoretical computer science. Given as input a description of a program (typically a Turing machine) and an input to that program, the Halting problem is to decide whether that program terminates on that input.

The Halting Problem is a fundamental limitation on computability - that, given a program and a machine with infinite memory (usually a Turing Machine), it is impossible to know if the program will halt for a given input.

Although a program can be checked to see if it will halt on physical computers (because of limited memory), heuristics are used instead of an actual solution.

Here, most questions will have to do with how it impacts everyday coding and finding heuristics for code analysis purposes. However, consider asking your question on Computer Science if it is very abstract.

79 questions
1
vote
1 answer

Why can't an infinite loop be eliminated?

The "as-if" rule is covered by these rules: The least requirements on a conforming implementation are: Access to volatile objects are evaluated strictly according to the rules of the abstract machine. At program termination, all data written into…
1
vote
1 answer

Why do we need to use the negation part in Turing's Halting Proof?

For instance, let's say I have this Turing machine, H, which tells us whether or not a program and input will halt. Let's say we call H on itself. It has to give an answer, so if it prints out "does not halt" then didn't it technically halt to print…
rb612
  • 5,280
  • 3
  • 30
  • 68
1
vote
4 answers

Turing machine halting problem

I have a question about turing machines and halting problem. Suppose that we have Atm = {(M,w) where M is a turing machine and w is an input} and HALTtm = {(M,w) where M is a turing machine halts with an input w} I want to prove that HALTtm <=m…
iva123
  • 3,395
  • 10
  • 47
  • 68
1
vote
1 answer

How do I avoid non-halting functions?

I'm trying to find an algorithm on writing a high-level function - that doesn't have to halt - in Python (or Pseudo Code) that for a given list of functions [f1,...,fn] and a given list of inputs [x1,...,xn] prints fi(xj) (meaning all the pairs of…
Kyle
  • 154
  • 1
  • 2
  • 13
0
votes
0 answers

Subset of programs for which we can determine if the program will halt

We know about the halting problem that states that there is in general no way to determine if a program will halt. However, for certain programs we can certainly say that they will halt. For example a simple for loop. So my question is, is there a…
0
votes
0 answers

Custom exception class for continuing to program

In my program, I have created doubly linked list. For inserting and deleting I have defined methods Insert(int element,int pos) and Delete (int pos). Those two methods throw exception. In the same class I have defined Exception LinkedListException()…
0
votes
0 answers

What problem type the Power Set belong to?

I don't seem to find any much resource about "Power Set" problem. Is Power Set a NP-Complete or NP-Hard problem? And why? Can someone advise me?
Steven-Carrot
  • 2,368
  • 2
  • 12
  • 37
0
votes
1 answer

The difference between halting and accepting in a Turing machine

I use the textbook "an introduction to formal languages and automata", 6th edition by Peter Linz. In Definition 11.2, it seems that a Turing machine "M accepts language L" and "M halts on string w" are different things? I mean, why does the author…
RyanKao
  • 321
  • 1
  • 5
  • 14
0
votes
0 answers

MySQL keeps ignoring MAX_EXECUTION_TIME

I am running a node server with mysql8. This query keeps popping up and freezing. SELECT /*+ MAX_EXECUTION_TIME(2000) */ COUNT(*) FROM my_table Even though this query have MAX_EXECUTION_TIME mentioned in it, It keeps executing well past this limit…
vaibhav3027
  • 51
  • 1
  • 6
0
votes
0 answers

Is Rice's Theorem equivalent to the Halting problem?

As I understand it Rice's Theorem seems to imply the existence of the Halting problem. That is, with Rice's Theorem, we can prove that the Halting problem is undecidable. However, to me, it seems like one could write a proof using that the Halting…
0
votes
4 answers

Verifying halting-problem on self-implemented pseudo-assembly

I wrote a very simple implementation of what could be a similarity to Assembly/machine code. It is even capable of recursion as in this example: 9 6 IFEQ R0,0 RET 1 ENDIF MOV R1,R0 SUB R1,1 CALL R1 MOV R2,R9 MUL R2,R0 RET R2 Output: 720 (factorial…
Vinícius
  • 15,498
  • 3
  • 29
  • 53
0
votes
2 answers

the halting problem and background compilation?

I'm trying to figure out how I could write an autocompletion algorithm for Lua, but since as with many scripting languages it lacks a static type system I think I need background compilation, but during background compilation it's easy to hit the…
Robert Gould
  • 68,773
  • 61
  • 187
  • 272
0
votes
2 answers

Android 3.0 emulator launching issue

I am trying to test a simple status bar notification program on Android 3.0 emulator. When I try to run my application from eclipse, sometimes either I see a message that apk can't be installed when I check the DDMS log, I see java outOfMemory…
0
votes
2 answers

Python - long halt while calculating palindrome number

I'm trying to find largest palindromic number made from the product of two 3-digit numbers with my code. it works fine for 2-digit and 3-digit, but when I try it with 4-digit numbers, it doesn't work anymore. There is no output or "Process finished…
0
votes
1 answer

A slightly different version of the halting problemo

I got stuck with a question and would like to have a little guidance for the solution. I need to prove that the next problem is undecidable: Input - A program Problem - Does the number of possible inputs for which the program halts is larger than…
Eddie Romanenco
  • 311
  • 4
  • 16