Hang detection is an important part of exhaustive search. Without it, the search would take too long. Furthermore, there is no certainty that the Busy Beaver is not overlooked because it was assumed to hang.
The most simple type of hang is a No Data Hang. Here the program gets in a state where the program pointer repeatedly traverses the same path on the program grid and this path does not contain any DATA instructions. This means that the state of the data does not change. This in turn means that the program pointer always behaves the same when it encounters a TURN instruction. It will never exit this path, so the program hangs. Figure 1 shows an example of such a program.
Many hangs can be detected via static analysis of the interpreted program. This boils down to a single detection algorithm:
For hangs that cannot be detected statically, dynamic analysis can be used. Here the behaviour of the program is observed while it is being executed. Dynamic analysis has two main inputs:
For dynamic hang analysis, three program execution behaviors can be distinguished:
For more details see: