zlacker

[parent] [thread] 1 comments
1. pca006+(OP)[view] [source] 2022-10-02 16:05:29
No, panic is not halting, you just need some static check to check that you never call some functions that can panic in your code. Essentially it is just checking if some code (panic) might be reachable, if it is not, it will never panic (but it can still do other crazy things).

Note that we can only check for maybe, because in general we don't know if some code in the middle will somehow execute forever and never reach the panic call after it.

replies(1): >>roywig+h4
2. roywig+h4[view] [source] 2022-10-02 16:27:25
>>pca006+(OP)
Even if it is halting, you can sometimes statically detect if a Turing machine never halts. Just look through the state machine and see if any states will transition to a halt; if none of them do, the machine will loop forever. This is not a very large fraction of machines that loop forever, but if you're writing a machine and want to be absolutely sure it won't halt, just don't put in any states that halt.
[go to top]