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 #156

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

Comments

@haesleinhuepf
Copy link
Owner

git-bob, please comment on how to write a python program that decides if a program halts eventually or not, depending on the given program code and a given input sequence.

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! 👋

This is a classic example of the halting problem, which is known to be undecidable. This means it's impossible to write a program that can determine for any given program and input whether it will halt or run forever.

Alan Turing mathematically proved this in 1936. If you're interested in why this is the case, I recommend reading about the halting problem proof.

Therefore, I cannot provide code that solves this problem in general. There are specific cases where we can determine if code will halt, but no universal solution exists.

Let me know if you'd like to explore specific scenarios where we can analyze program behavior! 😊

Best regards,
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