Check if a list of branches is statically well-formed.
(check-branch-list branches current-sup ctxt) → result
These are the branches that form a conditional expression, in which the order of the branches is significant. This means that each branch is checked in a context where the conditions of the preceding branches are negated (otherwise one of the preceding branches would be taken). Thus, as we process each branch, we augment the context with the negation of the branch condition just before processing the subsequent branches.
The type of a conditional is the supremum of
the types of the branches.
We calculate it by carrying and updating the type supremum
as we go through the branches:
this is the