State s = res.getState(i);
State oldState = newToOldStateMap[s.getId()];
if (cl[oldState.getId()] != null) {
for (State pathFinalState : cl[oldState.getId()].keySet()) {
State s1 = pathFinalState;
if (s1.getFinalWeight() != semiring.zero()) {
s.setFinalWeight(semiring.plus(s.getFinalWeight(),
semiring.times(getPathWeight(oldState, s1, cl),
s1.getFinalWeight())));
}
int numArcs = s1.getNumArcs();