Python 3.8 (pre-release), 242248 bytes
def h(i):
p=P=d=0;D=1;v=[]
while 1:
try:p+=d;P+=D;r=i[p][P]
except:return 1
if[p,P]in v:return 0
if'H'==r and D or'I'==r and d or'<>^vHIO'.find(r)<0:return 1
ifL=r rin'<>^v';v+=[[p,P]]*L
in'<>^v' if L:d=r>']'and' v'.find(r);D=r<'?'and' >'.find(r)
v+=[[p,P]]
Wrong output for fourth falsy case but it seems like the output should in fact be truthy (the automaton hits a space and halts). I am waiting for clarification from the OP on this. Works on all other testcases.
Nothing too complex; just moves around as dictated by the input. The only part of note here is how to check whether to halt at an H
or I
location. For H
, this is done by checking that D
, which is the horizontal movement variable, is truthy, because it is truthy if it is not zero, and if it is not zero then the automaton is moving from the left or right. If it is zero then it is moving from the top or bottom. Similar for I
but we check d
(vertical movement) instead.
+6 bytes to fix bug pointed out by @tsh in comments, which means that the output for the third "falsey" case is now 1. However, it would appear that this is the correct answer.