Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6155857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:30:36+00:00 2026-05-23T20:30:36+00:00

Is detecting whether a deterministic program (i.e. state machine) is in an infinite loop

  • 0

Is detecting whether a deterministic program (i.e. state machine) is in an infinite loop equivalent to solving the halting problem?

I came up with a solution, and I’m not sure why it shouldn’t work:

  • Let the program run
  • When you think it’s in an infinite loop, take a snapshot of its memory regular intervals
  • If you ever detect the same snapshot, the program is in an infinite loop
  • As long as you don’t get the same snapshot twice, it’s either (1) not in an infinite loop, or (2) you need to take snapshots more quickly (perhaps once on every memory access?)

I’m assuming this doesn’t work… but why?

It seems like a perfectly reasonable way to detect if a program is in an infinite loop (e.g. especially if you store hashes rather than the memory itself, although that will not be 100% accurate)… what’s wrong with it, if anything?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:30:37+00:00Added an answer on May 23, 2026 at 8:30 pm

    The solution wouldn’t work even in principle. A Turing machine doesn’t have to ever be in precisely the same state (with the tape in the same configuration) to get into an infinite loop.

    Your algorithm might work for context-sensitive languages and linear-bounded automata, but if you can’t know how much tape a TM is going to need, you’d never know if you had an infinite loop or were about to hit the top. Note that your method would clearly work for real computers for a variety of reasons… chief among them being that your computer is less powerful than a (big) finite automaton.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: iOS - Detecting whether or not device support phone calls? I'm writing
I need a safe (i.e consistent, robust) way of detecting whether or not the
I'm looking at a simple, programmatic way of detecting whether or not the user
I'm wondering if someone has a method for detecting whether or not a thread
I am detecting the machine Idle state and if Idle, I perform an action.
What's a surefire way of detecting whether a user has Firebug enabled?
Any reliable elegant way of detecting whether the current app is a win or
Is there some way of detecting whether an enumerable built using LINQ (to Objects
Possible Duplicate: Detecting whether a user is behind a proxy Is there a way
Is there a way to find how many values an array has? Detecting whether

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.