c++11: introduce tgba::succ(s) to replace tgba::succ_iter(s).
| tgba_succ_iterator* i = aut->succ_iter(s);
| for (i->begin(); !i->done(); i->next())
| {
| // ...
| }
| delete i;
becomes
| for (auto i: aut->succ(s))
| {
| // ...
| }
hiding the begin()/done()/next() interface, taking care of the delete,
and allowing more optimization to come.
* src/tgba/succiter.hh, src/tgba/tgba.hh: Implement the above
new interface.
* iface/gspn/ssp.cc, src/dstarparse/nsa2tgba.cc,
src/saba/sabacomplementtgba.cc, src/tgba/tgbakvcomplement.cc,
src/tgba/tgbamask.cc, src/tgba/tgbasafracomplement.cc,
src/tgba/tgbatba.cc, src/tgbaalgos/compsusp.cc, src/tgbaalgos/cutscc.cc,
src/tgbaalgos/degen.cc, src/tgbaalgos/emptiness.cc,
src/tgbaalgos/isdet.cc, src/tgbaalgos/ltl2tgba_fm.cc,
src/tgbaalgos/minimize.cc, src/tgbaalgos/powerset.cc,
src/tgbaalgos/safety.cc, src/tgbaalgos/simulation.cc,
src/tgbaalgos/tau03.cc, src/tgbatest/explicit2.cc: Update for
loops.
This commit is contained in:
parent
f59773e3c7
commit
487cd01d9f
21 changed files with 418 additions and 522 deletions
|
|
@ -88,8 +88,7 @@ namespace spot
|
|||
unsigned s1 = sm_ ? sm_->scc_of_state(s) : 0;
|
||||
bdd common = a_->all_acceptance_conditions();
|
||||
bdd union_ = bddfalse;
|
||||
tgba_succ_iterator* it = a_->succ_iter(s);
|
||||
for (it->first(); !it->done(); it->next())
|
||||
for (auto it: a_->succ(s))
|
||||
{
|
||||
// Ignore transitions that leave the SCC of s.
|
||||
const state* d = it->current_state();
|
||||
|
|
@ -102,7 +101,6 @@ namespace spot
|
|||
common &= set;
|
||||
union_ |= set;
|
||||
}
|
||||
delete it;
|
||||
cache_entry e(common, union_);
|
||||
return cache_.insert(std::make_pair(s, e)).first;
|
||||
}
|
||||
|
|
@ -150,8 +148,7 @@ namespace spot
|
|||
if (p.second)
|
||||
{
|
||||
bdd all = a_->all_acceptance_conditions();
|
||||
tgba_succ_iterator* it = a_->succ_iter(s);
|
||||
for (it->first(); !it->done(); it->next())
|
||||
for (auto it: a_->succ(s))
|
||||
{
|
||||
// Look only for transitions that are accepting.
|
||||
if (all != it->current_acceptance_conditions())
|
||||
|
|
@ -164,7 +161,6 @@ namespace spot
|
|||
break;
|
||||
}
|
||||
}
|
||||
delete it;
|
||||
}
|
||||
return p.first->second;
|
||||
}
|
||||
|
|
@ -387,8 +383,7 @@ namespace spot
|
|||
if (use_scc)
|
||||
s_scc = m.scc_of_state(s.first);
|
||||
|
||||
tgba_succ_iterator* i = a->succ_iter(s.first);
|
||||
for (i->first(); !i->done(); i->next())
|
||||
for (auto i: a->succ(s.first))
|
||||
{
|
||||
degen_state d(uniq(i->current_state()), 0);
|
||||
|
||||
|
|
@ -576,7 +571,6 @@ namespace spot
|
|||
t->condition |= i->current_condition();
|
||||
}
|
||||
}
|
||||
delete i;
|
||||
tr_cache.clear();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue