Implement Loizou & Thanisch's algorithm for enumerating cycles.
* src/tgbaalgos/cycles.cc, src/tgbaalgos/cycles.hh, src/tgbatest/cycles.test: New files. * src/tgbaalgos/Makefile.am, src/tgbatest/Makefile.am: Add them. * src/tgbatest/ltl2tgba.cc: Add a -KC option for testing.
This commit is contained in:
parent
379e0d5eb4
commit
374a489e3f
6 changed files with 410 additions and 1 deletions
|
|
@ -64,6 +64,7 @@
|
|||
#include "tgbaalgos/emptiness_stats.hh"
|
||||
#include "tgbaalgos/scc.hh"
|
||||
#include "tgbaalgos/isdet.hh"
|
||||
#include "tgbaalgos/cycles.hh"
|
||||
#include "kripkeparse/public.hh"
|
||||
#include "tgbaalgos/simulation.hh"
|
||||
|
||||
|
|
@ -281,6 +282,7 @@ syntax(char* prog)
|
|||
<< " -K dump the graph of SCCs in dot format" << std::endl
|
||||
<< " -KV verbosely dump the graph of SCCs in dot format"
|
||||
<< std::endl
|
||||
<< " -KC list cycles in automaton" << std::endl
|
||||
<< " -N output the never clain for Spin (implies -DS)"
|
||||
<< std::endl
|
||||
<< " -NN output the never clain for Spin, with commented states"
|
||||
|
|
@ -522,6 +524,10 @@ main(int argc, char** argv)
|
|||
{
|
||||
output = 11;
|
||||
}
|
||||
else if (!strcmp(argv[formula_index], "-KC"))
|
||||
{
|
||||
output = 15;
|
||||
}
|
||||
else if (!strcmp(argv[formula_index], "-l"))
|
||||
{
|
||||
translation = TransLaCIM;
|
||||
|
|
@ -1409,6 +1415,20 @@ main(int argc, char** argv)
|
|||
std::cout << std::endl;
|
||||
|
||||
break;
|
||||
case 15:
|
||||
{
|
||||
spot::scc_map m(a);
|
||||
m.build_map();
|
||||
spot::enumerate_cycles c(a, m);
|
||||
unsigned max = m.scc_count();
|
||||
for (unsigned n = 0; n < max; ++n)
|
||||
{
|
||||
std::cout << "Cycles in SCC #" << n << std::endl;
|
||||
c.run(n);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
assert(!"unknown output option");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue