Store membership to acceptance sets using bitsets, not BDDs.
This is a huge patch, that took over a month to complete. The bit sets are currently restricted to what 'unsigned can store', but it should be easy to extend it to 'uint64_t' should we need it. * NEWS: Update. * src/tgba/acc.hh: New file. * src/tgbatest/acc.cc, src/tgbatest/acc.test: Test it. * src/tgba/tgbakvcomplement.cc, src/tgba/tgbakvcomplement.hh, src/tgba/tgbasgba.cc, src/tgba/tgbasgba.hh: Delete. The KV complementation is too slow to be used in practice, and I somehow broke it during the conversion to bitsets. The tgba->sgba conversion was only used for the KV complementation, and should be better redone on tgba_digraph_ptr should it be needed again. * src/bin/ltlcross.cc, src/dstarparse/dra2ba.cc, src/dstarparse/nsa2tgba.cc, src/graphtest/tgbagraph.cc, src/graphtest/tgbagraph.test, src/kripke/fairkripke.cc, src/kripke/fairkripke.hh, src/kripke/kripke.cc, src/kripke/kripke.hh, src/kripke/kripkeexplicit.cc, src/kripke/kripkeexplicit.hh, src/misc/hash.hh, src/neverparse/neverclaimparse.yy, src/priv/accmap.hh, src/ta/ta.cc, src/ta/ta.hh, src/ta/taexplicit.cc, src/ta/taexplicit.hh, src/ta/taproduct.cc, src/ta/taproduct.hh, src/ta/tgta.cc, src/ta/tgta.hh, src/ta/tgtaexplicit.cc, src/ta/tgtaexplicit.hh, src/ta/tgtaproduct.cc, src/ta/tgtaproduct.hh, src/taalgos/dotty.cc, src/taalgos/emptinessta.cc, src/taalgos/minimize.cc, src/taalgos/tgba2ta.cc, src/tgba/Makefile.am, src/tgba/fwd.hh, src/tgba/taatgba.cc, src/tgba/taatgba.hh, src/tgba/tgba.cc, src/tgba/tgba.hh, src/tgba/tgbagraph.cc, src/tgba/tgbagraph.hh, src/tgba/tgbamask.cc, src/tgba/tgbamask.hh, src/tgba/tgbaproduct.cc, src/tgba/tgbaproduct.hh, src/tgba/tgbaproxy.cc, src/tgba/tgbaproxy.hh, src/tgba/tgbasafracomplement.cc, src/tgba/tgbasafracomplement.hh, src/tgbaalgos/bfssteps.cc, src/tgbaalgos/complete.cc, src/tgbaalgos/compsusp.cc, src/tgbaalgos/degen.cc, src/tgbaalgos/dotty.cc, src/tgbaalgos/dtbasat.cc, src/tgbaalgos/dtgbacomp.cc, src/tgbaalgos/dtgbasat.cc, src/tgbaalgos/dupexp.cc, src/tgbaalgos/emptiness.cc, src/tgbaalgos/emptiness.hh, src/tgbaalgos/gtec/ce.cc, src/tgbaalgos/gtec/gtec.cc, src/tgbaalgos/gtec/gtec.hh, src/tgbaalgos/gtec/sccstack.cc, src/tgbaalgos/gtec/sccstack.hh, src/tgbaalgos/gv04.cc, src/tgbaalgos/hoaf.cc, src/tgbaalgos/isweakscc.cc, src/tgbaalgos/lbtt.cc, src/tgbaalgos/ltl2tgba_fm.cc, src/tgbaalgos/magic.cc, src/tgbaalgos/ndfs_result.hxx, src/tgbaalgos/neverclaim.cc, src/tgbaalgos/postproc.cc, src/tgbaalgos/powerset.cc, src/tgbaalgos/randomgraph.cc, src/tgbaalgos/randomgraph.hh, src/tgbaalgos/reducerun.cc, src/tgbaalgos/replayrun.cc, src/tgbaalgos/safety.cc, src/tgbaalgos/save.cc, src/tgbaalgos/scc.cc, src/tgbaalgos/scc.hh, src/tgbaalgos/sccfilter.cc, src/tgbaalgos/sccinfo.cc, src/tgbaalgos/sccinfo.hh, src/tgbaalgos/se05.cc, src/tgbaalgos/simulation.cc, src/tgbaalgos/simulation.hh, src/tgbaalgos/stats.cc, src/tgbaalgos/stripacc.cc, src/tgbaalgos/tau03.cc, src/tgbaalgos/tau03opt.cc, src/tgbaalgos/weight.cc, src/tgbaalgos/weight.hh, src/tgbaparse/tgbaparse.yy, src/tgbatest/Makefile.am, src/tgbatest/complementation.cc, src/tgbatest/complementation.test, src/tgbatest/degenlskip.test, src/tgbatest/det.test, src/tgbatest/dstar.test, src/tgbatest/emptchk.cc, src/tgbatest/explpro2.test, src/tgbatest/explpro3.test, src/tgbatest/explpro4.test, src/tgbatest/explprod.test, src/tgbatest/ltl2tgba.cc, src/tgbatest/ltl2tgba.test, src/tgbatest/maskacc.cc, src/tgbatest/maskacc.test, src/tgbatest/neverclaimread.test, src/tgbatest/randtgba.cc, src/tgbatest/readsave.test, src/tgbatest/sim.test, src/tgbatest/sim2.test, src/tgbatest/spotlbtt.test, src/tgbatest/tgbaread.test, src/tgbatest/tripprod.test, iface/dve2/dve2.cc: Adjust or use to the new acceptance interface.
This commit is contained in:
parent
37ece2b878
commit
2c764fb3c7
125 changed files with 1950 additions and 3254 deletions
|
|
@ -76,14 +76,14 @@ namespace spot
|
|||
struct SPOT_API tgba_graph_trans_data
|
||||
{
|
||||
bdd cond;
|
||||
bdd acc;
|
||||
acc_cond::mark_t acc;
|
||||
|
||||
explicit tgba_graph_trans_data()
|
||||
: cond(bddfalse), acc(bddfalse)
|
||||
: cond(bddfalse), acc(0)
|
||||
{
|
||||
}
|
||||
|
||||
tgba_graph_trans_data(bdd cond, bdd acc = bddfalse)
|
||||
tgba_graph_trans_data(bdd cond, acc_cond::mark_t acc = 0U)
|
||||
: cond(cond), acc(acc)
|
||||
{
|
||||
}
|
||||
|
|
@ -141,7 +141,7 @@ namespace spot
|
|||
return g_->trans_data(p_).cond;
|
||||
}
|
||||
|
||||
virtual bdd current_acceptance_conditions() const
|
||||
virtual acc_cond::mark_t current_acceptance_conditions() const
|
||||
{
|
||||
assert(!done());
|
||||
return g_->trans_data(p_).acc;
|
||||
|
|
@ -161,23 +161,18 @@ namespace spot
|
|||
|
||||
protected:
|
||||
graph_t g_;
|
||||
bdd_dict_ptr dict_;
|
||||
bdd all_acceptance_conditions_;
|
||||
bdd neg_acceptance_conditions_;
|
||||
mutable unsigned init_number_;
|
||||
|
||||
public:
|
||||
tgba_digraph(const bdd_dict_ptr& dict)
|
||||
: dict_(dict),
|
||||
all_acceptance_conditions_(bddfalse),
|
||||
neg_acceptance_conditions_(bddtrue),
|
||||
: tgba(dict),
|
||||
init_number_(0)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~tgba_digraph()
|
||||
{
|
||||
dict_->unregister_all_my_variables(this);
|
||||
get_dict()->unregister_all_my_variables(this);
|
||||
// Prevent this state from being destroyed by ~tgba(),
|
||||
// as the state will be destroyed when g_ is destroyed.
|
||||
last_support_conditions_input_ = 0;
|
||||
|
|
@ -212,11 +207,6 @@ namespace spot
|
|||
return g_;
|
||||
}
|
||||
|
||||
virtual bdd_dict_ptr get_dict() const
|
||||
{
|
||||
return this->dict_;
|
||||
}
|
||||
|
||||
unsigned num_states() const
|
||||
{
|
||||
return g_.num_states();
|
||||
|
|
@ -314,8 +304,22 @@ namespace spot
|
|||
return g_.trans_data(t);
|
||||
}
|
||||
|
||||
void set_acceptance_conditions(bdd all);
|
||||
bdd set_single_acceptance_set();
|
||||
void set_acceptance_conditions(unsigned num)
|
||||
{
|
||||
if (num < acc_.num_sets())
|
||||
{
|
||||
acc_.~acc_cond();
|
||||
new (&acc_) acc_cond(get_dict());
|
||||
}
|
||||
acc_.add_sets(num - acc_.num_sets());
|
||||
prop_single_acc_set(num == 1);
|
||||
}
|
||||
|
||||
acc_cond::mark_t set_single_acceptance_set()
|
||||
{
|
||||
set_acceptance_conditions(1);
|
||||
return acc_.mark(0);
|
||||
}
|
||||
|
||||
unsigned new_state()
|
||||
{
|
||||
|
|
@ -328,7 +332,7 @@ namespace spot
|
|||
}
|
||||
|
||||
unsigned new_transition(unsigned src, unsigned dst,
|
||||
bdd cond, bdd acc = bddfalse)
|
||||
bdd cond, acc_cond::mark_t acc = 0U)
|
||||
{
|
||||
return g_.new_transition(src, dst, cond, acc);
|
||||
}
|
||||
|
|
@ -337,7 +341,7 @@ namespace spot
|
|||
bdd cond, bool acc = true)
|
||||
{
|
||||
if (acc)
|
||||
return g_.new_transition(src, dst, cond, all_acceptance_conditions_);
|
||||
return g_.new_transition(src, dst, cond, acc_.all_sets());
|
||||
else
|
||||
return g_.new_transition(src, dst, cond);
|
||||
}
|
||||
|
|
@ -364,22 +368,13 @@ namespace spot
|
|||
/// \brief Copy the acceptance conditions of another tgba.
|
||||
void copy_acceptance_conditions_of(const const_tgba_ptr& a)
|
||||
{
|
||||
set_acceptance_conditions(a->neg_acceptance_conditions());
|
||||
assert(acc_.num_sets() == 0);
|
||||
acc_.add_sets(a->acc().num_sets());
|
||||
}
|
||||
|
||||
void copy_ap_of(const const_tgba_ptr& a)
|
||||
{
|
||||
dict_->register_all_propositions_of(a, this);
|
||||
}
|
||||
|
||||
virtual bdd all_acceptance_conditions() const
|
||||
{
|
||||
return all_acceptance_conditions_;
|
||||
}
|
||||
|
||||
virtual bdd neg_acceptance_conditions() const
|
||||
{
|
||||
return neg_acceptance_conditions_;
|
||||
get_dict()->register_all_propositions_of(a, this);
|
||||
}
|
||||
|
||||
virtual bdd compute_support_conditions(const state* s) const
|
||||
|
|
@ -400,7 +395,7 @@ namespace spot
|
|||
for (auto& t: g_.out(s))
|
||||
// Stop at the first transition, since the remaining should be
|
||||
// labeled identically.
|
||||
return t.acc == all_acceptance_conditions_;
|
||||
return acc_.accepting(t.acc);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue