* src/tgbaalgos/complete.cc: Introduce a sink state only if needed.
This commit is contained in:
parent
d28e7f9c5c
commit
99d28c3cc2
1 changed files with 13 additions and 9 deletions
|
|
@ -61,12 +61,6 @@ namespace spot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If we haven't found any sink, simply add one.
|
|
||||||
if (sink == -1U)
|
|
||||||
{
|
|
||||||
sink = aut->new_state();
|
|
||||||
++n;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now complete all states (including the sink).
|
// Now complete all states (including the sink).
|
||||||
for (unsigned i = 0; i < n; ++i)
|
for (unsigned i = 0; i < n; ++i)
|
||||||
|
|
@ -91,10 +85,20 @@ namespace spot
|
||||||
// state.
|
// state.
|
||||||
acc = t.acc;
|
acc = t.acc;
|
||||||
}
|
}
|
||||||
// In case the automaton use state-based acceptance, propagate
|
// If the state has incomplete successors, we need to add a
|
||||||
// the acceptance of the first transition to the one we add.
|
// transition to some sink state.
|
||||||
if (missingcond != bddfalse)
|
if (missingcond != bddfalse)
|
||||||
aut->new_transition(i, sink, missingcond, acc);
|
{
|
||||||
|
// If we haven't found any sink, simply add one.
|
||||||
|
if (sink == -1U)
|
||||||
|
{
|
||||||
|
sink = aut->new_state();
|
||||||
|
++n;
|
||||||
|
}
|
||||||
|
// In case the automaton use state-based acceptance, propagate
|
||||||
|
// the acceptance of the first transition to the one we add.
|
||||||
|
aut->new_transition(i, sink, missingcond, acc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return sink;
|
return sink;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue