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
|
|
@ -84,8 +84,9 @@ namespace spot
|
|||
public:
|
||||
tgba_succ_iterator_product_common(tgba_succ_iterator* left,
|
||||
tgba_succ_iterator* right,
|
||||
const tgba_product* prod,
|
||||
fixed_size_pool* pool)
|
||||
: left_(left), right_(right), pool_(pool)
|
||||
: left_(left), right_(right), prod_(prod), pool_(pool)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -139,6 +140,7 @@ namespace spot
|
|||
protected:
|
||||
tgba_succ_iterator* left_;
|
||||
tgba_succ_iterator* right_;
|
||||
const tgba_product* prod_;
|
||||
fixed_size_pool* pool_;
|
||||
friend class spot::tgba_product;
|
||||
};
|
||||
|
|
@ -150,13 +152,9 @@ namespace spot
|
|||
public:
|
||||
tgba_succ_iterator_product(tgba_succ_iterator* left,
|
||||
tgba_succ_iterator* right,
|
||||
bdd left_neg, bdd right_neg,
|
||||
bddPair* right_common_acc,
|
||||
const tgba_product* prod,
|
||||
fixed_size_pool* pool)
|
||||
: tgba_succ_iterator_product_common(left, right, pool),
|
||||
left_neg_(left_neg),
|
||||
right_neg_(right_neg),
|
||||
right_common_acc_(right_common_acc)
|
||||
: tgba_succ_iterator_product_common(left, right, prod, pool)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -203,18 +201,17 @@ namespace spot
|
|||
return current_cond_;
|
||||
}
|
||||
|
||||
bdd current_acceptance_conditions() const
|
||||
acc_cond::mark_t current_acceptance_conditions() const
|
||||
{
|
||||
return ((left_->current_acceptance_conditions() & right_neg_)
|
||||
| (bdd_replace(right_->current_acceptance_conditions(),
|
||||
right_common_acc_) & left_neg_));
|
||||
}
|
||||
return
|
||||
prod_->acc().join(prod_->left_acc(),
|
||||
left_->current_acceptance_conditions(),
|
||||
prod_->right_acc(),
|
||||
right_->current_acceptance_conditions());
|
||||
}
|
||||
|
||||
protected:
|
||||
bdd current_cond_;
|
||||
bdd left_neg_;
|
||||
bdd right_neg_;
|
||||
bddPair* right_common_acc_;
|
||||
};
|
||||
|
||||
/// Iterate over the successors of a product computed on the fly.
|
||||
|
|
@ -225,8 +222,9 @@ namespace spot
|
|||
public:
|
||||
tgba_succ_iterator_product_kripke(tgba_succ_iterator* left,
|
||||
tgba_succ_iterator* right,
|
||||
const tgba_product* prod,
|
||||
fixed_size_pool* pool)
|
||||
: tgba_succ_iterator_product_common(left, right, pool)
|
||||
: tgba_succ_iterator_product_common(left, right, prod, pool)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -270,7 +268,7 @@ namespace spot
|
|||
return current_cond_;
|
||||
}
|
||||
|
||||
bdd current_acceptance_conditions() const
|
||||
acc_cond::mark_t current_acceptance_conditions() const
|
||||
{
|
||||
return right_->current_acceptance_conditions();
|
||||
}
|
||||
|
|
@ -286,10 +284,10 @@ namespace spot
|
|||
|
||||
tgba_product::tgba_product(const const_tgba_ptr& left,
|
||||
const const_tgba_ptr& right)
|
||||
: dict_(left->get_dict()), left_(left), right_(right),
|
||||
: tgba(left->get_dict()), left_(left), right_(right),
|
||||
pool_(sizeof(state_product))
|
||||
{
|
||||
assert(dict_ == right_->get_dict());
|
||||
assert(get_dict() == right_->get_dict());
|
||||
|
||||
// If one of the side is a Kripke structure, it is easier to deal
|
||||
// with (we don't have to fix the acceptance conditions, and
|
||||
|
|
@ -308,55 +306,17 @@ namespace spot
|
|||
left_kripke_ = false;
|
||||
}
|
||||
|
||||
dict_->register_all_variables_of(&left_, this);
|
||||
dict_->register_all_variables_of(&right_, this);
|
||||
auto d = get_dict();
|
||||
d->register_all_propositions_of(&left_, this);
|
||||
d->register_all_propositions_of(&right_, this);
|
||||
|
||||
if (left_kripke_)
|
||||
{
|
||||
all_acceptance_conditions_ = right_->all_acceptance_conditions();
|
||||
neg_acceptance_conditions_ = right_->neg_acceptance_conditions();
|
||||
return;
|
||||
}
|
||||
|
||||
bdd lna = left_->neg_acceptance_conditions();
|
||||
bdd rna = right_->neg_acceptance_conditions();
|
||||
|
||||
right_common_acc_ = bdd_newpair();
|
||||
|
||||
bdd tmp = lna;
|
||||
while (tmp != bddtrue)
|
||||
{
|
||||
assert(bdd_high(tmp) == bddfalse);
|
||||
int var = bdd_var(tmp);
|
||||
if (bdd_implies(rna, bdd_nithvar(var)))
|
||||
{
|
||||
int varclone = dict_->register_clone_acc(var, this);
|
||||
bdd_setpair(right_common_acc_, var, varclone);
|
||||
}
|
||||
tmp = bdd_low(tmp);
|
||||
}
|
||||
|
||||
bdd lac = left_->all_acceptance_conditions();
|
||||
bdd rac = right_->all_acceptance_conditions();
|
||||
|
||||
rna = bdd_replace(rna, right_common_acc_);
|
||||
rac = bdd_replace(rac, right_common_acc_);
|
||||
|
||||
left_acc_complement_ = lna;
|
||||
assert(bdd_exist(lna, rna) == lna);
|
||||
right_acc_complement_ = rna;
|
||||
assert(bdd_exist(rna, lna) == rna);
|
||||
|
||||
all_acceptance_conditions_ = ((lac & right_acc_complement_)
|
||||
| (rac & left_acc_complement_));
|
||||
neg_acceptance_conditions_ = lna & rna;
|
||||
assert(acc_.num_sets() == 0);
|
||||
acc_.add_sets(left->acc().num_sets() + right->acc().num_sets());
|
||||
}
|
||||
|
||||
tgba_product::~tgba_product()
|
||||
{
|
||||
if (!left_kripke_)
|
||||
bdd_freepair(right_common_acc_);
|
||||
dict_->unregister_all_my_variables(this);
|
||||
get_dict()->unregister_all_my_variables(this);
|
||||
// Prevent these states from being destroyed by ~tgba(): they
|
||||
// will be destroyed before when the pool is destructed.
|
||||
if (last_support_conditions_input_)
|
||||
|
|
@ -393,13 +353,9 @@ namespace spot
|
|||
|
||||
fixed_size_pool* p = const_cast<fixed_size_pool*>(&pool_);
|
||||
if (left_kripke_)
|
||||
return new tgba_succ_iterator_product_kripke(li, ri, p);
|
||||
return new tgba_succ_iterator_product_kripke(li, ri, this, p);
|
||||
else
|
||||
return new tgba_succ_iterator_product(li, ri,
|
||||
left_acc_complement_,
|
||||
right_acc_complement_,
|
||||
right_common_acc_,
|
||||
p);
|
||||
return new tgba_succ_iterator_product(li, ri, this, p);
|
||||
}
|
||||
|
||||
bdd
|
||||
|
|
@ -412,10 +368,14 @@ namespace spot
|
|||
return lsc & rsc;
|
||||
}
|
||||
|
||||
bdd_dict_ptr
|
||||
tgba_product::get_dict() const
|
||||
const acc_cond& tgba_product::left_acc() const
|
||||
{
|
||||
return dict_;
|
||||
return left_->acc();
|
||||
}
|
||||
|
||||
const acc_cond& tgba_product::right_acc() const
|
||||
{
|
||||
return right_->acc();
|
||||
}
|
||||
|
||||
std::string
|
||||
|
|
@ -441,18 +401,6 @@ namespace spot
|
|||
return right_->project_state(s2->right(), t);
|
||||
}
|
||||
|
||||
bdd
|
||||
tgba_product::all_acceptance_conditions() const
|
||||
{
|
||||
return all_acceptance_conditions_;
|
||||
}
|
||||
|
||||
bdd
|
||||
tgba_product::neg_acceptance_conditions() const
|
||||
{
|
||||
return neg_acceptance_conditions_;
|
||||
}
|
||||
|
||||
std::string
|
||||
tgba_product::transition_annotation(const tgba_succ_iterator* t) const
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue