genem: minor simplifications

* tests/python/genem.py: Use SPOT_ON_ACC explicitely.
* spot/twaalgos/genem.cc: Do not keep track of states.  Don't
check that the clauses of the disjuncts are Fin-less: they aren't
(this was discovered while discussing with Jan and Fanda).
This commit is contained in:
Alexandre Duret-Lutz 2019-03-19 17:11:43 +01:00
parent f2f7cb2bc8
commit af67c04a67
2 changed files with 18 additions and 21 deletions

View file

@ -86,8 +86,7 @@ namespace spot
acc = acc.remove(si.common_sets_of(scc), false); acc = acc.remove(si.common_sets_of(scc), false);
temporary_acc_set tmp(si.get_aut(), acc); temporary_acc_set tmp(si.get_aut(), acc);
scc_info upper_si(si.get_aut(), si.one_state_of(scc), filter, &data, scc_info upper_si(si.get_aut(), si.one_state_of(scc), filter, &data,
scc_info_options::STOP_ON_ACC scc_info_options::STOP_ON_ACC);
| scc_info_options::TRACK_STATES);
const int accepting_scc = upper_si.one_accepting_scc(); const int accepting_scc = upper_si.one_accepting_scc();
if (accepting_scc >= 0) if (accepting_scc >= 0)
@ -144,12 +143,13 @@ namespace spot
do do
{ {
--pos; --pos;
if (pos->sub.op != acc_cond::acc_op::Inf)
{
acc_cond::acc_code one(pos); acc_cond::acc_code one(pos);
// This sets the acceptance of the automaton we
// are working on.
tmp.set(one); tmp.set(one);
if (si.get_aut()->acc().uses_fin_acceptance()) // Because we use scc_info with STOP_ON_ACC and test
{ // for this, every clauses should contain a Fin. Also
assert(si.get_aut()->acc().uses_fin_acceptance());
acc_cond::mark_t plus = {}; acc_cond::mark_t plus = {};
if (acc_cond::mark_t fu = one.fin_unit()) if (acc_cond::mark_t fu = one.fin_unit())
plus = fu; plus = fu;
@ -158,8 +158,6 @@ namespace spot
generic_emptiness_check_for_scc_nocopy generic_emptiness_check_for_scc_nocopy
<deal_with_disjunct>)) <deal_with_disjunct>))
return false; return false;
}
}
pos -= pos->sub.size; pos -= pos->sub.size;
} }
while (pos > start); while (pos > start);
@ -216,8 +214,7 @@ namespace spot
return aut->is_empty(); return aut->is_empty();
} }
scc_info si(aut, scc_info_options::STOP_ON_ACC scc_info si(aut, scc_info_options::STOP_ON_ACC);
| scc_info_options::TRACK_STATES);
const int accepting_scc = si.one_accepting_scc(); const int accepting_scc = si.one_accepting_scc();
if (accepting_scc >= 0) if (accepting_scc >= 0)

View file

@ -141,7 +141,7 @@ def generic_emptiness2_rec(aut):
# algorithm. # algorithm.
if not aut.acc().uses_fin_acceptance(): if not aut.acc().uses_fin_acceptance():
return aut.is_empty() return aut.is_empty()
si = spot.scc_info(aut, True) si = spot.scc_info(aut, spot.scc_info_options_STOP_ON_ACC)
acc_scc = si.one_accepting_scc() acc_scc = si.one_accepting_scc()
if acc_scc >= 0: if acc_scc >= 0:
return False return False