diff --git a/NEWS b/NEWS index b5db9869b..0d9820355 100644 --- a/NEWS +++ b/NEWS @@ -30,6 +30,11 @@ New in spot 2.3.1.dev (not yet released) - 'ltl2tgba --any -C -M ...' would not complete automata. + - while not incorrect, the HOA properties output by 'ltl2tgba -M' + could be 'inherently-weak' or 'terminal', while 'ltl2tgba -M -D' + would always report 'weak' automata. Both variants now report the + most precise between 'weak' or 'terminal'. + Deprecation notices: - Using --format=%a to print the number of atomic propositions in diff --git a/spot/twaalgos/minimize.cc b/spot/twaalgos/minimize.cc index 4a199fbd5..355f13fc3 100644 --- a/spot/twaalgos/minimize.cc +++ b/spot/twaalgos/minimize.cc @@ -490,6 +490,13 @@ namespace spot res->prop_deterministic(true); res->prop_weak(true); res->prop_state_acc(true); + // Quickly check if this is a terminal automaton + for (auto& e: res->edges()) + if (e.src == e.dst && e.cond == bddtrue) + { + res->prop_terminal(true); + break; + } return res; } diff --git a/spot/twaalgos/postproc.cc b/spot/twaalgos/postproc.cc index 5b3f2ca29..367757e33 100644 --- a/spot/twaalgos/postproc.cc +++ b/spot/twaalgos/postproc.cc @@ -234,10 +234,11 @@ namespace spot // For Small,High we return the smallest between the output of // the simulation, and that of the deterministic minimization. + // Prefer the deterministic automaton in case of equality. if (PREF_ == Small && level_ == High && simul_) { auto m = minimize_monitor(a); - if (m->num_states() < a->num_states()) + if (m->num_states() <= a->num_states()) a = m; } a->remove_unused_ap(); diff --git a/spot/twaalgos/stripacc.cc b/spot/twaalgos/stripacc.cc index 5010f1711..a4018035a 100644 --- a/spot/twaalgos/stripacc.cc +++ b/spot/twaalgos/stripacc.cc @@ -1,5 +1,5 @@ // -*- coding: utf-8 -*- -// Copyright (C) 2012, 2014, 2015 Laboratoire de Recherche et +// Copyright (C) 2012, 2014, 2015, 2017 Laboratoire de Recherche et // Développement de l'Epita (LRDE). // // This file is part of Spot, a model checking library. @@ -30,5 +30,6 @@ namespace spot t.acc = 0U; a->set_generalized_buchi(0); a->release_named_properties(); + a->prop_weak(true); } } diff --git a/spot/twaalgos/stripacc.hh b/spot/twaalgos/stripacc.hh index b94d5558c..df673d7ff 100644 --- a/spot/twaalgos/stripacc.hh +++ b/spot/twaalgos/stripacc.hh @@ -1,5 +1,5 @@ // -*- coding: utf-8 -*- -// Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et +// Copyright (C) 2012-2014, 2017 Laboratoire de Recherche et // Développement de l'Epita (LRDE). // // This file is part of Spot, a model checking library. @@ -26,7 +26,9 @@ namespace spot /// \ingroup twa_misc /// \brief Remove all acceptance sets from a twa_graph. /// - /// This is equivalent to marking all states/transitions as accepting. + /// This will also set the acceptance condition to true, and mark + /// the automaton as weak. Doing so obviously makes all recognized + /// infinite runs accepting. SPOT_API void strip_acceptance_here(twa_graph_ptr a); } diff --git a/tests/core/monitor.test b/tests/core/monitor.test index d21fb3c9d..e2a251b1f 100755 --- a/tests/core/monitor.test +++ b/tests/core/monitor.test @@ -44,7 +44,7 @@ digraph G { } EOF -expect ltl2tgba --monitor a GFa --hoa<