never: use state-names as comments

* src/tgbaalgos/neverclaim.cc: Here.
* src/hoaparse/hoaparse.yy: Use set_acceptance_conditions() to set
the number of acceptance sets.  Otherwise, the single_acc_set property
is not set.
* src/tgbaalgos/postproc.cc: When expecting a BA or a monitor, do not do
anything if the input is already a BA or a monitor.
* src/tgbatest/hoaparse.test: Add a test case.
* src/tgbatest/readsave.test: Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2015-01-25 13:02:28 +01:00
parent c44b158716
commit e5294aac21
5 changed files with 55 additions and 17 deletions

View file

@ -38,6 +38,7 @@ namespace spot
public:
std::ostream& os_;
bool opt_comments_ = false;
std::vector<std::string>* 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<std::vector<std::string>>("state-names");
start();
unsigned init = aut_->get_init_state_number();
unsigned ns = aut_->num_states();

View file

@ -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;