improve partial_degeneralize() on several cases

On these 4 cases, added to pdegen.py, and supplied by Florian Renkin,
partial_degeneralize() is now at least as good as degeneralize_tba(),
and sometimes better.  This is achieved as follows: (1) a
propagate_marks procedure is introduced to propagate marks as far as
possible on the automaton (e.g., common outgoing marks can be push
onto the incoming transitions and vice-versa), (2) the
degeneralization order is compute dynamically, and (3) whenever and
fully-accepting transition is taken in the original automaton, the
destination level is chosen to be the highest existing level.

* spot/twaalgos/degen.cc,
spot/twaalgos/degen.hh (propagate_marks_vector, propagate_marks_here):
New functions.
(partial_degeneralize): Improve, as described above.
* tests/python/pdegen.py: Add test cases.
This commit is contained in:
Alexandre Duret-Lutz 2020-02-02 23:01:33 +01:00
parent da3333477f
commit f1008c156b
4 changed files with 313 additions and 64 deletions

12
NEWS
View file

@ -58,7 +58,7 @@ New in spot 2.8.5.dev (not yet released)
parity_min_even(n) = parity_min(false, n)
- partial_degeneralize() is a new function performing partial
degeneralization to get rid of conjunction of Inf terms in
degeneralization to get rid of conjunctions of Inf terms in
acceptance conditions.
- simplify_acceptance_here() and simplify_acceptance() learned to
@ -68,6 +68,16 @@ New in spot 2.8.5.dev (not yet released)
and the automaton is adjusted to that i also appears where j
appeared.
- propagate_marks_vector() and propagate_marks_here() are helper
functions for propagatings marks on the automaton: ignoring
self-loop and out-of-SCC transitions, marks common to all the
input transitions of a state can be pushed to all outgoing
transitions of a state, and vice-versa. This is repeated until a
fix point is reached. propagate_marks_vector() does not modify
the automaton and returns a vector of the acc_cond::mark_t that
should be on each transition; propagate_marks_here() actually
modifies the automaton.
New in spot 2.8.5 (2020-01-04)
Bugs fixed: