stutter check: cleanup and add test cases

* src/ltltest/ltlfilt.test: Add more tests.
* src/ltltest/stutter.test: New test.
* src/ltltest/Makefile.am: Adjust.
* src/bin/ltlfilt.cc: Catch std::runtime_error.
* src/tgba/tgbasl.hh (make_tgbasl): New function.
* src/tgba/tgbagraph.hh (make_tgba_graph): Add another overload.
* src/tgbaalgos/stutter_invariance.cc,
src/tgbaalgos/stutter_invariance.hh: Take the algorithm version as an
optional integer, and call getenv() only once.
* bench/stutter/stutter_invariance_randomgraph.cc,
bench/stutter/stutter_invariance_formulas.cc: Simplify using the
above functions.
This commit is contained in:
Alexandre Duret-Lutz 2014-11-12 18:29:54 +01:00
parent fcf6e25132
commit f412fee6f3
10 changed files with 188 additions and 115 deletions

View file

@ -73,11 +73,11 @@ main()
vec.push_back(aut_pair_t(a, na));
}
char algostr[2] = { 0, 0 };
for (char algo = '1'; algo <= '8'; ++algo)
{
// Set SPOT_STUTTER_CHECK environment variable.
char algostr[2] = { 0 };
algostr[0] = algo;
// Select the algorithm for checking stutter-invariance
algostr[0] = algo;
setenv("SPOT_STUTTER_CHECK", algostr, true);
// Copy vec, because is_stutter_invariant modifies the
@ -86,18 +86,16 @@ main()
spot::stopwatch sw;
sw.start();
bool res;
for (auto& a: vec)
for (auto& a: dup)
res = spot::is_stutter_invariant(std::move(a.first),
std::move(a.second),
apdict);
const double time = sw.stop();
vec = dup;
auto time = sw.stop();
std::cout << algo << ", " << props_n << ", " << states_n
<< ", " << res << ", " << time << std::endl;
}
spot::ltl::destroy_atomic_prop_set(*ap);
delete(ap);
delete ap;
}
}