IdentityHashMap<State, Formula> ret = new IdentityHashMap<State, Formula>();
Formula collect = null;
List<Transition> transitions = root.getSortedTransitions(false);
for (Transition transition : transitions) {
State next = transition.getDest();
AndFormula tmp1 = new AndFormula(new RelConstant(i,transition.getMin(),">="), new RelConstant(i,transition.getMax(),"<="));
Formula tmp2 = ret.get(next);
if (tmp2 != null) {
OrFormula tmp3 = new OrFormula(tmp2,tmp1);
ret.put(next, tmp3);
} else {
ret.put(next,tmp1);
}
}
if (i < n) {
for (State next : ret.keySet()) {
Formula suffix = createFormula(next, i + 1, n);
if (suffix != null) {
Formula tmp4 = new AndFormula(ret.get(next), suffix);
if (collect == null) {
collect = tmp4;
} else {
collect = new OrFormula(collect, tmp4);
}
}
}
} else {
for (State next : ret.keySet()) {
if (next.isAccept()) {
if (collect == null) {
collect = ret.get(next);
} else {
collect = new OrFormula(collect, ret.get(next));
}