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
|
|
@ -34,23 +34,18 @@
|
|||
#include "tgbaalgos/degen.hh"
|
||||
|
||||
#include "tgba/tgbasafracomplement.hh"
|
||||
#include "tgba/tgbakvcomplement.hh"
|
||||
|
||||
void usage(const char* prog)
|
||||
{
|
||||
std::cout << "usage: " << prog << " [options]" << std::endl;
|
||||
std::cout << "with options" << std::endl
|
||||
<< "-b Output in spot's format" << std::endl
|
||||
<< "-S Use Safra's complementation "
|
||||
<< "instead of Kupferman&Vardi's" << std::endl
|
||||
<< "-s buchi_automaton display the safra automaton"
|
||||
<< std::endl
|
||||
<< "-a buchi_automaton display the complemented automaton"
|
||||
<< std::endl
|
||||
<< "-astat buchi_automaton statistics for !a" << std::endl
|
||||
<< "-fstat formula statistics for !A_f" << std::endl
|
||||
<< "-f formula test !A_f and !A_!f" << std::endl
|
||||
<< "-p formula print the automaton for f" << std::endl;
|
||||
<< "-b Output in spot's format\n"
|
||||
<< "-s buchi_automaton display the safra automaton\n"
|
||||
<< "-a buchi_automaton display the complemented automaton\n"
|
||||
<< "-astat buchi_automaton statistics for !a\n"
|
||||
<< "-fstat formula statistics for !A_f\n"
|
||||
<< "-f formula test !A_f and !A_!f\n"
|
||||
<< "-p formula print the automaton for f\n";
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
|
|
@ -62,7 +57,6 @@ int main(int argc, char* argv[])
|
|||
int return_value = 0;
|
||||
bool stats = false;
|
||||
bool formula = false;
|
||||
bool safra = false;
|
||||
bool print_formula = false;
|
||||
bool save_spot = false;
|
||||
|
||||
|
|
@ -98,10 +92,8 @@ int main(int argc, char* argv[])
|
|||
|
||||
switch (argv[i][1])
|
||||
{
|
||||
case 'S':
|
||||
safra = true; break;
|
||||
case 's':
|
||||
safra = true; print_safra = true; break;
|
||||
print_safra = true; break;
|
||||
case 'a':
|
||||
print_automaton = true; break;
|
||||
case 'f':
|
||||
|
|
@ -136,10 +128,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
spot::tgba_ptr complement = 0;
|
||||
|
||||
if (safra)
|
||||
complement = spot::make_safra_complement(a);
|
||||
else
|
||||
complement = spot::make_kv_complement(a);
|
||||
complement = spot::make_safra_complement(a);
|
||||
|
||||
if (print_automaton)
|
||||
{
|
||||
|
|
@ -168,10 +157,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
a = spot::ltl_to_tgba_fm(f1, dict);
|
||||
spot::tgba_ptr complement = 0;
|
||||
if (safra)
|
||||
complement = spot::make_safra_complement(a);
|
||||
else
|
||||
complement = spot::make_kv_complement(a);
|
||||
complement = spot::make_safra_complement(a);
|
||||
|
||||
spot::dotty_reachable(std::cout, complement);
|
||||
f1->destroy();
|
||||
|
|
@ -206,30 +192,21 @@ int main(int argc, char* argv[])
|
|||
std::cout << "Original: "
|
||||
<< a_size.states << ", "
|
||||
<< a_size.transitions << ", "
|
||||
<< a->number_of_acceptance_conditions()
|
||||
<< a->acc().num_sets()
|
||||
<< std::endl;
|
||||
|
||||
auto buchi = spot::degeneralize(a);
|
||||
std::cout << "Buchi: "
|
||||
<< buchi->num_states()
|
||||
<< buchi->num_transitions()
|
||||
<< buchi->number_of_acceptance_conditions()
|
||||
<< buchi->acc().num_sets()
|
||||
<< std::endl;
|
||||
|
||||
spot::tgba_statistics b_size = spot::stats_reachable(safra_complement);
|
||||
std::cout << "Safra Complement: "
|
||||
<< b_size.states << ", "
|
||||
<< b_size.transitions << ", "
|
||||
<< safra_complement->number_of_acceptance_conditions()
|
||||
<< std::endl;
|
||||
|
||||
auto complement = spot::make_kv_complement(a);
|
||||
|
||||
b_size = spot::stats_reachable(complement);
|
||||
std::cout << "GBA Complement: "
|
||||
<< b_size.states << ", "
|
||||
<< b_size.transitions << ", "
|
||||
<< complement->number_of_acceptance_conditions()
|
||||
<< safra_complement->acc().num_sets()
|
||||
<< std::endl;
|
||||
|
||||
if (formula)
|
||||
|
|
@ -242,7 +219,7 @@ int main(int argc, char* argv[])
|
|||
std::cout << "Not Formula: "
|
||||
<< a_size.states << ", "
|
||||
<< a_size.transitions << ", "
|
||||
<< a2->number_of_acceptance_conditions()
|
||||
<< a2->acc().num_sets()
|
||||
<< std::endl;
|
||||
|
||||
f1->destroy();
|
||||
|
|
@ -262,18 +239,9 @@ int main(int argc, char* argv[])
|
|||
spot::ltl::unop::instance(spot::ltl::unop::Not, f1->clone());
|
||||
spot::tgba_ptr Anf = spot::ltl_to_tgba_fm(nf1, dict);
|
||||
|
||||
spot::tgba_ptr nAf;
|
||||
spot::tgba_ptr nAnf;
|
||||
if (safra)
|
||||
{
|
||||
nAf = spot::make_safra_complement(Af);
|
||||
nAnf = spot::make_safra_complement(Anf);
|
||||
}
|
||||
else
|
||||
{
|
||||
nAf = spot::make_kv_complement(Af);
|
||||
nAnf = spot::make_kv_complement(Anf);
|
||||
}
|
||||
spot::tgba_ptr nAf = spot::make_safra_complement(Af);
|
||||
spot::tgba_ptr nAnf = spot::make_safra_complement(Anf);
|
||||
|
||||
auto ec = spot::couvreur99(spot::product(nAf, nAnf));
|
||||
auto res = ec->check();
|
||||
spot::tgba_statistics a_size = spot::stats_reachable(ec->automaton());
|
||||
|
|
@ -282,16 +250,22 @@ int main(int argc, char* argv[])
|
|||
<< "Transitions: "
|
||||
<< a_size.transitions << std::endl
|
||||
<< "Acc Cond: "
|
||||
<< ec->automaton()->number_of_acceptance_conditions()
|
||||
<< ec->automaton()->acc().num_sets()
|
||||
<< std::endl;
|
||||
if (res)
|
||||
{
|
||||
std::cout << "FAIL";
|
||||
return_value = 1;
|
||||
}
|
||||
{
|
||||
std::cout << "FAIL\n";
|
||||
return_value = 1;
|
||||
if (auto run = res->accepting_run())
|
||||
{
|
||||
spot::dotty_reachable(std::cout, ec->automaton(), false);
|
||||
spot::print_tgba_run(std::cout, ec->automaton(), run);
|
||||
}
|
||||
}
|
||||
else
|
||||
std::cout << "OK";
|
||||
std::cout << std::endl;
|
||||
{
|
||||
std::cout << "OK\n";
|
||||
}
|
||||
nf1->destroy();
|
||||
f1->destroy();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue