Commit c2ae99e7 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

rename the spot::tgba class as spot::twa

Now that we support any type of omega-accetpance, not just "Generalized
Büchi", it is time to move away from GB and replace it by "ω", written
just w in ASCII.

This just change the name of the tgba class.  This part has to be done
by hand because the word "tgba" occurs in many contexts and a mass
replacement would be wrong.

This will be followed by some automatic renaming of all the derived
types and more.

* src/bin/autfilt.cc, src/bin/randaut.cc, src/kripke/fairkripke.hh,
src/ta/tgta.cc, src/ta/tgta.hh, src/tgba/fwd.hh, src/tgba/taatgba.cc,
src/tgba/taatgba.hh, src/tgba/tgba.cc, src/tgba/tgba.hh,
src/tgba/tgbagraph.hh, src/tgba/tgbaproduct.cc, src/tgba/tgbaproduct.hh,
src/tgba/tgbaproxy.cc, src/tgba/tgbaproxy.hh,
src/tgba/tgbasafracomplement.cc, src/tgba/tgbasafracomplement.hh,
src/tgbaalgos/are_isomorphic.cc, src/tgbaalgos/cleanacc.cc,
src/tgbaalgos/dotty.cc, src/tgbaalgos/dupexp.cc,
src/tgbaalgos/dupexp.hh, src/tgbaalgos/hoa.cc,
src/tgbaalgos/neverclaim.cc, src/tgbaalgos/simulation.cc,
src/tgbaalgos/stutter.cc, src/tgbatest/checkpsl.cc,
src/tgbatest/emptchk.cc, src/tgbatest/ltl2tgba.cc, wrap/python/spot.py,
wrap/python/spot_impl.i: Rename the tgba class into twa.
parent 82480720
...@@ -488,7 +488,7 @@ namespace ...@@ -488,7 +488,7 @@ namespace
// never modify the original automaton (e.g. with // never modify the original automaton (e.g. with
// merge_transitions()) and the statistics about it make sense. // merge_transitions()) and the statistics about it make sense.
auto aut = ((automaton_format == Stats) || opt_name) auto aut = ((automaton_format == Stats) || opt_name)
? spot::make_tgba_digraph(haut->aut, spot::tgba::prop_set::all()) ? spot::make_tgba_digraph(haut->aut, spot::twa::prop_set::all())
: haut->aut; : haut->aut;
// Preprocessing. // Preprocessing.
...@@ -577,7 +577,7 @@ namespace ...@@ -577,7 +577,7 @@ namespace
{ {
auto tmp = auto tmp =
spot::canonicalize(make_tgba_digraph(aut, spot::canonicalize(make_tgba_digraph(aut,
spot::tgba::prop_set::all())); spot::twa::prop_set::all()));
if (!opt->uniq->emplace(tmp->transition_vector().begin() + 1, if (!opt->uniq->emplace(tmp->transition_vector().begin() + 1,
tmp->transition_vector().end()).second) tmp->transition_vector().end()).second)
return 0; return 0;
......
...@@ -307,7 +307,7 @@ main(int argc, char** argv) ...@@ -307,7 +307,7 @@ main(int argc, char** argv)
if (opt_uniq) if (opt_uniq)
{ {
auto tmp = spot::canonicalize auto tmp = spot::canonicalize
(make_tgba_digraph(aut, spot::tgba::prop_set::all())); (make_tgba_digraph(aut, spot::twa::prop_set::all()));
std::vector<tr_t> trans(tmp->transition_vector().begin() + 1, std::vector<tr_t> trans(tmp->transition_vector().begin() + 1,
tmp->transition_vector().end()); tmp->transition_vector().end());
if (!opt_uniq->emplace(trans).second) if (!opt_uniq->emplace(trans).second)
......
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2009, 2010, 2013, 2014 Laboratoire de Recherche et // Copyright (C) 2009, 2010, 2013, 2014, 2015 Laboratoire de Recherche et
// Developpement de l'Epita // Developpement de l'Epita
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
...@@ -85,11 +85,11 @@ namespace spot ...@@ -85,11 +85,11 @@ namespace spot
/// class and need not be defined. /// class and need not be defined.
/// ///
/// See also spot::fair_kripke_succ_iterator. /// See also spot::fair_kripke_succ_iterator.
class SPOT_API fair_kripke: public tgba class SPOT_API fair_kripke: public twa
{ {
public: public:
fair_kripke(const bdd_dict_ptr& d) fair_kripke(const bdd_dict_ptr& d)
: tgba(d) : twa(d)
{ {
} }
......
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et Développement // Copyright (C) 2012, 2013, 2014, 2015 Laboratoire de Recherche et
// de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
namespace spot namespace spot
{ {
tgta::tgta(const bdd_dict_ptr& d) tgta::tgta(const bdd_dict_ptr& d)
: tgba(d) : twa(d)
{}; {};
tgta::~tgta() tgta::~tgta()
{}; {};
......
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2010, 2011, 2012, 2013, 2014 Laboratoire de Recherche // Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire de
// et Développement de l'Epita (LRDE). // Recherche et Développement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
...@@ -56,7 +56,7 @@ namespace spot ...@@ -56,7 +56,7 @@ namespace spot
/// obtained by querying the iterator over the successors of /// obtained by querying the iterator over the successors of
/// a state. /// a state.
class SPOT_API tgta : public tgba class SPOT_API tgta : public twa
{ {
protected: protected:
......
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2014 Laboratoire de Recherche et Développement de // Copyright (C) 2014, 2015 Laboratoire de Recherche et Développement
// l'Epita (LRDE). // de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
namespace spot namespace spot
{ {
class tgba; class twa;
typedef std::shared_ptr<tgba> tgba_ptr; typedef std::shared_ptr<twa> tgba_ptr;
typedef std::shared_ptr<const tgba> const_tgba_ptr; typedef std::shared_ptr<const twa> const_tgba_ptr;
class tgba_digraph; class tgba_digraph;
typedef std::shared_ptr<const tgba_digraph> const_tgba_digraph_ptr; typedef std::shared_ptr<const tgba_digraph> const_tgba_digraph_ptr;
......
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Laboratoire de // Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire
// Recherche et Développement de l'Epita (LRDE) // de Recherche et Développement de l'Epita (LRDE)
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
...@@ -33,7 +33,7 @@ namespace spot ...@@ -33,7 +33,7 @@ namespace spot
`--------*/ `--------*/
taa_tgba::taa_tgba(const bdd_dict_ptr& dict) taa_tgba::taa_tgba(const bdd_dict_ptr& dict)
: tgba(dict), : twa(dict),
init_(0), state_set_vec_() init_(0), state_set_vec_()
{ {
} }
......
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2009, 2011, 2012, 2013, 2014, 2015 Laboratoire de Recherche et // Copyright (C) 2009, 2011, 2012, 2013, 2014, 2015 Laboratoire de
// Développement de l'Epita (LRDE). // Recherche et Développement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
...@@ -33,7 +33,7 @@ namespace spot ...@@ -33,7 +33,7 @@ namespace spot
{ {
/// \brief A self-loop Transition-based Alternating Automaton (TAA) /// \brief A self-loop Transition-based Alternating Automaton (TAA)
/// which is seen as a TGBA (abstract class, see below). /// which is seen as a TGBA (abstract class, see below).
class SPOT_API taa_tgba: public tgba class SPOT_API taa_tgba: public twa
{ {
public: public:
taa_tgba(const bdd_dict_ptr& dict); taa_tgba(const bdd_dict_ptr& dict);
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
namespace spot namespace spot
{ {
tgba::tgba(const bdd_dict_ptr& d) twa::twa(const bdd_dict_ptr& d)
: iter_cache_(nullptr), : iter_cache_(nullptr),
dict_(d), dict_(d),
last_support_conditions_input_(0) last_support_conditions_input_(0)
...@@ -36,7 +36,7 @@ namespace spot ...@@ -36,7 +36,7 @@ namespace spot
props = 0U; props = 0U;
} }
tgba::~tgba() twa::~twa()
{ {
if (last_support_conditions_input_) if (last_support_conditions_input_)
last_support_conditions_input_->destroy(); last_support_conditions_input_->destroy();
...@@ -45,7 +45,7 @@ namespace spot ...@@ -45,7 +45,7 @@ namespace spot
} }
bdd bdd
tgba::support_conditions(const state* state) const twa::support_conditions(const state* state) const
{ {
if (!last_support_conditions_input_ if (!last_support_conditions_input_
|| last_support_conditions_input_->compare(state) != 0) || last_support_conditions_input_->compare(state) != 0)
...@@ -59,7 +59,7 @@ namespace spot ...@@ -59,7 +59,7 @@ namespace spot
} }
state* state*
tgba::project_state(const state* s, twa::project_state(const state* s,
const const_tgba_ptr& t) const const const_tgba_ptr& t) const
{ {
if (t.get() == this) if (t.get() == this)
...@@ -68,13 +68,13 @@ namespace spot ...@@ -68,13 +68,13 @@ namespace spot
} }
std::string std::string
tgba::transition_annotation(const tgba_succ_iterator*) const twa::transition_annotation(const tgba_succ_iterator*) const
{ {
return ""; return "";
} }
bool bool
tgba::is_empty() const twa::is_empty() const
{ {
// FIXME: This should be improved based on properties of the // FIXME: This should be improved based on properties of the
// automaton. For instance we do not need couvreur99 is we know // automaton. For instance we do not need couvreur99 is we know
...@@ -91,8 +91,8 @@ namespace spot ...@@ -91,8 +91,8 @@ namespace spot
} }
void void
tgba::set_named_prop(std::string s, twa::set_named_prop(std::string s,
void* val, std::function<void(void*)> destructor) void* val, std::function<void(void*)> destructor)
{ {
auto p = named_prop_.emplace(std::piecewise_construct, auto p = named_prop_.emplace(std::piecewise_construct,
std::forward_as_tuple(s), std::forward_as_tuple(s),
...@@ -105,7 +105,7 @@ namespace spot ...@@ -105,7 +105,7 @@ namespace spot
} }
void* void*
tgba::get_named_prop_(std::string s) const twa::get_named_prop_(std::string s) const
{ {
auto i = named_prop_.find(s); auto i = named_prop_.find(s);
if (i == named_prop_.end()) if (i == named_prop_.end())
......
...@@ -431,46 +431,56 @@ namespace spot ...@@ -431,46 +431,56 @@ namespace spot
}; };
} }
/// \defgroup tgba TGBA (Transition-based Generalized Büchi Automata) /// \defgroup twa TωA (Transition-based ω-Automata)
/// ///
/// Spot is centered around the spot::tgba type. This type and its /// Spot is centered around the spot::twa type. This type and its
/// cousins are listed \ref tgba_essentials "here". This is an /// cousins are listed \ref tgba_essentials "here". This is an
/// abstract interface. Its implementations are either \ref /// abstract interface. Its implementations are either \ref
/// tgba_representation "concrete representations", or \ref /// tgba_representation "concrete representations", or \ref
/// tgba_on_the_fly_algorithms "on-the-fly algorithms". Other /// tgba_on_the_fly_algorithms "on-the-fly algorithms". Other
/// algorithms that work on spot::tgba are \ref tgba_algorithms /// algorithms that work on spot::twa are \ref tgba_algorithms
/// "listed separately". /// "listed separately".
/// \addtogroup tgba_essentials Essential TGBA types /// \addtogroup tgba_essentials Essential TωA types
/// \ingroup tgba /// \ingroup twa
/// \ingroup tgba_essentials /// \ingroup tgba_essentials
/// \brief A Transition-based Generalized Büchi Automaton. /// \brief A Transition-based ω-Automaton.
/// ///
/// The acronym TGBA (Transition-based Generalized Büchi Automaton) /// The acronym TωA stands for Transition-based ω-automaton.
/// was coined by Dimitra Giannakopoulou and Flavio Lerda /// We may write it as TwA or twa, but never as TWA as the
/// in "From States to Transitions: Improving Translation of LTL /// w is just a non-utf8 replacement for ω that should not be
/// Formulae to Büchi Automata". (FORTE'02) /// capitalized.
/// ///
/// TGBAs are transition-based, meanings their labels are put /// TωAs are transition-based automata, meanings that not-only
/// on arcs, not on nodes. They use Generalized Büchi acceptance /// do they have labels on arcs, they also have an acceptance
/// conditions: there are several acceptance sets (of /// condition defined in term of sets of transitions.
/// transitions), and a path can be accepted only if it traverses /// The acceptance condition can be anything supported by
/// at least one transition of each set infinitely often. /// the HOA format (http://adl.github.io/hoaf/). The only
/// restriction w.r.t. the format is that this class does
/// not support alternating automata
///
/// Previous version of Spot supported a type of automata called
/// TGBA, which are TωA in which the acceptance condition is a set
/// of sets of transitions that must be intersected infinitely
/// often.
///
/// In this version, TGBAs are now represented by TωAs for which
/// <code>aut->acc().is_generalized_buchi())</code> returns true.
/// ///
/// Browsing such automaton can be achieved using two functions: /// Browsing such automaton can be achieved using two functions:
/// \c get_init_state, and \c succ_iter. The former returns /// \c get_init_state, and \c succ. The former returns
/// the initial state while the latter lists the /// the initial state while the latter lists the
/// successor states of any state. /// successor states of any state.
/// ///
/// Note that although this is a transition-based automata, /// Note that although this is a transition-based automata, we never
/// we never represent transitions! Transition informations are /// represent transitions in the API! Transition data are
/// obtained by querying the iterator over the successors of /// obtained by querying the iterator over the successors of a
/// a state. /// state.
class SPOT_API tgba: public std::enable_shared_from_this<tgba> class SPOT_API twa: public std::enable_shared_from_this<twa>
{ {
protected: protected:
tgba(const bdd_dict_ptr& d); twa(const bdd_dict_ptr& d);
// Any iterator returned via release_iter. // Any iterator returned via release_iter.
mutable tgba_succ_iterator* iter_cache_; mutable tgba_succ_iterator* iter_cache_;
bdd_dict_ptr dict_; bdd_dict_ptr dict_;
...@@ -480,10 +490,10 @@ namespace spot ...@@ -480,10 +490,10 @@ namespace spot
class succ_iterable class succ_iterable
{ {
protected: protected:
const tgba* aut_; const twa* aut_;
tgba_succ_iterator* it_; tgba_succ_iterator* it_;
public: public:
succ_iterable(const tgba* aut, tgba_succ_iterator* it) succ_iterable(const twa* aut, tgba_succ_iterator* it)
: aut_(aut), it_(it) : aut_(aut), it_(it)
{ {
} }
...@@ -512,7 +522,7 @@ namespace spot ...@@ -512,7 +522,7 @@ namespace spot
}; };
#endif #endif
virtual ~tgba(); virtual ~twa();
/// \brief Get the initial state of the automaton. /// \brief Get the initial state of the automaton.
/// ///
...@@ -533,7 +543,7 @@ namespace spot ...@@ -533,7 +543,7 @@ namespace spot
/// \brief Build an iterable over the successors of \a s. /// \brief Build an iterable over the successors of \a s.
/// ///
/// This is meant to be used as /// This is meant to be used as
/// <code>for (auto i: aut->out(s)) { /* i->current_state() */ }</code>. /// <code>for (auto i: aut->succ(s)) { /* i->current_state() */ }</code>.
succ_iterable succ_iterable
succ(const state* s) const succ(const state* s) const
{ {
...@@ -836,10 +846,10 @@ namespace spot ...@@ -836,10 +846,10 @@ namespace spot
}; };
/// \addtogroup tgba_representation TGBA representations /// \addtogroup tgba_representation TGBA representations
/// \ingroup tgba /// \ingroup twa
/// \addtogroup tgba_algorithms TGBA algorithms /// \addtogroup tgba_algorithms TGBA algorithms
/// \ingroup tgba /// \ingroup twa
/// \addtogroup tgba_on_the_fly_algorithms TGBA on-the-fly algorithms /// \addtogroup tgba_on_the_fly_algorithms TGBA on-the-fly algorithms
/// \ingroup tgba_algorithms /// \ingroup tgba_algorithms
......
...@@ -169,7 +169,7 @@ namespace spot ...@@ -169,7 +169,7 @@ namespace spot
}; };
class SPOT_API tgba_digraph final: public tgba class SPOT_API tgba_digraph final: public twa
{ {
public: public:
typedef digraph<tgba_graph_state, tgba_graph_trans_data> graph_t; typedef digraph<tgba_graph_state, tgba_graph_trans_data> graph_t;
...@@ -181,13 +181,13 @@ namespace spot ...@@ -181,13 +181,13 @@ namespace spot
public: public:
tgba_digraph(const bdd_dict_ptr& dict) tgba_digraph(const bdd_dict_ptr& dict)
: tgba(dict), : twa(dict),
init_number_(0) init_number_(0)
{ {
} }
explicit tgba_digraph(const const_tgba_digraph_ptr& other, prop_set p) explicit tgba_digraph(const const_tgba_digraph_ptr& other, prop_set p)
: tgba(other->get_dict()), : twa(other->get_dict()),
g_(other->g_), init_number_(other->init_number_) g_(other->g_), init_number_(other->init_number_)
{ {
copy_acceptance_of(other); copy_acceptance_of(other);
...@@ -198,7 +198,7 @@ namespace spot ...@@ -198,7 +198,7 @@ namespace spot
virtual ~tgba_digraph() virtual ~tgba_digraph()
{ {
get_dict()->unregister_all_my_variables(this); get_dict()->unregister_all_my_variables(this);
// Prevent this state from being destroyed by ~tgba(), // Prevent this state from being destroyed by ~twa(),
// as the state will be destroyed when g_ is destroyed. // as the state will be destroyed when g_ is destroyed.
last_support_conditions_input_ = 0; last_support_conditions_input_ = 0;
} }
...@@ -459,19 +459,19 @@ namespace spot ...@@ -459,19 +459,19 @@ namespace spot
} }
inline tgba_digraph_ptr make_tgba_digraph(const tgba_digraph_ptr& aut, inline tgba_digraph_ptr make_tgba_digraph(const tgba_digraph_ptr& aut,
tgba::prop_set p) twa::prop_set p)
{ {
return std::make_shared<tgba_digraph>(aut, p); return std::make_shared<tgba_digraph>(aut, p);
} }
inline tgba_digraph_ptr make_tgba_digraph(const const_tgba_digraph_ptr& aut, inline tgba_digraph_ptr make_tgba_digraph(const const_tgba_digraph_ptr& aut,
tgba::prop_set p) twa::prop_set p)
{ {
return std::make_shared<tgba_digraph>(aut, p); return std::make_shared<tgba_digraph>(aut, p);
} }
inline tgba_digraph_ptr make_tgba_digraph(const const_tgba_ptr& aut, inline tgba_digraph_ptr make_tgba_digraph(const const_tgba_ptr& aut,
tgba::prop_set p) twa::prop_set p)
{ {
auto a = std::dynamic_pointer_cast<const tgba_digraph>(aut); auto a = std::dynamic_pointer_cast<const tgba_digraph>(aut);
if (a) if (a)
......
...@@ -284,7 +284,7 @@ namespace spot ...@@ -284,7 +284,7 @@ namespace spot
tgba_product::tgba_product(const const_tgba_ptr& left, tgba_product::tgba_product(const const_tgba_ptr& left,
const const_tgba_ptr& right) const const_tgba_ptr& right)
: tgba(left->get_dict()), left_(left), right_(right), : twa(left->get_dict()), left_(left), right_(right),
pool_(sizeof(state_product)) pool_(sizeof(state_product))
{ {
assert(get_dict() == right_->get_dict()); assert(get_dict() == right_->get_dict());
......
...@@ -77,7 +77,7 @@ namespace spot ...@@ -77,7 +77,7 @@ namespace spot
/// \brief A lazy product. (States are computed on the fly.) /// \brief A lazy product. (States are computed on the fly.)
class SPOT_API tgba_product: public tgba class SPOT_API tgba_product: public twa
{ {
public: public:
/// \brief Constructor. /// \brief Constructor.
......
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2013, 2014 Laboratoire de Recherche et // Copyright (C) 2013, 2014, 2015 Laboratoire de Recherche et
// Développement de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
namespace spot namespace spot
{ {
tgba_proxy::tgba_proxy(const const_tgba_ptr& original) tgba_proxy::tgba_proxy(const const_tgba_ptr& original)
: tgba(original->get_dict()), original_(original) : twa(original->get_dict()), original_(original)
{ {
get_dict()->register_all_variables_of(original, this); get_dict()->register_all_variables_of(original, this);
acc_.add_sets(original->acc().num_sets()); acc_.add_sets(original->acc().num_sets());
......
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2013, 2014 Laboratoire de Recherche et Développement // Copyright (C) 2013, 2014, 2015 Laboratoire de Recherche et
// de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
...@@ -32,7 +32,7 @@ namespace spot ...@@ -32,7 +32,7 @@ namespace spot
/// original automaton right away. However it is useful /// original automaton right away. However it is useful
/// to inherit from this class and override some of its /// to inherit from this class and override some of its
/// methods to implement some on-the-fly algorithm. /// methods to implement some on-the-fly algorithm.
class SPOT_API tgba_proxy: public tgba