halting-problem

How do you apply Theoretical Computer Science?

Why is theory useful? Do you ever use it in your day-to-day coding? For example, we learned about the halting problem, Turing machines, reductions, etc... a lot of classmates are saying it's abstract and useless and there's no real point to knowning any of it (meaning, you can forget it once the course is over and not lose anything). ...

The Halting Problem in the Field

When have you ever personally come upon the halting problem in the field? This can be when a co-worker / boss suggested a solution which would violate the fundamental limits of computation, or when you realized yourself that a problem you were trying to solve was, in fact, impossible to solve. The most recent time I came up with it was ...

Practical non-Turing-complete languages?

Nearly all programming languages used are Turing Complete, and while this affords the language to represent any computable algorithm, it also comes with its own set of problems. Seeing as all the algorithms I write are intended to halt, I would like to be able to represent them in a language that guarantees they will halt. Regular expre...

Detecting infinite loop in brainfuck program

I have written a simple brainfuck interpreter in MATLAB script language. It is fed random bf programs to execute (as part of a genetic algorithm project). The problem I face is, the program turns out to have an infinite loop in a sizeable number of cases, and hence the GA gets stuck at the point. So, I need a mechanism to detect infinite...

Can the halting problem be solved for any non-turing languages?

The halting problem cannot be solved for turing complete languages and it can be solved trivially for some non TC languages like regexes where it always halts. I was wondering if there are any languages where it has both the ability to halt and not halt and there is also an algorithm that can determine whether it halts. ...

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 halting problem so I was wondering if anyone has solved this sort of thing before, and what ...

What would programming languages look like if every computable thing could be done in 1 second?

Inspired by this question Suppose we had a magical turing machine with infinite memory, and unlimited CPU power. Use your imagination as to how this might be possible, e.g. it uses some sort of hyperspace continuum to automatically parallelize anything as much as is desired, so that it could calculate the answer to any computable quest...

What exactly is the halting problem?

Whenever people ask about the halting problem as it pertains to programming, people respond with "If you just add one loop, you've got the halting program and therefore you can't automate task" Makes sense. If your program has an infinite loop, then when your program is running, you have no way of knowing whether the program is still cr...

Do all regular expressions halt?

Is there any regular expression that will, for some input string, search for a match forever? ...

iPhone + UITableView + row height problem

Hi, I am setting the row height of my UITableView using following code [tableView setRowHeight: 100.00]; I am using the single line as separator in the UITableView. Eventhough setting the height above, height of row does not get change. Please help me ...

Is there a "good enough" solution for the halting problem?

It is known that the halting problem cannot have a definite solution, one that a) returns true <==> the program does indeed halt, and b) handles any input, but I was wondering if there are good enough solutions to the problem, ones that can maybe handle certain types of program flows perfectly, or are able to identify when it cannot corr...

Turing machine halting problem

Hi, 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 Atm I've tried some methods but I think they're far from the solution. Anyone can gi...

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

Hello all 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 my work . Thanks for help. ...

Strange problems with Jammit

Hi, i use Jammit to pack all the .css and .js files in my project I faced a strange problem, that really confused me... When Jammit deals with .css, it kills some css rules. The rules: background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0, #111111), color-stop(1, #303030) ); background-image: -moz-linear-g...

Controller action is called twice

I've noticed, that "index" action of my controller is called twice. The action has following structure: def index if params[:tags].nil? # [fork #1] just return the whole collection of model @items = Item.all else # [fork #2] filter items by tags @items = Item.select_by_tags params[:tags] end # Another oper...