twa_run: keep a pointer to the automaton

This simplify all laters invocations, because we do not have to pass
the automaton the run was generated on.

This fixes #113 by allowing the __str__ function to be implemented on
runs.

* src/twaalgos/emptiness.cc, src/twaalgos/emptiness.hh (twa_run):
Store the automaton.
(prin_twa_run): Rewrite as an overloaded <<.
* src/twaalgos/reducerun.cc, src/twaalgos/reducerun.hh (reduce_run):
Do not like the automaton as a parameter.
* src/twaalgos/replayrun.cc, src/twaalgos/replayrun.hh (replay_twa_run):
Likewise.
* src/bin/common_aoutput.hh, src/bin/ltlcross.cc,
src/tests/complementation.cc, src/tests/ikwiad.cc,
src/tests/randtgba.cc, src/twaalgos/gtec/ce.cc, src/twaalgos/gv04.cc,
src/twaalgos/magic.cc, src/twaalgos/ndfs_result.hxx,
src/twaalgos/se05.cc, src/twaalgos/projrun.cc: Adjust.
* wrap/python/ajax/spotcgi.in: Add a __str__ function to twa_run_ptr.
* wrap/python/spot_impl.i: Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2015-10-25 11:58:14 +01:00
parent e7cc89264a
commit 63917def2d
19 changed files with 85 additions and 97 deletions

View file

@ -1580,14 +1580,13 @@ checked_main(int argc, char** argv)
if (opt_reduce)
{
tm.start("reducing accepting run");
run = spot::reduce_run(res->automaton(), run);
run = spot::reduce_run(run);
tm.stop("reducing accepting run");
}
if (accepting_run_replay)
{
tm.start("replaying acc. run");
if (!spot::replay_twa_run(std::cout, a,
run, true))
if (!spot::replay_twa_run(std::cout, run, true))
exit_code = 1;
tm.stop("replaying acc. run");
}
@ -1601,7 +1600,7 @@ checked_main(int argc, char** argv)
}
else
{
spot::print_twa_run(std::cout, a, run);
std::cout << run;
}
tm.stop("printing accepting run");
}