Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • "nearly" is the bit I'm asking. Is there are finite class of problems for which a program can be said to halt and how limited is the problem set? For instance the statement if(i<10) then print(i) does halt for all i. If I restrict the domain of i to 32 bit integers then it too halts. Commented Dec 19, 2011 at 4:54
  • Keep in mind a for loop is a while loop, and people often put more complicated things in the condition term than just x < 42. Commented Dec 19, 2011 at 5:38
  • @BillyONeal: Good point. In Python a for loop is very, very tightly constrained to work through an iterator. A more general for loop in Java, however, can include extra conditions that invalidate simple use of an iterator. Commented Dec 19, 2011 at 14:11
  • "Is there are finite class of problems for which a program can be said to halt?" The answer remains yes. "how limited is the problem set?" Um. Finite is finite. If you give up on trying to approximate real numbers and stick to natural numbers, closed under all mathematical operations, you're doing ordinary group theory. Modular arithmetic. Nothing special. It's not clear what you're asking. Are you asking what modular arithmetic is? Commented Dec 19, 2011 at 14:15
  • @S.Lott I mean numbers as represented in a machine, not numbers in the abstract sense. So think of numbers as a fixed number of bits. These numbers have slightly different rules from the integers and reals. Hope that makes sense. Commented Dec 19, 2011 at 22:50