In the case where the node γ[i] belongs to σ, i.e., i < , we assign loss contribution 0 to the entry at the top of the stack.
if γ[i] is in β, i.e., i ≥ , we assign loss contribution 0 to several entries in T [i, i + 1] (line 6) because, at the time γ[i] is shifted, the content of the stack depends on the transitions executed before that point.