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
|
|
@ -22,8 +22,8 @@
|
|||
namespace spot
|
||||
{
|
||||
|
||||
fair_kripke_succ_iterator::fair_kripke_succ_iterator(const bdd& cond,
|
||||
const bdd& acc_cond)
|
||||
fair_kripke_succ_iterator::fair_kripke_succ_iterator
|
||||
(const bdd& cond, acc_cond::mark_t acc_cond)
|
||||
: cond_(cond), acc_cond_(acc_cond)
|
||||
{
|
||||
}
|
||||
|
|
@ -40,7 +40,7 @@ namespace spot
|
|||
return cond_;
|
||||
}
|
||||
|
||||
bdd
|
||||
acc_cond::mark_t
|
||||
fair_kripke_succ_iterator::current_acceptance_conditions() const
|
||||
{
|
||||
// Do not assert(!done()) here. It is OK to call
|
||||
|
|
|
|||
|
|
@ -52,14 +52,14 @@ namespace spot
|
|||
/// The \a cond and \a acc_cond arguments will be those returned
|
||||
/// by fair_kripke_succ_iterator::current_condition(),
|
||||
/// and fair_kripke_succ_iterator::current_acceptance_conditions().
|
||||
fair_kripke_succ_iterator(const bdd& cond, const bdd& acc_cond);
|
||||
fair_kripke_succ_iterator(const bdd& cond, acc_cond::mark_t acc_cond);
|
||||
virtual ~fair_kripke_succ_iterator();
|
||||
|
||||
virtual bdd current_condition() const;
|
||||
virtual bdd current_acceptance_conditions() const;
|
||||
virtual acc_cond::mark_t current_acceptance_conditions() const;
|
||||
protected:
|
||||
bdd cond_;
|
||||
bdd acc_cond_;
|
||||
acc_cond::mark_t acc_cond_;
|
||||
};
|
||||
|
||||
/// \ingroup kripke
|
||||
|
|
@ -86,16 +86,22 @@ namespace spot
|
|||
/// class and need not be defined.
|
||||
///
|
||||
/// See also spot::fair_kripke_succ_iterator.
|
||||
class SPOT_API fair_kripke : public tgba
|
||||
class SPOT_API fair_kripke: public tgba
|
||||
{
|
||||
public:
|
||||
fair_kripke(const bdd_dict_ptr& d)
|
||||
: tgba(d)
|
||||
{
|
||||
}
|
||||
|
||||
/// \brief The condition that label the state \a s.
|
||||
///
|
||||
/// This should be a conjunction of atomic propositions.
|
||||
virtual bdd state_condition(const state* s) const = 0;
|
||||
|
||||
/// \brief The set of acceptance conditions that label the state \a s.
|
||||
virtual bdd state_acceptance_conditions(const state* s) const = 0;
|
||||
virtual acc_cond::mark_t
|
||||
state_acceptance_conditions(const state* s) const = 0;
|
||||
|
||||
protected:
|
||||
virtual bdd compute_support_conditions(const state* s) const;
|
||||
|
|
|
|||
|
|
@ -34,33 +34,21 @@ namespace spot
|
|||
return cond_;
|
||||
}
|
||||
|
||||
bdd
|
||||
acc_cond::mark_t
|
||||
kripke_succ_iterator::current_acceptance_conditions() const
|
||||
{
|
||||
// Do not assert(!done()) here. It is OK to call
|
||||
// this function on a state without successor.
|
||||
return bddfalse;
|
||||
return 0U;
|
||||
}
|
||||
|
||||
kripke::~kripke()
|
||||
{
|
||||
}
|
||||
|
||||
bdd
|
||||
acc_cond::mark_t
|
||||
kripke::state_acceptance_conditions(const state*) const
|
||||
{
|
||||
return bddtrue;
|
||||
return 0U;
|
||||
}
|
||||
|
||||
bdd kripke::all_acceptance_conditions() const
|
||||
{
|
||||
// There is no acceptance conditions.
|
||||
return bddfalse;
|
||||
}
|
||||
|
||||
bdd kripke::neg_acceptance_conditions() const
|
||||
{
|
||||
return bddtrue;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ namespace spot
|
|||
virtual ~kripke_succ_iterator();
|
||||
|
||||
virtual bdd current_condition() const;
|
||||
virtual bdd current_acceptance_conditions() const;
|
||||
virtual acc_cond::mark_t current_acceptance_conditions() const;
|
||||
protected:
|
||||
bdd cond_;
|
||||
};
|
||||
|
|
@ -92,11 +92,15 @@ namespace spot
|
|||
class SPOT_API kripke: public fair_kripke
|
||||
{
|
||||
public:
|
||||
kripke(const bdd_dict_ptr& d)
|
||||
: fair_kripke(d)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
virtual ~kripke();
|
||||
|
||||
virtual bdd state_acceptance_conditions(const state*) const;
|
||||
virtual bdd neg_acceptance_conditions() const;
|
||||
virtual bdd all_acceptance_conditions() const;
|
||||
virtual acc_cond::mark_t state_acceptance_conditions(const state*) const;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -128,8 +128,8 @@ namespace spot
|
|||
|
||||
kripke_explicit::kripke_explicit(const bdd_dict_ptr& dict,
|
||||
state_kripke* init)
|
||||
: dict_(dict),
|
||||
init_ (init)
|
||||
: kripke(dict),
|
||||
init_(init)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -148,7 +148,7 @@ namespace spot
|
|||
|
||||
kripke_explicit::~kripke_explicit()
|
||||
{
|
||||
dict_->unregister_all_my_variables(this);
|
||||
get_dict()->unregister_all_my_variables(this);
|
||||
std::map<const std::string, state_kripke*>::iterator it;
|
||||
for (it = ns_nodes_.begin(); it != ns_nodes_.end(); ++it)
|
||||
{
|
||||
|
|
@ -163,12 +163,6 @@ namespace spot
|
|||
return init_;
|
||||
}
|
||||
|
||||
bdd_dict_ptr
|
||||
kripke_explicit::get_dict() const
|
||||
{
|
||||
return dict_;
|
||||
}
|
||||
|
||||
// FIXME: Change the bddtrue.
|
||||
kripke_explicit_succ_iterator*
|
||||
kripke_explicit::succ_iter(const spot::state* st) const
|
||||
|
|
@ -269,7 +263,7 @@ namespace spot
|
|||
void kripke_explicit::add_condition(const ltl::formula* f,
|
||||
std::string on_me)
|
||||
{
|
||||
add_conditions(formula_to_bdd(f, dict_, this), on_me);
|
||||
add_conditions(formula_to_bdd(f, get_dict(), this), on_me);
|
||||
f->destroy();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -117,7 +117,6 @@ namespace spot
|
|||
kripke_explicit(const bdd_dict_ptr&, state_kripke* = nullptr);
|
||||
~kripke_explicit();
|
||||
|
||||
bdd_dict_ptr get_dict() const;
|
||||
state_kripke* get_init_state() const;
|
||||
|
||||
/// \brief Allow to get an iterator on the state we passed in
|
||||
|
|
@ -174,7 +173,6 @@ namespace spot
|
|||
void add_transition(state_kripke* source,
|
||||
const state_kripke* dest);
|
||||
|
||||
bdd_dict_ptr dict_;
|
||||
state_kripke* init_;
|
||||
std::map<const std::string, state_kripke*> ns_nodes_;
|
||||
std::map<const state_kripke*, std::string> sn_nodes_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue