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.
This commit is contained in:
parent
4a91fccc33
commit
4221e68d44
28 changed files with 147 additions and 146 deletions
1
NEWS
1
NEWS
|
|
@ -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)
|
||||||
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)
|
||||||
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[])
|
||||||
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)
|
||||||
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)
|
||||||
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)
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
||||||
++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)
|
||||||
{
|
{
|
||||||
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)
|
||||||
{
|
{
|
||||||
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
|
||||||
/// 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
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
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 @@
|
||||||
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
|
||||||
///
|
///
|
||||||
/// \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
|
||||||
/// 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
|
||||||
/// 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 @@
|
||||||
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
|
||||||
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
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
|
||||||
// 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
|
||||||
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
|
||||||
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
|
||||||
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 @@
|
||||||
|
|
||||||
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
|
||||||
///
|
///
|
||||||
/// 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
|
||||||
/// 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
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/// 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
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
match(tgba_run::step&, const state* dest)
|
match(twa_run::step&, const state* dest)
|
||||||
{
|
{
|
||||||
return target->find(dest) != target->end();
|
return target->find(dest) != target->end();
|
||||||
}
|
}
|
||||||
|
|
@ -91,10 +91,10 @@ namespace spot
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_run_ptr
|
twa_run_ptr
|
||||||
couvreur99_check_result::accepting_run()
|
couvreur99_check_result::accepting_run()
|
||||||
{
|
{
|
||||||
run_ = std::make_shared<tgba_run>();
|
run_ = std::make_shared<twa_run>();
|
||||||
|
|
||||||
assert(!ecs_->root.empty());
|
assert(!ecs_->root.empty());
|
||||||
|
|
||||||
|
|
@ -106,7 +106,7 @@ namespace spot
|
||||||
|
|
||||||
// Register all states from the cycle as target of the BFS.
|
// Register all states from the cycle as target of the BFS.
|
||||||
state_set ss;
|
state_set ss;
|
||||||
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)
|
||||||
ss.insert(i->s);
|
ss.insert(i->s);
|
||||||
shortest_path shpath(&ss, ecs_, this);
|
shortest_path shpath(&ss, ecs_, this);
|
||||||
|
|
@ -132,7 +132,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
// Locate cycle_entry_point on the cycle.
|
// Locate cycle_entry_point on the cycle.
|
||||||
tgba_run::steps::iterator cycle_ep_it;
|
twa_run::steps::iterator cycle_ep_it;
|
||||||
for (cycle_ep_it = run_->cycle.begin();
|
for (cycle_ep_it = run_->cycle.begin();
|
||||||
cycle_ep_it != run_->cycle.end()
|
cycle_ep_it != run_->cycle.end()
|
||||||
&& cycle_entry_point->compare(cycle_ep_it->s); ++cycle_ep_it)
|
&& cycle_entry_point->compare(cycle_ep_it->s); ++cycle_ep_it)
|
||||||
|
|
@ -201,7 +201,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool
|
virtual bool
|
||||||
match(tgba_run::step& st, const state* s)
|
match(twa_run::step& st, const state* s)
|
||||||
{
|
{
|
||||||
acc_cond::mark_t less_acc =
|
acc_cond::mark_t less_acc =
|
||||||
acc_to_traverse - st.acc;
|
acc_to_traverse - st.acc;
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ namespace spot
|
||||||
std::shared_ptr<const couvreur99_check_status>& ecs,
|
std::shared_ptr<const couvreur99_check_status>& ecs,
|
||||||
option_map o = option_map());
|
option_map o = option_map());
|
||||||
|
|
||||||
virtual tgba_run_ptr accepting_run();
|
virtual twa_run_ptr accepting_run();
|
||||||
|
|
||||||
void print_stats(std::ostream& os) const;
|
void print_stats(std::ostream& os) const;
|
||||||
|
|
||||||
|
|
@ -51,6 +51,6 @@ namespace spot
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<const couvreur99_check_status> ecs_;
|
std::shared_ptr<const couvreur99_check_status> ecs_;
|
||||||
tgba_run_ptr run_;
|
twa_run_ptr run_;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -284,10 +284,10 @@ namespace spot
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual tgba_run_ptr
|
virtual twa_run_ptr
|
||||||
accepting_run()
|
accepting_run()
|
||||||
{
|
{
|
||||||
auto res = std::make_shared<tgba_run>();
|
auto res = std::make_shared<twa_run>();
|
||||||
|
|
||||||
update_lowlinks();
|
update_lowlinks();
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
|
|
@ -309,7 +309,7 @@ namespace spot
|
||||||
int father = data.stack[scc_root].pre;
|
int father = data.stack[scc_root].pre;
|
||||||
while (father >= 0)
|
while (father >= 0)
|
||||||
{
|
{
|
||||||
tgba_run::step st =
|
twa_run::step st =
|
||||||
{
|
{
|
||||||
data.stack[father].s->clone(),
|
data.stack[father].s->clone(),
|
||||||
data.stack[father].lasttr->current_condition(),
|
data.stack[father].lasttr->current_condition(),
|
||||||
|
|
@ -360,7 +360,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool
|
virtual bool
|
||||||
match(tgba_run::step& step, const state*)
|
match(twa_run::step& step, const state*)
|
||||||
{
|
{
|
||||||
return step.acc != 0U;
|
return step.acc != 0U;
|
||||||
}
|
}
|
||||||
|
|
@ -375,7 +375,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool
|
virtual bool
|
||||||
match(tgba_run::step&, const state* s)
|
match(twa_run::step&, const state* s)
|
||||||
{
|
{
|
||||||
return s == target;
|
return s == target;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -328,15 +328,15 @@ namespace spot
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual tgba_run_ptr accepting_run()
|
virtual twa_run_ptr accepting_run()
|
||||||
{
|
{
|
||||||
assert(!ms_->st_blue.empty());
|
assert(!ms_->st_blue.empty());
|
||||||
assert(!ms_->st_red.empty());
|
assert(!ms_->st_red.empty());
|
||||||
|
|
||||||
auto run = std::make_shared<tgba_run>();
|
auto run = std::make_shared<twa_run>();
|
||||||
|
|
||||||
typename stack_type::const_reverse_iterator i, j, end;
|
typename stack_type::const_reverse_iterator i, j, end;
|
||||||
tgba_run::steps* l;
|
twa_run::steps* l;
|
||||||
|
|
||||||
l = &run->prefix;
|
l = &run->prefix;
|
||||||
|
|
||||||
|
|
@ -345,21 +345,21 @@ namespace spot
|
||||||
j = i; ++j;
|
j = i; ++j;
|
||||||
for (; i != end; ++i, ++j)
|
for (; i != end; ++i, ++j)
|
||||||
{
|
{
|
||||||
tgba_run::step s = { i->s->clone(), j->label, j->acc };
|
twa_run::step s = { i->s->clone(), j->label, j->acc };
|
||||||
l->push_back(s);
|
l->push_back(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
l = &run->cycle;
|
l = &run->cycle;
|
||||||
|
|
||||||
j = ms_->st_red.rbegin();
|
j = ms_->st_red.rbegin();
|
||||||
tgba_run::step s = { i->s->clone(), j->label, j->acc };
|
twa_run::step s = { i->s->clone(), j->label, j->acc };
|
||||||
l->push_back(s);
|
l->push_back(s);
|
||||||
|
|
||||||
i = j; ++j;
|
i = j; ++j;
|
||||||
end = ms_->st_red.rend(); --end;
|
end = ms_->st_red.rend(); --end;
|
||||||
for (; i != end; ++i, ++j)
|
for (; i != end; ++i, ++j)
|
||||||
{
|
{
|
||||||
tgba_run::step s = { i->s->clone(), j->label, j->acc };
|
twa_run::step s = { i->s->clone(), j->label, j->acc };
|
||||||
l->push_back(s);
|
l->push_back(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -408,7 +408,7 @@ namespace spot
|
||||||
delete computer;
|
delete computer;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual tgba_run_ptr accepting_run()
|
virtual twa_run_ptr accepting_run()
|
||||||
{
|
{
|
||||||
return computer->accepting_run();
|
return computer->accepting_run();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool
|
virtual bool
|
||||||
match(tgba_run::step&, const state* to)
|
match(twa_run::step&, const state* to)
|
||||||
{
|
{
|
||||||
return to == dest;
|
return to == dest;
|
||||||
}
|
}
|
||||||
|
|
@ -220,14 +220,14 @@ namespace spot
|
||||||
|
|
||||||
// Find a loop around START in SCC #n.
|
// Find a loop around START in SCC #n.
|
||||||
wdba_search_acc_loop wsal(det_a, scc_n, sm, pm, start);
|
wdba_search_acc_loop wsal(det_a, scc_n, sm, pm, start);
|
||||||
tgba_run::steps loop;
|
twa_run::steps loop;
|
||||||
const state* reached = wsal.search(start, loop);
|
const state* reached = wsal.search(start, loop);
|
||||||
assert(reached == start);
|
assert(reached == start);
|
||||||
(void)reached;
|
(void)reached;
|
||||||
|
|
||||||
// Build an automaton representing this loop.
|
// Build an automaton representing this loop.
|
||||||
auto loop_a = make_twa_graph(det_a->get_dict());
|
auto loop_a = make_twa_graph(det_a->get_dict());
|
||||||
tgba_run::steps::const_iterator i;
|
twa_run::steps::const_iterator i;
|
||||||
int loop_size = loop.size();
|
int loop_size = loop.size();
|
||||||
loop_a->new_states(loop_size);
|
loop_a->new_states(loop_size);
|
||||||
int n;
|
int n;
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ namespace spot
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual tgba_run_ptr accepting_run()
|
virtual twa_run_ptr accepting_run()
|
||||||
{
|
{
|
||||||
const stack_type& stb = ms_->get_st_blue();
|
const stack_type& stb = ms_->get_st_blue();
|
||||||
const stack_type& str = ms_->get_st_red();
|
const stack_type& str = ms_->get_st_red();
|
||||||
|
|
@ -194,7 +194,7 @@ namespace spot
|
||||||
|
|
||||||
assert(!acc_trans.empty());
|
assert(!acc_trans.empty());
|
||||||
|
|
||||||
auto run = std::make_shared<tgba_run>();
|
auto run = std::make_shared<twa_run>();
|
||||||
// construct run->cycle from acc_trans.
|
// construct run->cycle from acc_trans.
|
||||||
construct_cycle(run, acc_trans);
|
construct_cycle(run, acc_trans);
|
||||||
// construct run->prefix (a minimal path from the initial state to any
|
// construct run->prefix (a minimal path from the initial state to any
|
||||||
|
|
@ -389,7 +389,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const state* search(const state* start, tgba_run::steps& l)
|
const state* search(const state* start, twa_run::steps& l)
|
||||||
{
|
{
|
||||||
const state* s = filter(start);
|
const state* s = filter(start);
|
||||||
if (s)
|
if (s)
|
||||||
|
|
@ -412,9 +412,9 @@ namespace spot
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
void finalize(const std::map<const state*, tgba_run::step,
|
void finalize(const std::map<const state*, twa_run::step,
|
||||||
state_ptr_less_than>&,
|
state_ptr_less_than>&,
|
||||||
const tgba_run::step&, const state*, tgba_run::steps&)
|
const twa_run::step&, const state*, twa_run::steps&)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -423,7 +423,7 @@ namespace spot
|
||||||
return seen;
|
return seen;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool match(tgba_run::step&, const state* dest)
|
bool match(twa_run::step&, const state* dest)
|
||||||
{
|
{
|
||||||
return target->compare(dest) == 0;
|
return target->compare(dest) == 0;
|
||||||
}
|
}
|
||||||
|
|
@ -438,7 +438,7 @@ namespace spot
|
||||||
|
|
||||||
bool search(const state* start, const state* target, state_set& dead)
|
bool search(const state* start, const state* target, state_set& dead)
|
||||||
{
|
{
|
||||||
tgba_run::steps path;
|
twa_run::steps path;
|
||||||
if (start->compare(target) == 0)
|
if (start->compare(target) == 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
@ -484,7 +484,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const state* search(const state* start, tgba_run::steps& l)
|
const state* search(const state* start, twa_run::steps& l)
|
||||||
{
|
{
|
||||||
const state* s = filter(start);
|
const state* s = filter(start);
|
||||||
if (s)
|
if (s)
|
||||||
|
|
@ -514,7 +514,7 @@ namespace spot
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool match(tgba_run::step&, const state* dest)
|
bool match(twa_run::step&, const state* dest)
|
||||||
{
|
{
|
||||||
ndfsr_trace << "match: " << a_->format_state(dest)
|
ndfsr_trace << "match: " << a_->format_state(dest)
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
@ -528,7 +528,7 @@ namespace spot
|
||||||
const heap& h;
|
const heap& h;
|
||||||
};
|
};
|
||||||
|
|
||||||
void construct_cycle(tgba_run_ptr run,
|
void construct_cycle(twa_run_ptr run,
|
||||||
const accepting_transitions_list& acc_trans)
|
const accepting_transitions_list& acc_trans)
|
||||||
{
|
{
|
||||||
assert(!acc_trans.empty());
|
assert(!acc_trans.empty());
|
||||||
|
|
@ -551,7 +551,7 @@ namespace spot
|
||||||
ndfsr_trace << "(self loop " << a_->format_state(i->source)
|
ndfsr_trace << "(self loop " << a_->format_state(i->source)
|
||||||
<< " -> " << a_->format_state(i->dest)
|
<< " -> " << a_->format_state(i->dest)
|
||||||
<< " ignored) ";
|
<< " ignored) ";
|
||||||
tgba_run::step st = { i->source->clone(), i->label, i->acc };
|
twa_run::step st = { i->source->clone(), i->label, i->acc };
|
||||||
run->cycle.push_back(st);
|
run->cycle.push_back(st);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -563,7 +563,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
ndfsr_trace << std::endl;
|
ndfsr_trace << std::endl;
|
||||||
|
|
||||||
tgba_run::step st = { current.source->clone(), current.label,
|
twa_run::step st = { current.source->clone(), current.label,
|
||||||
current.acc };
|
current.acc };
|
||||||
run->cycle.push_back(st);
|
run->cycle.push_back(st);
|
||||||
|
|
||||||
|
|
@ -590,7 +590,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
current = i->second;
|
current = i->second;
|
||||||
// complete the path with the corresponding transition
|
// complete the path with the corresponding transition
|
||||||
tgba_run::step st = { current.source->clone(), current.label,
|
twa_run::step st = { current.source->clone(), current.label,
|
||||||
current.acc };
|
current.acc };
|
||||||
run->cycle.push_back(st);
|
run->cycle.push_back(st);
|
||||||
// remove this source state of target
|
// remove this source state of target
|
||||||
|
|
@ -617,7 +617,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void construct_prefix(tgba_run_ptr run)
|
void construct_prefix(twa_run_ptr run)
|
||||||
{
|
{
|
||||||
m_source_trans target;
|
m_source_trans target;
|
||||||
transition tmp;
|
transition tmp;
|
||||||
|
|
@ -625,7 +625,7 @@ namespace spot
|
||||||
tmp.acc = 0U;
|
tmp.acc = 0U;
|
||||||
|
|
||||||
// Register all states from the cycle as target of the BFS.
|
// Register all states from the cycle as target of the BFS.
|
||||||
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)
|
||||||
target.emplace(i->s, tmp);
|
target.emplace(i->s, tmp);
|
||||||
|
|
||||||
|
|
@ -653,7 +653,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
// Locate cycle_entry_point on the cycle.
|
// Locate cycle_entry_point on the cycle.
|
||||||
tgba_run::steps::iterator cycle_ep_it;
|
twa_run::steps::iterator cycle_ep_it;
|
||||||
for (cycle_ep_it = run->cycle.begin();
|
for (cycle_ep_it = run->cycle.begin();
|
||||||
cycle_ep_it != run->cycle.end()
|
cycle_ep_it != run->cycle.end()
|
||||||
&& cycle_entry_point->compare(cycle_ep_it->s); ++cycle_ep_it)
|
&& cycle_entry_point->compare(cycle_ep_it->s); ++cycle_ep_it)
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,12 @@
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
|
|
||||||
tgba_run_ptr
|
twa_run_ptr
|
||||||
project_tgba_run(const const_twa_ptr& a_run,
|
project_twa_run(const const_twa_ptr& a_run,
|
||||||
const const_twa_ptr& a_proj,
|
const const_twa_ptr& a_proj,
|
||||||
const const_tgba_run_ptr& run)
|
const const_twa_run_ptr& run)
|
||||||
{
|
{
|
||||||
auto res = std::make_shared<tgba_run>();
|
auto res = std::make_shared<twa_run>();
|
||||||
for (auto& i: run->prefix)
|
for (auto& i: run->prefix)
|
||||||
res->prefix.emplace_back(a_run->project_state(i.s, a_proj),
|
res->prefix.emplace_back(a_run->project_state(i.s, a_proj),
|
||||||
i.label, i.acc);
|
i.label, i.acc);
|
||||||
|
|
|
||||||
|
|
@ -29,20 +29,20 @@
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
struct tgba_run;
|
struct twa_run;
|
||||||
|
|
||||||
/// \ingroup twa_run
|
/// \ingroup twa_run
|
||||||
/// \brief Project a tgba_run on a tgba.
|
/// \brief Project a twa_run on a tgba.
|
||||||
///
|
///
|
||||||
/// If a tgba_run has been generated on a product, or any other
|
/// If a twa_run has been generated on a product, or any other
|
||||||
/// on-the-fly algorithm with tgba operands,
|
/// on-the-fly algorithm with tgba operands,
|
||||||
///
|
///
|
||||||
/// \param run the run to replay
|
/// \param run the run to replay
|
||||||
/// \param a_run the automata on which the run was generated
|
/// \param a_run the automata on which the run was generated
|
||||||
/// \param a_proj the automata on which to project the run
|
/// \param a_proj the automata on which to project the run
|
||||||
/// \return true iff the run could be completed
|
/// \return true iff the run could be completed
|
||||||
SPOT_API tgba_run_ptr
|
SPOT_API twa_run_ptr
|
||||||
project_tgba_run(const const_twa_ptr& a_run,
|
project_twa_run(const const_twa_ptr& a_run,
|
||||||
const const_twa_ptr& a_proj,
|
const const_twa_ptr& a_proj,
|
||||||
const const_tgba_run_ptr& run);
|
const const_twa_run_ptr& run);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,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);
|
||||||
}
|
}
|
||||||
|
|
@ -76,7 +76,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
match(tgba_run::step&, const state* dest)
|
match(twa_run::step&, const state* dest)
|
||||||
{
|
{
|
||||||
return target->find(dest) != target->end();
|
return target->find(dest) != target->end();
|
||||||
}
|
}
|
||||||
|
|
@ -87,10 +87,10 @@ namespace spot
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_run_ptr
|
twa_run_ptr
|
||||||
reduce_run(const const_twa_ptr& a, const const_tgba_run_ptr& org)
|
reduce_run(const const_twa_ptr& a, const const_twa_run_ptr& org)
|
||||||
{
|
{
|
||||||
auto res = std::make_shared<tgba_run>();
|
auto res = std::make_shared<twa_run>();
|
||||||
state_set ss;
|
state_set ss;
|
||||||
shortest_path shpath(a);
|
shortest_path shpath(a);
|
||||||
shpath.set_target(&ss);
|
shpath.set_target(&ss);
|
||||||
|
|
@ -104,7 +104,7 @@ namespace spot
|
||||||
// Start from the end of the original cycle, and rewind until all
|
// Start from the end of the original cycle, and rewind until all
|
||||||
// acceptance sets have been seen.
|
// acceptance sets have been seen.
|
||||||
acc_cond::mark_t seen_acc = 0U;
|
acc_cond::mark_t seen_acc = 0U;
|
||||||
tgba_run::steps::const_iterator seg = org->cycle.end();
|
twa_run::steps::const_iterator seg = org->cycle.end();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
assert(seg != org->cycle.begin());
|
assert(seg != org->cycle.begin());
|
||||||
|
|
@ -122,7 +122,7 @@ namespace spot
|
||||||
assert(seg != org->cycle.end());
|
assert(seg != org->cycle.end());
|
||||||
seen_acc |= seg->acc;
|
seen_acc |= seg->acc;
|
||||||
|
|
||||||
tgba_run::step st = { seg->s->clone(), seg->label, seg->acc };
|
twa_run::step st = { seg->s->clone(), seg->label, seg->acc };
|
||||||
res->cycle.push_back(st);
|
res->cycle.push_back(st);
|
||||||
|
|
||||||
++seg;
|
++seg;
|
||||||
|
|
@ -145,7 +145,7 @@ namespace spot
|
||||||
// state of the automata to any state of the cycle.
|
// state of the automata to any state of the cycle.
|
||||||
|
|
||||||
// Register all states from the cycle as target of the BFS.
|
// Register all states from the cycle as target of the BFS.
|
||||||
for (tgba_run::steps::const_iterator i = res->cycle.begin();
|
for (twa_run::steps::const_iterator i = res->cycle.begin();
|
||||||
i != res->cycle.end(); ++i)
|
i != res->cycle.end(); ++i)
|
||||||
ss.insert(i->s);
|
ss.insert(i->s);
|
||||||
|
|
||||||
|
|
@ -170,7 +170,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
// Locate cycle_entry_point on the cycle.
|
// Locate cycle_entry_point on the cycle.
|
||||||
tgba_run::steps::iterator cycle_ep_it;
|
twa_run::steps::iterator cycle_ep_it;
|
||||||
for (cycle_ep_it = res->cycle.begin();
|
for (cycle_ep_it = res->cycle.begin();
|
||||||
cycle_ep_it != res->cycle.end()
|
cycle_ep_it != res->cycle.end()
|
||||||
&& cycle_entry_point->compare(cycle_ep_it->s); ++cycle_ep_it)
|
&& cycle_entry_point->compare(cycle_ep_it->s); ++cycle_ep_it)
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,6 @@ namespace spot
|
||||||
///
|
///
|
||||||
/// Return a run which is accepting for \a a and that is no longer
|
/// Return a run which is accepting for \a a and that is no longer
|
||||||
/// than \a org.
|
/// than \a org.
|
||||||
SPOT_API tgba_run_ptr
|
SPOT_API twa_run_ptr
|
||||||
reduce_run(const const_twa_ptr& a, const const_tgba_run_ptr& org);
|
reduce_run(const const_twa_ptr& a, const const_twa_run_ptr& org);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,12 +44,12 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
replay_tgba_run(std::ostream& os, const const_twa_ptr& a,
|
replay_twa_run(std::ostream& os, const const_twa_ptr& a,
|
||||||
const const_tgba_run_ptr& run, bool debug)
|
const const_twa_run_ptr& run, bool debug)
|
||||||
{
|
{
|
||||||
const state* s = a->get_init_state();
|
const state* s = a->get_init_state();
|
||||||
int serial = 1;
|
int serial = 1;
|
||||||
const tgba_run::steps* l;
|
const twa_run::steps* l;
|
||||||
std::string in;
|
std::string in;
|
||||||
acc_cond::mark_t all_acc = 0U;
|
acc_cond::mark_t all_acc = 0U;
|
||||||
bool all_acc_seen = false;
|
bool all_acc_seen = false;
|
||||||
|
|
@ -72,7 +72,7 @@ namespace spot
|
||||||
os << "Prefix:\n";
|
os << "Prefix:\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_run::steps::const_iterator i = l->begin();
|
twa_run::steps::const_iterator i = l->begin();
|
||||||
|
|
||||||
if (s->compare(i->s))
|
if (s->compare(i->s))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,12 @@
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
struct tgba_run;
|
struct twa_run;
|
||||||
|
|
||||||
/// \ingroup twa_run
|
/// \ingroup twa_run
|
||||||
/// \brief Replay a tgba_run on a tgba.
|
/// \brief Replay a twa_run on a tgba.
|
||||||
///
|
///
|
||||||
/// This is similar to print_tgba_run(), except that the run is
|
/// This is similar to print_twa_run(), except that the run is
|
||||||
/// actually replayed on the automaton while it is printed. Doing
|
/// actually replayed on the automaton while it is printed. Doing
|
||||||
/// so makes it possible to display transition annotations (returned
|
/// so makes it possible to display transition annotations (returned
|
||||||
/// by spot::tgba::transition_annotation()). The output will stop
|
/// by spot::tgba::transition_annotation()). The output will stop
|
||||||
|
|
@ -47,8 +47,8 @@ namespace spot
|
||||||
/// debugging informations will be output on failure
|
/// debugging informations will be output on failure
|
||||||
/// \return true iff the run could be completed
|
/// \return true iff the run could be completed
|
||||||
SPOT_API bool
|
SPOT_API bool
|
||||||
replay_tgba_run(std::ostream& os,
|
replay_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,
|
||||||
bool debug = false);
|
bool debug = false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -334,15 +334,15 @@ namespace spot
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual tgba_run_ptr accepting_run()
|
virtual twa_run_ptr accepting_run()
|
||||||
{
|
{
|
||||||
assert(!ms_->st_blue.empty());
|
assert(!ms_->st_blue.empty());
|
||||||
assert(!ms_->st_red.empty());
|
assert(!ms_->st_red.empty());
|
||||||
|
|
||||||
auto run = std::make_shared<tgba_run>();
|
auto run = std::make_shared<twa_run>();
|
||||||
|
|
||||||
typename stack_type::const_reverse_iterator i, j, end;
|
typename stack_type::const_reverse_iterator i, j, end;
|
||||||
tgba_run::steps* l;
|
twa_run::steps* l;
|
||||||
|
|
||||||
const state* target = ms_->st_red.front().s;
|
const state* target = ms_->st_red.front().s;
|
||||||
|
|
||||||
|
|
@ -355,7 +355,7 @@ namespace spot
|
||||||
{
|
{
|
||||||
if (l == &run->prefix && i->s->compare(target) == 0)
|
if (l == &run->prefix && i->s->compare(target) == 0)
|
||||||
l = &run->cycle;
|
l = &run->cycle;
|
||||||
tgba_run::step s = { i->s->clone(), j->label, j->acc };
|
twa_run::step s = { i->s->clone(), j->label, j->acc };
|
||||||
l->push_back(s);
|
l->push_back(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -364,14 +364,14 @@ namespace spot
|
||||||
assert(l == &run->cycle);
|
assert(l == &run->cycle);
|
||||||
|
|
||||||
j = ms_->st_red.rbegin();
|
j = ms_->st_red.rbegin();
|
||||||
tgba_run::step s = { i->s->clone(), j->label, j->acc };
|
twa_run::step s = { i->s->clone(), j->label, j->acc };
|
||||||
l->push_back(s);
|
l->push_back(s);
|
||||||
|
|
||||||
i = j; ++j;
|
i = j; ++j;
|
||||||
end = ms_->st_red.rend(); --end;
|
end = ms_->st_red.rend(); --end;
|
||||||
for (; i != end; ++i, ++j)
|
for (; i != end; ++i, ++j)
|
||||||
{
|
{
|
||||||
tgba_run::step s = { i->s->clone(), j->label, j->acc };
|
twa_run::step s = { i->s->clone(), j->label, j->acc };
|
||||||
l->push_back(s);
|
l->push_back(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -420,7 +420,7 @@ namespace spot
|
||||||
delete computer;
|
delete computer;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual tgba_run_ptr accepting_run()
|
virtual twa_run_ptr accepting_run()
|
||||||
{
|
{
|
||||||
return computer->accepting_run();
|
return computer->accepting_run();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,12 @@
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
tgba_word::tgba_word(const tgba_run_ptr run)
|
tgba_word::tgba_word(const twa_run_ptr run)
|
||||||
{
|
{
|
||||||
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)
|
||||||
prefix.push_back(i->label);
|
prefix.push_back(i->label);
|
||||||
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)
|
||||||
cycle.push_back(i->label);
|
cycle.push_back(i->label);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ namespace spot
|
||||||
/// \brief An infinite word stored as a lasso.
|
/// \brief An infinite word stored as a lasso.
|
||||||
struct SPOT_API tgba_word
|
struct SPOT_API tgba_word
|
||||||
{
|
{
|
||||||
tgba_word(const tgba_run_ptr run);
|
tgba_word(const twa_run_ptr run);
|
||||||
void simplify();
|
void simplify();
|
||||||
std::ostream& print(std::ostream& os, const bdd_dict_ptr& d) const;
|
std::ostream& print(std::ostream& os, const bdd_dict_ptr& d) const;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -841,12 +841,12 @@ if output_type == 'r':
|
||||||
if ec_run:
|
if ec_run:
|
||||||
if print_acc_run:
|
if print_acc_run:
|
||||||
s = spot.ostringstream()
|
s = spot.ostringstream()
|
||||||
spot.print_tgba_run(s, ec_a, ec_run)
|
spot.print_twa_run(s, ec_a, ec_run)
|
||||||
unbufprint('<div class="accrun">%s</div>' %
|
unbufprint('<div class="accrun">%s</div>' %
|
||||||
cgi.escape(s.str()))
|
cgi.escape(s.str()))
|
||||||
del s
|
del s
|
||||||
if draw_acc_run:
|
if draw_acc_run:
|
||||||
render_automaton(spot.tgba_run_to_tgba(ec_a, ec_run), False)
|
render_automaton(spot.twa_run_to_tgba(ec_a, ec_run), False)
|
||||||
del ec_run
|
del ec_run
|
||||||
del ec_res
|
del ec_res
|
||||||
unbufprint('</div>')
|
unbufprint('</div>')
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
%shared_ptr(spot::taa_tgba_string)
|
%shared_ptr(spot::taa_tgba_string)
|
||||||
%shared_ptr(spot::taa_tgba_formula)
|
%shared_ptr(spot::taa_tgba_formula)
|
||||||
%shared_ptr(spot::twa_safra_complement)
|
%shared_ptr(spot::twa_safra_complement)
|
||||||
%shared_ptr(spot::tgba_run)
|
%shared_ptr(spot::twa_run)
|
||||||
%shared_ptr(spot::emptiness_check_result)
|
%shared_ptr(spot::emptiness_check_result)
|
||||||
%shared_ptr(spot::emptiness_check)
|
%shared_ptr(spot::emptiness_check)
|
||||||
%shared_ptr(spot::emptiness_check_instantiator)
|
%shared_ptr(spot::emptiness_check_instantiator)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue