4The beginning-of-stage and end-of-stage value functions for each stage must be defined over compatible state variables, so that the output of any stage can serve as the input to any other; see the discussion in section 8.