In beam search, we use the step index that is associated with each state: the parser states in process are aligned according to the index, and the beam search pruning is applied to those states with the same index.
for the beam search to function effectively, all states with the same index must be comparable, and all terminal states should have the same step index.