Commit 4221e68d authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

rename tgba_run as twa_run

Part of #113.

* src/twaalgos/emptiness.cc, src/twaalgos/emptiness.hh (tgba_run):
Rename as ...
(twa_run): ... this.
* NEWS: Mention it.
* iface/ltsmin/modelcheck.cc, src/tests/complementation.cc,
src/tests/emptchk.cc, src/tests/ikwiad.cc, src/tests/randtgba.cc,
src/twa/twa.hh, src/twaalgos/bfssteps.cc, src/twaalgos/bfssteps.hh,
src/twaalgos/gtec/ce.cc, src/twaalgos/gtec/ce.hh,
src/twaalgos/gv04.cc, src/twaalgos/magic.cc, src/twaalgos/minimize.cc,
src/twaalgos/ndfs_result.hxx, src/twaalgos/projrun.cc,
src/twaalgos/projrun.hh, src/twaalgos/reducerun.cc,
src/twaalgos/reducerun.hh, src/twaalgos/replayrun.cc,
src/twaalgos/replayrun.hh, src/twaalgos/se05.cc, src/twaalgos/word.cc,
src/twaalgos/word.hh, wrap/python/ajax/spotcgi.in,
wrap/python/spot_impl.i: Adjust.
parent 4a91fccc
...@@ -52,6 +52,7 @@ New in spot 1.99.4a (not yet released) ...@@ -52,6 +52,7 @@ New in spot 1.99.4a (not yet released)
ltl_simplifier -> tl_simplifier ltl_simplifier -> tl_simplifier
tgba_statistics::transitions -> twa_statistics::edges tgba_statistics::transitions -> twa_statistics::edges
tgba_sub_statistics::sub_transitions -> twa_sub_statistics::transitions tgba_sub_statistics::sub_transitions -> twa_sub_statistics::transitions
tgba_run -> twa_run
Python: Python:
......
...@@ -314,7 +314,7 @@ checked_main(int argc, char **argv) ...@@ -314,7 +314,7 @@ checked_main(int argc, char **argv)
else if (accepting_run) else if (accepting_run)
{ {
spot::tgba_run_ptr run; spot::twa_run_ptr run;
tm.start("computing accepting run"); tm.start("computing accepting run");
try try
{ {
...@@ -340,7 +340,7 @@ checked_main(int argc, char **argv) ...@@ -340,7 +340,7 @@ checked_main(int argc, char **argv)
tm.stop("reducing accepting run"); tm.stop("reducing accepting run");
tm.start("printing accepting run"); tm.start("printing accepting run");
spot::print_tgba_run(std::cout, product, run); spot::print_twa_run(std::cout, product, run);
tm.stop("printing accepting run"); tm.stop("printing accepting run");
} }
} }
......
...@@ -248,7 +248,7 @@ int main(int argc, char* argv[]) ...@@ -248,7 +248,7 @@ int main(int argc, char* argv[])
if (auto run = res->accepting_run()) if (auto run = res->accepting_run())
{ {
spot::print_dot(std::cout, ec->automaton()); spot::print_dot(std::cout, ec->automaton());
spot::print_tgba_run(std::cout, ec->automaton(), run); spot::print_twa_run(std::cout, ec->automaton(), run);
} }
} }
else else
......
...@@ -161,7 +161,7 @@ main(int argc, char** argv) ...@@ -161,7 +161,7 @@ main(int argc, char** argv)
std::cout << ce_found << " counterexample found\n"; std::cout << ce_found << " counterexample found\n";
if (auto run = res->accepting_run()) if (auto run = res->accepting_run())
{ {
auto ar = spot::tgba_run_to_tgba(a, run); auto ar = spot::twa_run_to_tgba(a, run);
spot::print_dot(std::cout, ar); spot::print_dot(std::cout, ar);
} }
std::cout << '\n'; std::cout << '\n';
......
...@@ -1586,7 +1586,7 @@ checked_main(int argc, char** argv) ...@@ -1586,7 +1586,7 @@ checked_main(int argc, char** argv)
if (accepting_run_replay) if (accepting_run_replay)
{ {
tm.start("replaying acc. run"); tm.start("replaying acc. run");
if (!spot::replay_tgba_run(std::cout, a, if (!spot::replay_twa_run(std::cout, a,
run, true)) run, true))
exit_code = 1; exit_code = 1;
tm.stop("replaying acc. run"); tm.stop("replaying acc. run");
...@@ -1596,12 +1596,12 @@ checked_main(int argc, char** argv) ...@@ -1596,12 +1596,12 @@ checked_main(int argc, char** argv)
tm.start("printing accepting run"); tm.start("printing accepting run");
if (graph_run_tgba_opt) if (graph_run_tgba_opt)
{ {
auto ar = spot::tgba_run_to_tgba(a, run); auto ar = spot::twa_run_to_tgba(a, run);
spot::print_dot(std::cout, ar); spot::print_dot(std::cout, ar);
} }
else else
{ {
spot::print_tgba_run(std::cout, a, run); spot::print_twa_run(std::cout, a, run);
} }
tm.stop("printing accepting run"); tm.stop("printing accepting run");
} }
......
...@@ -379,7 +379,7 @@ struct ar_stat ...@@ -379,7 +379,7 @@ struct ar_stat
} }
void void
count(const spot::const_tgba_run_ptr& run) count(const spot::const_twa_run_ptr& run)
{ {
int p = run->prefix.size(); int p = run->prefix.size();
int c = run->cycle.size(); int c = run->cycle.size();
...@@ -986,7 +986,7 @@ main(int argc, char** argv) ...@@ -986,7 +986,7 @@ main(int argc, char** argv)
++n_non_empty; ++n_non_empty;
if (opt_replay) if (opt_replay)
{ {
spot::tgba_run_ptr run; spot::twa_run_ptr run;
bool done = false; bool done = false;
tm_ar.start(algo); tm_ar.start(algo);
for (int count = opt_R;;) for (int count = opt_R;;)
...@@ -1026,7 +1026,7 @@ main(int argc, char** argv) ...@@ -1026,7 +1026,7 @@ main(int argc, char** argv)
{ {
tm_ar.stop(algo); tm_ar.stop(algo);
std::ostringstream s; std::ostringstream s;
if (!spot::replay_tgba_run(s, if (!spot::replay_twa_run(s,
res->automaton(), res->automaton(),
run)) run))
{ {
...@@ -1051,7 +1051,7 @@ main(int argc, char** argv) ...@@ -1051,7 +1051,7 @@ main(int argc, char** argv)
{ {
auto redrun = auto redrun =
spot::reduce_run(res->automaton(), run); spot::reduce_run(res->automaton(), run);
if (!spot::replay_tgba_run(s, if (!spot::replay_twa_run(s,
res res
->automaton(), ->automaton(),
redrun)) redrun))
......
...@@ -642,7 +642,7 @@ namespace spot ...@@ -642,7 +642,7 @@ namespace spot
/// is the empty string. /// is the empty string.
/// ///
/// This method is used for instance in print_dot(), /// This method is used for instance in print_dot(),
/// and replay_tgba_run(). /// and replay_twa_run().
/// ///
/// \param t a non-done twa_succ_iterator for this automaton /// \param t a non-done twa_succ_iterator for this automaton
virtual std::string virtual std::string
......
...@@ -38,20 +38,20 @@ namespace spot ...@@ -38,20 +38,20 @@ namespace spot
} }
void void
bfs_steps::finalize(const std::map<const state*, tgba_run::step, bfs_steps::finalize(const std::map<const state*, twa_run::step,
state_ptr_less_than>& father, const tgba_run::step& s, state_ptr_less_than>& father, const twa_run::step& s,
const state* start, tgba_run::steps& l) const state* start, twa_run::steps& l)
{ {
tgba_run::steps p; twa_run::steps p;
tgba_run::step current = s; twa_run::step current = s;
for (;;) for (;;)
{ {
tgba_run::step tmp = current; twa_run::step tmp = current;
tmp.s = tmp.s->clone(); tmp.s = tmp.s->clone();
p.push_front(tmp); p.push_front(tmp);
if (current.s == start) if (current.s == start)
break; break;
std::map<const state*, tgba_run::step, std::map<const state*, twa_run::step,
state_ptr_less_than>::const_iterator it = father.find(current.s); state_ptr_less_than>::const_iterator it = father.find(current.s);
assert(it != father.end()); assert(it != father.end());
current = it->second; current = it->second;
...@@ -60,11 +60,11 @@ namespace spot ...@@ -60,11 +60,11 @@ namespace spot
} }
const state* const state*
bfs_steps::search(const state* start, tgba_run::steps& l) bfs_steps::search(const state* start, twa_run::steps& l)
{ {
// Records backlinks to parent state during the BFS. // Records backlinks to parent state during the BFS.
// (This also stores the propositions of this link.) // (This also stores the propositions of this link.)
std::map<const state*, tgba_run::step, std::map<const state*, twa_run::step,
state_ptr_less_than> father; state_ptr_less_than> father;
// BFS queue. // BFS queue.
std::deque<const state*> todo; std::deque<const state*> todo;
...@@ -84,7 +84,7 @@ namespace spot ...@@ -84,7 +84,7 @@ namespace spot
bdd cond = i->current_condition(); bdd cond = i->current_condition();
acc_cond::mark_t acc = i->current_acceptance_conditions(); acc_cond::mark_t acc = i->current_acceptance_conditions();
tgba_run::step s = { src, cond, acc }; twa_run::step s = { src, cond, acc };
if (match(s, dest)) if (match(s, dest))
{ {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
namespace spot namespace spot
{ {
/// \ingroup twa_misc /// \ingroup twa_misc
/// \brief Make a BFS in a spot::tgba to compute a tgba_run::steps. /// \brief Make a BFS in a spot::tgba to compute a twa_run::steps.
/// ///
/// This class should be used to compute the shortest path /// This class should be used to compute the shortest path
/// between a state of a spot::tgba and the first transition or /// between a state of a spot::tgba and the first transition or
...@@ -48,7 +48,7 @@ namespace spot ...@@ -48,7 +48,7 @@ namespace spot
/// ///
/// \return the destination state of the last step (not included /// \return the destination state of the last step (not included
/// in \a l) if a matching path was found, or 0 otherwise. /// in \a l) if a matching path was found, or 0 otherwise.
const state* search(const state* start, tgba_run::steps& l); const state* search(const state* start, twa_run::steps& l);
/// \brief Return a state* that is unique for \a a. /// \brief Return a state* that is unique for \a a.
/// ///
...@@ -82,7 +82,7 @@ namespace spot ...@@ -82,7 +82,7 @@ namespace spot
/// and when this happens the list argument of search() is be /// and when this happens the list argument of search() is be
/// augmented with the shortest past that ends with this /// augmented with the shortest past that ends with this
/// transition. /// transition.
virtual bool match(tgba_run::step& step, const state* dest) = 0; virtual bool match(twa_run::step& step, const state* dest) = 0;
/// \brief Append the resulting path to the resulting run. /// \brief Append the resulting path to the resulting run.
/// ///
...@@ -90,11 +90,11 @@ namespace spot ...@@ -90,11 +90,11 @@ namespace spot
/// resulting path to \a l. This seldom needs to be overridden, /// resulting path to \a l. This seldom needs to be overridden,
/// unless you do not want \a l to be updated (in which case an empty /// unless you do not want \a l to be updated (in which case an empty
/// finalize() will do). /// finalize() will do).
virtual void finalize(const std::map<const state*, tgba_run::step, virtual void finalize(const std::map<const state*, twa_run::step,
state_ptr_less_than>& father, state_ptr_less_than>& father,
const tgba_run::step& s, const twa_run::step& s,
const state* start, const state* start,
tgba_run::steps& l); twa_run::steps& l);
protected: protected:
const_twa_ptr a_; ///< The spot::tgba we are searching into. const_twa_ptr a_; ///< The spot::tgba we are searching into.
......
...@@ -34,10 +34,10 @@ ...@@ -34,10 +34,10 @@
namespace spot namespace spot
{ {
// tgba_run // twa_run
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
tgba_run::~tgba_run() twa_run::~twa_run()
{ {
for (auto i : prefix) for (auto i : prefix)
i.s->destroy(); i.s->destroy();
...@@ -45,7 +45,7 @@ namespace spot ...@@ -45,7 +45,7 @@ namespace spot
i.s->destroy(); i.s->destroy();
} }
tgba_run::tgba_run(const tgba_run& run) twa_run::twa_run(const twa_run& run)
{ {
for (steps::const_iterator i = run.prefix.begin(); for (steps::const_iterator i = run.prefix.begin();
i != run.prefix.end(); ++i) i != run.prefix.end(); ++i)
...@@ -61,28 +61,28 @@ namespace spot ...@@ -61,28 +61,28 @@ namespace spot
} }
} }
tgba_run& twa_run&
tgba_run::operator=(const tgba_run& run) twa_run::operator=(const twa_run& run)
{ {
if (&run != this) if (&run != this)
{ {
this->~tgba_run(); this->~twa_run();
new(this) tgba_run(run); new(this) twa_run(run);
} }
return *this; return *this;
} }
// print_tgba_run // print_twa_run
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
std::ostream& std::ostream&
print_tgba_run(std::ostream& os, print_twa_run(std::ostream& os,
const const_twa_ptr& a, const const_twa_ptr& a,
const const_tgba_run_ptr& run) const const_twa_run_ptr& run)
{ {
bdd_dict_ptr d = a->get_dict(); bdd_dict_ptr d = a->get_dict();
os << "Prefix:" << std::endl; os << "Prefix:" << std::endl;
for (tgba_run::steps::const_iterator i = run->prefix.begin(); for (twa_run::steps::const_iterator i = run->prefix.begin();
i != run->prefix.end(); ++i) i != run->prefix.end(); ++i)
{ {
os << " " << a->format_state(i->s) << std::endl; os << " " << a->format_state(i->s) << std::endl;
...@@ -93,7 +93,7 @@ namespace spot ...@@ -93,7 +93,7 @@ namespace spot
os << std::endl; os << std::endl;
} }
os << "Cycle:" << std::endl; os << "Cycle:" << std::endl;
for (tgba_run::steps::const_iterator i = run->cycle.begin(); for (twa_run::steps::const_iterator i = run->cycle.begin();
i != run->cycle.end(); ++i) i != run->cycle.end(); ++i)
{ {
os << " " << a->format_state(i->s) << std::endl; os << " " << a->format_state(i->s) << std::endl;
...@@ -109,7 +109,7 @@ namespace spot ...@@ -109,7 +109,7 @@ namespace spot
// emptiness_check_result // emptiness_check_result
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
tgba_run_ptr twa_run_ptr
emptiness_check_result::accepting_run() emptiness_check_result::accepting_run()
{ {
return nullptr; return nullptr;
...@@ -287,11 +287,11 @@ namespace spot ...@@ -287,11 +287,11 @@ namespace spot
return nullptr; return nullptr;
} }
// tgba_run_to_tgba // twa_run_to_tgba
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
twa_graph_ptr twa_graph_ptr
tgba_run_to_tgba(const const_twa_ptr& a, const const_tgba_run_ptr& run) twa_run_to_tgba(const const_twa_ptr& a, const const_twa_run_ptr& run)
{ {
auto d = a->get_dict(); auto d = a->get_dict();
auto res = make_twa_graph(d); auto res = make_twa_graph(d);
...@@ -301,7 +301,7 @@ namespace spot ...@@ -301,7 +301,7 @@ namespace spot
const state* s = a->get_init_state(); const state* s = a->get_init_state();
unsigned src; unsigned src;
unsigned dst; unsigned dst;
const tgba_run::steps* l; const twa_run::steps* l;
acc_cond::mark_t seen_acc = 0U; acc_cond::mark_t seen_acc = 0U;
typedef std::unordered_map<const state*, unsigned, typedef std::unordered_map<const state*, unsigned,
...@@ -313,7 +313,7 @@ namespace spot ...@@ -313,7 +313,7 @@ namespace spot
else else
l = &run->prefix; l = &run->prefix;
tgba_run::steps::const_iterator i = l->begin(); twa_run::steps::const_iterator i = l->begin();
assert(s->compare(i->s) == 0); assert(s->compare(i->s) == 0);
src = res->new_state(); src = res->new_state();
......
...@@ -32,9 +32,9 @@ ...@@ -32,9 +32,9 @@
namespace spot namespace spot
{ {
struct tgba_run; struct twa_run;
typedef std::shared_ptr<tgba_run> tgba_run_ptr; typedef std::shared_ptr<twa_run> twa_run_ptr;
typedef std::shared_ptr<const tgba_run> const_tgba_run_ptr; typedef std::shared_ptr<const twa_run> const_twa_run_ptr;
/// \addtogroup emptiness_check Emptiness-checks /// \addtogroup emptiness_check Emptiness-checks
/// \ingroup twa_algorithms /// \ingroup twa_algorithms
...@@ -64,7 +64,7 @@ namespace spot ...@@ -64,7 +64,7 @@ namespace spot
/// ///
/// The acceptance run returned by /// The acceptance run returned by
/// spot::emptiness_check_result::accepting_run(), if any, is of /// spot::emptiness_check_result::accepting_run(), if any, is of
/// type spot::tgba_run. \ref tgba_run "This page" gathers existing /// type spot::twa_run. \ref twa_run "This page" gathers existing
/// operations on these objects. /// operations on these objects.
/// ///
/// @{ /// @{
...@@ -100,7 +100,7 @@ namespace spot ...@@ -100,7 +100,7 @@ namespace spot
/// cannot produce a counter example (that does not mean there /// cannot produce a counter example (that does not mean there
/// is no counter-example; the mere existence of an instance of /// is no counter-example; the mere existence of an instance of
/// this class asserts the existence of a counter-example). /// this class asserts the existence of a counter-example).
virtual tgba_run_ptr accepting_run(); virtual twa_run_ptr accepting_run();
/// The automaton on which an accepting_run() was found. /// The automaton on which an accepting_run() was found.
const const_twa_ptr& const const_twa_ptr&
...@@ -263,7 +263,7 @@ namespace spot ...@@ -263,7 +263,7 @@ namespace spot
/// @{ /// @{
/// An accepted run, for a tgba. /// An accepted run, for a tgba.
struct SPOT_API tgba_run struct SPOT_API twa_run
{ {
struct step { struct step {
const state* s; const state* s;
...@@ -284,39 +284,39 @@ namespace spot ...@@ -284,39 +284,39 @@ namespace spot
steps prefix; steps prefix;
steps cycle; steps cycle;
~tgba_run(); ~twa_run();
tgba_run() twa_run()
{ {
}; };
tgba_run(const tgba_run& run); twa_run(const twa_run& run);
tgba_run& operator=(const tgba_run& run); twa_run& operator=(const twa_run& run);
}; };
/// \brief Display a tgba_run. /// \brief Display a twa_run.
/// ///
/// Output the prefix and cycle parts of the tgba_run \a run on \a os. /// Output the prefix and cycle parts of the twa_run \a run on \a os.
/// ///
/// The automaton \a a is used only to format the states, and /// The automaton \a a is used only to format the states, and
/// to know how to print the BDDs describing the conditions and /// to know how to print the BDDs describing the conditions and
/// acceptance conditions of the run; it is <b>not</b> used to /// acceptance conditions of the run; it is <b>not</b> used to
/// replay the run. In other words this function will work even if /// replay the run. In other words this function will work even if
/// the tgba_run you are trying to print appears to connect states /// the twa_run you are trying to print appears to connect states
/// of \a a that are not connected. /// of \a a that are not connected.
/// ///
/// This is unlike replay_tgba_run(), which will ensure the run /// This is unlike replay_twa_run(), which will ensure the run
/// actually exists in the automaton (and will also display any /// actually exists in the automaton (and will also display any
/// transition annotation). /// transition annotation).
SPOT_API std::ostream& SPOT_API std::ostream&
print_tgba_run(std::ostream& os, print_twa_run(std::ostream& os,
const const_twa_ptr& a, const const_twa_ptr& a,
const const_tgba_run_ptr& run); const const_twa_run_ptr& run);
/// \brief Return an explicit_tgba corresponding to \a run (i.e. comparable /// \brief Return an explicit_tgba corresponding to \a run (i.e. comparable
/// states are merged). /// states are merged).
/// ///
/// \pre \a run must correspond to an actual run of the automaton \a a. /// \pre \a run must correspond to an actual run of the automaton \a a.
SPOT_API twa_graph_ptr SPOT_API twa_graph_ptr
tgba_run_to_tgba(const const_twa_ptr& a, const const_tgba_run_ptr& run); twa_run_to_tgba(const const_twa_ptr& a, const const_twa_run_ptr& run);
/// @} /// @}
......
...@@ -39,7 +39,7 @@ namespace spot ...@@ -39,7 +39,7 @@ namespace spot
} }
const state* const state*
search(const state* start, tgba_run::steps& l) search(const state* start, twa_run::steps& l)
{ {
return this->bfs_steps::search(filter(start), l); return this->bfs_steps::search(filter(start), l);
} }
...@@ -60,7 +60,7 @@ namespace spot ...@@ -60,7 +60,7 @@ namespace spot
} }
bool