Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Programming question]: Determine if code contains an endless loop #157

Open
haesleinhuepf opened this issue Dec 13, 2024 · 1 comment
Open

Comments

@haesleinhuepf
Copy link
Owner

Write a python program that decides if a program halts eventually or not, depending on the given program code and a given input sequence.

git-bob comment

Copy link
Contributor

This message was generated by git-bob (version: 0.15.2, model: claude-3-5-sonnet-20241022, log), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.

Hi there!

Unfortunately, this is impossible to solve. According to the halting problem, there exists no algorithm that can determine for all possible program inputs whether a program will eventually halt or continue running forever.

The halting problem was proven to be undecidable by Alan Turing in 1936. This means there is no way to write a program that can analyze arbitrary code and determine with 100% certainty whether it will halt or run indefinitely.

@haesleinhuepf please correct me if I'm wrong, but I believe this is a fundamental computer science limitation.

Best,
git-bob

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant