diff --git a/spot/twa/acc.hh b/spot/twa/acc.hh index 56390c227..2ebfa1deb 100644 --- a/spot/twa/acc.hh +++ b/spot/twa/acc.hh @@ -1703,13 +1703,16 @@ namespace spot return is_parity(max, odd); } - /// \brief Remove redundant Fin and Inf. For example in - /// Fin(0)|(Inf(0) & Fin(1)), Inf(0) is true iff Fin(0) is false so - /// we can rewrite it as Fin(0)|Fin(1). - acc_cond - unit_propagation() + /// \brief Remove superfluous Fin and Inf by unit propagation. + /// + /// For example in `Fin(0)|(Inf(0) & Fin(1))`, `Inf(0)` is true + /// iff `Fin(0)` is false so we can rewrite it as `Fin(0)|Fin(1)`. + /// + /// The number of acceptance sets is not modified even if some do + /// not appear in the acceptance condition anymore. + acc_cond unit_propagation() { - return acc_cond(code_.unit_propagation()); + return acc_cond(num_, code_.unit_propagation()); } // Return (true, m) if there exist some acceptance mark m that diff --git a/tests/core/accsimpl.test b/tests/core/accsimpl.test index 2339690bc..17404023f 100755 --- a/tests/core/accsimpl.test +++ b/tests/core/accsimpl.test @@ -1,6 +1,6 @@ #!/bin/sh # -*- coding: utf-8 -*- -# Copyright (C) 2018 Laboratoire de Recherche et Développement de +# Copyright (C) 2018, 2020 Laboratoire de Recherche et Développement de # l'Epita (LRDE). # # This file is part of Spot, a model checking library. @@ -51,3 +51,25 @@ EOF autfilt --simplify-acceptance 325 > 325s exp='3 Fin(0) | (Fin(1) & Inf(2))' test "$exp" = "`autfilt --stats='%a %g' 325s`" + +# This automaton used to cause some issue at some point, because +# simplify_acceptance would simplify the acceptance condition without +# removing the unnecessary set from the resulting automaton. +cat >frenkin <