run: fix reduce on automata with Fin

Reported by Florian Renkin.

* spot/twaalgos/emptiness.cc (reduce): If the automaton uses Fin
acceptance, check the reduced cycle and revert to the original cycle
if necessary.
* tests/python/intrun.py: New file.
* tests/Makefile.am: Add it.
* spot/twaalgos/emptiness.hh: Improve documentation.
This commit is contained in:
Alexandre Duret-Lutz 2020-07-10 18:05:18 +02:00
parent 9caba8bfe8
commit f2403c91dc
5 changed files with 80 additions and 9 deletions

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2011, 2013, 2014, 2015, 2016, 2017, 2018 Laboratoire de
// Copyright (C) 2011, 2013-2018, 2020 Laboratoire de
// Recherche et Developpement de l'Epita (LRDE).
// Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
@ -413,6 +413,12 @@ namespace spot
///
/// Return a run which is still accepting for <code>aut</code>,
/// but is no longer than this one.
///
/// This is done by trying to find a fragment of the accepting
/// single that is accepting, and trying to close a cycle around
/// this fragment with fewer edges than in the original cycle.
/// (This step works best in Fin-less automata.) And then trying
/// to find a shorter prefix leading to any state of the cycle.
twa_run_ptr reduce() const;
/// \brief Project an accepting run