A tgba can now annotate a transition (i.e., the position of a
tgba_succ_iterator) with some string. This comes handy to associate that transition to its high-level name. * src/tgba/tgba.hh, src/tgba/tgba.cc (tgba::transition_annotation): New method. * src/tgba/tgbaproduct.hh, src/tgba/tgbaproduct.cc (tgba_product::transition_annotation): Implement it. * src/tgba/tgbatba.hh, src/tgba/tgbatba.cc (tgba_tba_proxy::transition_annotation): Likewise. * src/tgbaalgos/replayrun.cc (print_annotation): New function. (replay_tgba_run): Use it.
This commit is contained in:
parent
32403566f6
commit
754d7064ae
8 changed files with 82 additions and 4 deletions
|
|
@ -27,6 +27,19 @@
|
|||
|
||||
namespace spot
|
||||
{
|
||||
namespace
|
||||
{
|
||||
void
|
||||
print_annotation(std::ostream& os, const tgba* a,
|
||||
const tgba_succ_iterator* i)
|
||||
{
|
||||
std::string s = a->transition_annotation(i);
|
||||
if (s == "")
|
||||
return;
|
||||
os << " " << s;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
replay_tgba_run(std::ostream& os, const tgba* a, const tgba_run* run)
|
||||
{
|
||||
|
|
@ -66,6 +79,8 @@ namespace spot
|
|||
|
||||
for (; i != l->end(); ++serial)
|
||||
{
|
||||
// Keep track of the serial associated to each state so we
|
||||
// can note duplicate states and make the replay easier to read.
|
||||
state_map::iterator o = seen.find(s);
|
||||
std::ostringstream msg;
|
||||
if (o != seen.end())
|
||||
|
|
@ -140,8 +155,9 @@ namespace spot
|
|||
for (j->first(); !j->done(); j->next())
|
||||
{
|
||||
const state* s2 = j->current_state();
|
||||
os << " * "
|
||||
<< "label=" << bdd_format_formula(a->get_dict(),
|
||||
os << " *";
|
||||
print_annotation(os, a, j);
|
||||
os << " label=" << bdd_format_formula(a->get_dict(),
|
||||
j->current_condition())
|
||||
<< " and acc="
|
||||
<< bdd_format_accset(a->get_dict(),
|
||||
|
|
@ -152,7 +168,9 @@ namespace spot
|
|||
delete j;
|
||||
return false;
|
||||
}
|
||||
os << "transition with label="
|
||||
os << "transition";
|
||||
print_annotation(os, a, j);
|
||||
os << " with label="
|
||||
<< bdd_format_formula(a->get_dict(), label)
|
||||
<< " and acc=" << bdd_format_accset(a->get_dict(), acc)
|
||||
<< std::endl;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue