postprocess: call restrict_dead_end_edges_here()

Related to issue #587.

* spot/twaalgos/postproc.cc, spot/twaalgos/postproc.hh: Add
support for option "rde".
* bin/spot-x.cc, NEWS: Mention it.
* tests/core/deadends.test, tests/core/ltl2tgba2.test,
tests/python/atva16-fig2a.ipynb, tests/python/deadends.py: Adjust test
cases to reflect the improvement.
* tests/core/ltlsynt.test: Also adjust this test case, which is the
only one worsened.  Some extra gates are generated when translating
GFa<->GFb with --algo=ds or --algo=sd.  Issue #588 would be one way to
fix that.
This commit is contained in:
Alexandre Duret-Lutz 2024-07-17 16:59:07 +02:00
parent 31511e042a
commit 6a7ef4db3f
9 changed files with 75 additions and 41 deletions

View file

@ -38,6 +38,7 @@
#include <spot/twaalgos/parity.hh>
#include <spot/twaalgos/cobuchi.hh>
#include <spot/twaalgos/cleanacc.hh>
#include <spot/twaalgos/deadends.hh>
#include <spot/twaalgos/toparity.hh>
#include <spot/twaalgos/zlktree.hh>
@ -108,6 +109,7 @@ namespace spot
wdba_det_max_ = opt->get("wdba-det-max", 4096);
simul_trans_pruning_ = opt->get("simul-trans-pruning", 512);
acd_ = opt->get("acd", 1);
rde_ = opt->get("rde", -1);
if (sat_acc_ && sat_minimize_ == 0)
sat_minimize_ = 1; // Dicho.
@ -527,6 +529,14 @@ namespace spot
}
}
// Restricting dead-end edges only makes sense on non-deterministic
// automata. rde_ == 0 disable this. rde_ > 0 enable it.
// By default (rde_ < 0), we only enable this on High and Medium+Det.
if (!dba && rde_ != 0 && !is_deterministic(sim) &&
(rde_ > 0 || (level_ == High ||
(level_ == Medium && PREF_ == Deterministic))))
restrict_dead_end_edges_here(sim);
// If WDBA failed, but the simulation returned a deterministic
// automaton, use it as dba.
assert(dba || sim);

View file

@ -271,6 +271,7 @@ namespace spot
int wdba_det_max_ = 4096;
bool acd_ = true;
bool acd_was_used_;
int rde_ = -1;
};
/// @}
}