Use shared_ptr for the emptiness check interfaces.

At the same time, this adds a is_empty() method to the tgba class,
simplifying many places that ran emptiness checks.

* iface/dve2/dve2check.cc, src/bin/ltlcross.cc,
src/dstarparse/dra2ba.cc, src/ltlvisit/contain.cc, src/tgba/tgba.cc,
src/tgba/tgba.hh, src/tgbaalgos/emptiness.cc,
src/tgbaalgos/emptiness.hh, src/tgbaalgos/gtec/ce.cc,
src/tgbaalgos/gtec/ce.hh, src/tgbaalgos/gtec/gtec.cc,
src/tgbaalgos/gtec/gtec.hh, src/tgbaalgos/gv04.cc,
src/tgbaalgos/gv04.hh, src/tgbaalgos/magic.cc,
src/tgbaalgos/magic.hh, src/tgbaalgos/minimize.cc,
src/tgbaalgos/ndfs_result.hxx, src/tgbaalgos/powerset.cc,
src/tgbaalgos/projrun.cc, src/tgbaalgos/projrun.hh,
src/tgbaalgos/reducerun.cc, src/tgbaalgos/reducerun.hh,
src/tgbaalgos/replayrun.cc, src/tgbaalgos/replayrun.hh,
src/tgbaalgos/rundotdec.cc, src/tgbaalgos/rundotdec.hh,
src/tgbaalgos/se05.cc, src/tgbaalgos/se05.hh,
src/tgbaalgos/tau03.cc, src/tgbaalgos/tau03.hh,
src/tgbaalgos/tau03opt.cc, src/tgbaalgos/tau03opt.hh,
src/tgbaalgos/word.cc, src/tgbaalgos/word.hh,
src/tgbatest/checkpsl.cc, src/tgbatest/complementation.cc,
src/tgbatest/emptchk.cc, src/tgbatest/ltl2tgba.cc,
src/tgbatest/randtgba.cc, wrap/python/ajax/spot.in,
wrap/python/spot.i: Use shared_ptr.
This commit is contained in:
Alexandre Duret-Lutz 2014-08-23 18:34:00 +02:00
parent 803e17bb8d
commit 6d7c258fd7
42 changed files with 335 additions and 402 deletions

View file

@ -29,7 +29,6 @@
#include "tgbaalgos/ltl2taa.hh"
#include "tgbaalgos/sccfilter.hh"
#include "tgba/tgbaproduct.hh"
#include "tgbaalgos/gtec/gtec.hh"
#include "tgbaalgos/dotty.hh"
#include "tgbaalgos/dupexp.hh"
@ -76,14 +75,11 @@ main(int argc, char** argv)
{
auto apos = scc_filter(ltl_to_tgba_fm(fpos, d));
auto aneg = scc_filter(ltl_to_tgba_fm(fneg, d));
auto ec = spot::couvreur99(spot::product(apos, aneg));
auto res = ec->check();
if (res)
if (!spot::product(apos, aneg)->is_empty())
{
std::cerr << "non-empty intersection between pos and neg (FM)\n";
exit(2);
std::cerr << "non-empty intersection between pos and neg (FM)\n";
exit(2);
}
delete ec;
// Run make_future_conditions_collector, without testing the output.
auto fc = spot::make_future_conditions_collector(apos, true);
@ -93,28 +89,22 @@ main(int argc, char** argv)
{
auto apos = scc_filter(ltl_to_tgba_fm(fpos, d, true));
auto aneg = scc_filter(ltl_to_tgba_fm(fneg, d, true));
auto ec = spot::couvreur99(spot::product(apos, aneg));
auto res = ec->check();
if (res)
if (!spot::product(apos, aneg)->is_empty())
{
std::cerr << "non-empty intersection between pos and neg (FM -x)\n";
exit(2);
}
delete ec;
}
if (fpos->is_ltl_formula())
{
auto apos = scc_filter(spot::tgba_dupexp_dfs(ltl_to_taa(fpos, d)));
auto aneg = scc_filter(spot::tgba_dupexp_dfs(ltl_to_taa(fneg, d)));
auto ec = spot::couvreur99(spot::product(apos, aneg));
auto res = ec->check();
if (res)
if (!spot::product(apos, aneg)->is_empty())
{
std::cerr << "non-empty intersection between pos and neg (TAA)\n";
exit(2);
}
delete ec;
}
}
fpos->destroy();
fneg->destroy();