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
0
votes
2 answers

Is non-deterministic running time really so bad?

When I here about the halting problem, it sounds like non-termination is something to avoid and that the halting problem makes it impossible to know if the program/algorithm is good. But when I think about it, aren't terminating programs the…
Angeldude
  • 1
  • 1
0
votes
2 answers

Understanding the meaning of CheckHalt(X,X) in the proof of a theorem in Sussana Epp's Discrete Mathematics with applications

I have a very basic exposure to algorithms. I am a graduate in Mathematics. I was reading Halting Problem in the book Discrete Mathematics with applicationbs by Susanna Epp. It has a following theorem : Theorem : There is no computer algorithm…
Error 404
  • 101
  • 2
0
votes
1 answer

Proving Equivalence of TM and DFA

I'm trying to prove that TM = DFA is undecidable using reduction from Halting Problem Theoretically I understand that Turing Machine captures all the computable functions and DFA only capture the functions that can be computed in constant space…
0
votes
1 answer

Meteor - detecting infinite loop

Here's the essence of some code (with associated data) for a Meteor application for counting things. Counts can be linked together so that one can increase another: // The counting and linking code. Meteor.methods({ 'counts.increment'(countId)…
knirirr
  • 1,860
  • 4
  • 23
  • 37
0
votes
1 answer

Can the halting prοblem be sοlved for certain finite functions?

It is my understanding that for a sufficiently simple function, let's say function(boolean input){ while(input){ } } it is possible to tell if it will halt for any possible input. It is easy to see that the above function will terminate for…
Mr. Negi
  • 154
  • 1
  • 15
0
votes
1 answer

Letter substitutions termination

Given: A char string S length l containing only characters from 'a' to 'z' A set of ordered substitution rules R (in the form X->Y) where x, y are single letters from 'a' to 'z' (eg, 'a' -> ' e' could be a valid rule but 'ce'->'abc' would never…
0
votes
1 answer

what is exactly the reason of halting

The halting problem states that given an input and a program, there is no algorithm that can decide weather the program will halt. This renders this problem undecidable. My misunderstanding of the halting problem is that, can't we just create…
0
votes
2 answers

Recognition of Undecidable Propositions(infinite loop)

Say I want to find a natural number n which n+n=3 To solve this computationally, I would run an algorithm: int n = 1; while(n+n!=3) n++; System.out.println(n); Of course we know that this loop is an infinite loop. But is there an algorithm that…
new
  • 329
  • 3
  • 11
0
votes
0 answers

Can halting function be created without referring/assembling/generation of the solver in the input?

The question is: can the halting problem be solved if the solver is not being assembled/emulated/generated/recreated/put your choice here/used in any form inside the analyzed function? There is a very similar question: Is it possible to make a…
Elstan
  • 1
0
votes
1 answer

scala compiler's stackoverflow protection

In runtime I can: def X(R: Any): Any = X(R) But can't do simmilar thing for compile-time: scala> type X[R] = X[R] :11: error: illegal cyclic reference involving type X type X[R] = X[R] ^ Seems like infinite…
dk14
  • 22,206
  • 4
  • 51
  • 88
0
votes
1 answer

java timeout thread for connection to wrong server

I've got a problem. I want to connect to a Game-Server with an IP that is put in by the user. As long as the server is the right one or the Server doesn't exist everything is fine, I've got a connection or an Exception. The Problem is, if I put in…
0
votes
4 answers

why there can't be a program that checks another program

I am trying to find the logical alan turing explanation why there can't be a program that checks another programs. I remember we learned in on the computation course but now i just can't find the solution , and i need to explain it to some one at…
Night Walker
  • 20,638
  • 52
  • 151
  • 228
0
votes
2 answers

non-strict evaluation in Haskell regarding halting-prob

Suppose there exists a Haskel-function realizing the halt-problem: halt :: Integer->Bool that evaluates to True if x is defined and to False otherwise. Let's assume we are calling this function in Haskell in another function as fHalt x = halt…
Rodney
  • 205
  • 2
  • 7
0
votes
3 answers

A function that can catch infinite recursion in python?

I would've thought a question like this should be answered but it seems I can't find any of the solution in google. So anyawy. Can anyone give me or link me a builtin function where it will check whether the function is infinite recursing? A…
Jimson
  • 25
  • 4
0
votes
1 answer

Can a Turing machine decide if a formal model of computation is Turing complete?

That is, can a Turing machine take a formal system, S, as its input and decide if S is Turing complete? I think this is an undecidable problem, am I right? If it is undecidable, why can we (as humans) decide Turing completeness?