hoa,dot: propagate state names
* src/hoaparse/hoaparse.yy: Store state names. * src/tgbaalgos/dotty.cc, src/tgbaalgos/hoa.cc: Output them. * src/tgbatest/readsave.test: Test this. * src/tgbatest/hoaparse.test: Update.
This commit is contained in:
parent
ae50155297
commit
9add895ba7
5 changed files with 50 additions and 23 deletions
|
|
@ -46,6 +46,7 @@ namespace spot
|
|||
bool mark_states_ = false;
|
||||
bool opt_scc_ = false;
|
||||
const_tgba_digraph_ptr aut_;
|
||||
std::vector<std::string>* sn_;
|
||||
|
||||
public:
|
||||
dotty_output(std::ostream& os, const char* options)
|
||||
|
|
@ -107,8 +108,12 @@ namespace spot
|
|||
void
|
||||
process_state(unsigned s)
|
||||
{
|
||||
os_ << " " << s << " [label=\"" << escape_str(aut_->format_state(s))
|
||||
<< '"';
|
||||
os_ << " " << s << " [label=\"";
|
||||
if (sn_ && s < sn_->size() && !(*sn_)[s].empty())
|
||||
os_ << escape_str((*sn_)[s]);
|
||||
else
|
||||
os_ << s;
|
||||
os_ << '"';
|
||||
if (mark_states_ && aut_->state_is_accepting(s))
|
||||
os_ << ", peripheries=2";
|
||||
os_ << "]\n";
|
||||
|
|
@ -132,6 +137,7 @@ namespace spot
|
|||
void print(const const_tgba_digraph_ptr& aut)
|
||||
{
|
||||
aut_ = aut;
|
||||
sn_ = aut->get_named_prop<std::vector<std::string>>("state-names");
|
||||
mark_states_ = !opt_force_acc_trans_ && aut_->is_sba();
|
||||
auto si =
|
||||
std::unique_ptr<scc_info>(opt_scc_ ? new scc_info(aut) : nullptr);
|
||||
|
|
|
|||
|
|
@ -283,6 +283,7 @@ namespace spot
|
|||
os << " deterministic";
|
||||
os << nl;
|
||||
os << "--BODY--" << nl;
|
||||
auto sn = aut->get_named_prop<std::vector<std::string>>("state-names");
|
||||
for (unsigned i = 0; i < num_states; ++i)
|
||||
{
|
||||
hoa_acceptance this_acc = acceptance;
|
||||
|
|
@ -291,6 +292,8 @@ namespace spot
|
|||
Hoa_Acceptance_States : Hoa_Acceptance_Transitions);
|
||||
|
||||
os << "State: " << i;
|
||||
if (sn && i < sn->size() && !(*sn)[i].empty())
|
||||
os << " \"" << (*sn)[i] << '"';
|
||||
if (this_acc == Hoa_Acceptance_States)
|
||||
{
|
||||
acc_cond::mark_t acc = 0U;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue