diff --git a/src/hoaparse/hoaparse.yy b/src/hoaparse/hoaparse.yy index c7d8a051d..d06935d92 100644 --- a/src/hoaparse/hoaparse.yy +++ b/src/hoaparse/hoaparse.yy @@ -482,7 +482,7 @@ header-item: "States:" INT } else { - res.h->aut->acc().add_sets($2); + res.h->aut->set_acceptance_conditions($2); res.accset = $2; res.accset_loc = @1 + @2; } @@ -1200,7 +1200,7 @@ nc-transition: lbtt: lbtt-header lbtt-body ENDAUT | lbtt-header-states LBTT_EMPTY { - res.h->aut->acc().add_sets($2); + res.h->aut->set_acceptance_conditions($2); } lbtt-header-states: LBTT @@ -1403,6 +1403,9 @@ static void fix_properties(result_& r) { r.h->aut->prop_deterministic(r.deterministic); //r.h->aut->prop_complete(r.complete); + if (r.acc_style == State_Acc || + (r.acc_style == Mixed_Acc && !r.trans_acc_seen)) + r.h->aut->prop_state_based_acc(); } namespace spot @@ -1454,9 +1457,6 @@ namespace spot r.h->aut->set_named_prop("state-names", r.state_names); if (r.neg_acc_sets) fix_acceptance(r); - if (r.acc_style == State_Acc || - (r.acc_style == Mixed_Acc && !r.trans_acc_seen)) - r.h->aut->prop_state_based_acc(); fix_initial_state(r); fix_properties(r); return r.h; diff --git a/src/tgbaalgos/neverclaim.cc b/src/tgbaalgos/neverclaim.cc index 0c75b0fa4..90ad8becb 100644 --- a/src/tgbaalgos/neverclaim.cc +++ b/src/tgbaalgos/neverclaim.cc @@ -38,6 +38,7 @@ namespace spot public: std::ostream& os_; bool opt_comments_ = false; + std::vector* sn_ = nullptr; bool opt_624_ = false; const_tgba_digraph_ptr aut_; bool fi_needed_ = false; @@ -97,8 +98,9 @@ namespace spot void print_comment(unsigned n) const { - if (opt_comments_) - os_ << " /* " << aut_->format_state(n) << " */"; + if (sn_) + if (n < sn_->size() && !(*sn_)[n].empty()) + os_ << " /* " << (*sn_)[n] << " */"; } void @@ -184,6 +186,8 @@ namespace spot void print(const const_tgba_digraph_ptr& aut) { aut_ = aut; + if (opt_comments_) + sn_ = aut->get_named_prop>("state-names"); start(); unsigned init = aut_->get_init_state_number(); unsigned ns = aut_->num_states(); diff --git a/src/tgbaalgos/postproc.cc b/src/tgbaalgos/postproc.cc index da4fccdaa..7cf4f61fe 100644 --- a/src/tgbaalgos/postproc.cc +++ b/src/tgbaalgos/postproc.cc @@ -124,12 +124,15 @@ namespace spot tgba_digraph_ptr postprocessor::run(tgba_digraph_ptr a, const ltl::formula* f) { - if (type_ == TGBA && PREF_ == Any && level_ == Low) - { - if (COMP_) - a = tgba_complete(a); - return a; - } + if (PREF_ == Any && level_ == Low) + if (type_ == TGBA + || (type_ == BA && a->is_sba()) + || (type_ == Monitor && a->acc().num_sets() == 0)) + { + if (COMP_) + a = tgba_complete(a); + return a; + } if (simul_ < 0) simul_ = (level_ == Low) ? 1 : 3; diff --git a/src/tgbatest/hoaparse.test b/src/tgbatest/hoaparse.test index 0e448fc2e..89987ff0d 100755 --- a/src/tgbatest/hoaparse.test +++ b/src/tgbatest/hoaparse.test @@ -1283,3 +1283,34 @@ State: 2 "G((F(a) && F((b) && (c))) && F((d) || (e)))" [0&1&2&3 | 0&1&2&4] 2 {0 1 2} --END-- EOF + + +# name states can be output as comments in never claim +cat >input < goto accept_all + :: ((a) && (!(b))) -> goto T0_init + fi; +accept_all: /* s0 */ + skip +} +EOF diff --git a/src/tgbatest/readsave.test b/src/tgbatest/readsave.test index 236378577..ff5766f02 100755 --- a/src/tgbatest/readsave.test +++ b/src/tgbatest/readsave.test @@ -315,18 +315,18 @@ digraph G { I -> 3 subgraph cluster_0 { label="" - 1 [label="s1"] + 1 [label="s1", peripheries=2] } subgraph cluster_1 { label="" - 0 [label="s0"] + 0 [label="s0", peripheries=2] } subgraph cluster_2 { label="" 3 [label="s3"] } - 0 -> 0 [label="b\n{0}"] - 1 -> 1 [label="a\n{0}"] + 0 -> 0 [label="b"] + 1 -> 1 [label="a"] 2 [label="s2"] 2 -> 0 [label="b"] 3 -> 1 [label="a"]