The Theory of Traces for Systems with Nondeterminism, Probability, and Termination