Check if a list of statements is safe.
(check-safe-statement-list stmts varset funtab) → varsmodes
We check the statements, one after the other, threading through the variable table.
If the list of statements is empty, the termination mode is regular. Otherwise, we have a set of possible termination modes for the first statement, and a set of possible termination modes for the remaining sets. If the first set includes regular mode, we take the union of the two sets; otherwise, we just return the first set because execution of the list of statements ends there. Note that we still check the safety of the remaining statements, even when they are not reachable.