An algorithm to complement TGBA into SABA.

* src/saba/sabacomplementtgba.hh,
src/saba/sabacomplementtgba.cc: New.  The algorithm.
* src/saba/Makefile.am: Adjust.
* src/sabatest/sabacomplementtgba.cc, src/sabatest/Makefile.am,
src/sabatest/defs.in: New.  Test the algorithm.
* configure.ac, src/Makefile.am: Adjust to the new directory
`sabatest'.
This commit is contained in:
Guillaume Sadegh 2009-11-30 23:52:37 +01:00
parent 7cb6ff331d
commit d659001f0e
6 changed files with 739 additions and 0 deletions

View file

@ -0,0 +1,80 @@
// Copyright (C) 2009 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
//
// This file is part of Spot, a model checking library.
//
// Spot is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// Spot is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
// License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Spot; see the file COPYING. If not, write to the Free
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
#ifndef SPOT_SABA_SABACOMPLEMENTTGBA_HH
#define SPOT_SABA_SABACOMPLEMENTTGBA_HH
#include <tgba/tgba.hh>
#include <tgba/tgbatba.hh>
#include "saba.hh"
namespace spot
{
/// \brief Complement a TGBA and produce a SABA.
/// \ingroup saba
///
/// The original TGBA is transformed into a States-based
/// Büchi Automaton.
///
/// Several techniques are supposed to by applied on the resulting
/// automaton before its transformation into a TGBA. Those techniques
/// are expected to reduce the size of the automaton.
///
/// This algorithm comes from:
/// \verbatim
/// @Article{ gurumurthy.03.lncs,
/// title = {{On complementing nondeterministic Buchi automata}},
/// author = {Gurumurthy, S. and Kupferman, O. and Somenzi, F. and
/// Vardi, M.Y.},
/// journal = {Lecture notes in computer science},
/// pages = {96--110},
/// year = {2003},
/// publisher = {Springer}
/// }
/// \endverbatim
///
/// The construction is done on-the-fly, by the
/// \c saba_complement_succ_iterator class.
/// \see saba_complement_succ_iterator
class saba_complement_tgba : public saba
{
public:
saba_complement_tgba(const tgba* a);
virtual ~saba_complement_tgba();
// tgba interface
virtual saba_state* get_init_state() const;
virtual saba_succ_iterator*
succ_iter(const saba_state* local_state) const;
virtual bdd_dict* get_dict() const;
virtual std::string format_state(const saba_state* state) const;
virtual bdd all_acceptance_conditions() const;
private:
const tgba_sba_proxy* automaton_;
bdd the_acceptance_cond_;
unsigned nb_states_;
}; // end class tgba_saba_complement.
} // end namespace spot.
#endif // SPOT_SABA_SABACOMPLEMENTTGBA_HH