@mcc
The length of the expected output list is known. So the program might die if this length is exceeded by the output list.
Yes, this feels hacky, but somehow you need to solve the halting problem.
And if you're at it, you could of course break an evaluation as soon as the output is not a prefix of the expected output.
So the CPU might keep the list of "expected remaining output" and "consume" it upon fitting output.