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
// never modify the original automaton (e.g. with
// merge_transitions()) and the statistics about it make sense.
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;
// Preprocessing.
......@@ -577,7 +577,7 @@ namespace
{
auto tmp =
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,
tmp->transition_vector().end()).second)
return 0;
......
......@@ -307,7 +307,7 @@ main(int argc, char** argv)
if (opt_uniq)
{
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,
tmp->transition_vector().end());
if (!opt_uniq->emplace(trans).second)
......
// -*- 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
//
// This file is part of Spot, a model checking library.
......@@ -85,11 +85,11 @@ namespace spot
/// class and need not be defined.
///
/// See also spot::fair_kripke_succ_iterator.
class SPOT_API fair_kripke: public tgba
class SPOT_API fair_kripke: public twa
{
public:
fair_kripke(const bdd_dict_ptr& d)
: tgba(d)
: twa(d)
{
}
......
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2012, 2013, 2014, 2015 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
......@@ -23,7 +23,7 @@
namespace spot
{
tgta::tgta(const bdd_dict_ptr& d)
: tgba(d)
: twa(d)
{};
tgta::~tgta()
{};
......
// -*- coding: utf-8 -*-
// Copyright (C) 2010, 2011, 2012, 2013, 2014 Laboratoire de Recherche
// et Développement de l'Epita (LRDE).
// Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire de
// Recherche et Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
......@@ -56,7 +56,7 @@ namespace spot
/// obtained by querying the iterator over the successors of
/// a state.
class SPOT_API tgta : public tgba
class SPOT_API tgta : public twa
{
protected:
......
// -*- coding: utf-8 -*-
// Copyright (C) 2014 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
// Copyright (C) 2014, 2015 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
......@@ -23,9 +23,9 @@
namespace spot
{
class tgba;
typedef std::shared_ptr<tgba> tgba_ptr;
typedef std::shared_ptr<const tgba> const_tgba_ptr;
class twa;
typedef std::shared_ptr<twa> tgba_ptr;
typedef std::shared_ptr<const twa> const_tgba_ptr;
class tgba_digraph;
typedef std::shared_ptr<const tgba_digraph> const_tgba_digraph_ptr;
......
// -*- coding: utf-8 -*-
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Laboratoire de
// Recherche et Développement de l'Epita (LRDE)
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire
// de Recherche et Développement de l'Epita (LRDE)
//
// This file is part of Spot, a model checking library.
//
......@@ -33,7 +33,7 @@ namespace spot
`--------*/
taa_tgba::taa_tgba(const bdd_dict_ptr& dict)
: tgba(dict),
: twa(dict),
init_(0), state_set_vec_()
{
}
......
// -*- coding: utf-8 -*-
// Copyright (C) 2009, 2011, 2012, 2013, 2014, 2015 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) 2009, 2011, 2012, 2013, 2014, 2015 Laboratoire de
// Recherche et Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
......@@ -33,7 +33,7 @@ namespace spot
{
/// \brief A self-loop Transition-based Alternating Automaton (TAA)
/// 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:
taa_tgba(const bdd_dict_ptr& dict);
......
......@@ -28,7 +28,7 @@
namespace spot
{
tgba::tgba(const bdd_dict_ptr& d)
twa::twa(const bdd_dict_ptr& d)
: iter_cache_(nullptr),
dict_(d),
last_support_conditions_input_(0)
......@@ -36,7 +36,7 @@ namespace spot
props = 0U;
}
tgba::~tgba()
twa::~twa()
{
if (last_support_conditions_input_)
last_support_conditions_input_->destroy();
......@@ -45,7 +45,7 @@ namespace spot
}
bdd
tgba::support_conditions(const state* state) const
twa::support_conditions(const state* state) const
{
if (!last_support_conditions_input_
|| last_support_conditions_input_->compare(state) != 0)
......@@ -59,7 +59,7 @@ namespace spot
}
state*
tgba::project_state(const state* s,
twa::project_state(const state* s,
const const_tgba_ptr& t) const
{
if (t.get() == this)
......@@ -68,13 +68,13 @@ namespace spot
}
std::string
tgba::transition_annotation(const tgba_succ_iterator*) const
twa::transition_annotation(const tgba_succ_iterator*) const
{
return "";
}
bool
tgba::is_empty() const
twa::is_empty() const
{
// FIXME: This should be improved based on properties of the
// automaton. For instance we do not need couvreur99 is we know
......@@ -91,8 +91,8 @@ namespace spot
}
void
tgba::set_named_prop(std::string s,
void* val, std::function<void(void*)> destructor)
twa::set_named_prop(std::string s,
void* val, std::function<void(void*)> destructor)
{
auto p = named_prop_.emplace(std::piecewise_construct,
std::forward_as_tuple(s),
......@@ -105,7 +105,7 @@ namespace spot
}
void*
tgba::get_named_prop_(std::string s) const
twa::get_named_prop_(std::string s) const
{
auto i = named_prop_.find(s);
if (i == named_prop_.end())
......
......@@ -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
/// abstract interface. Its implementations are either \ref
/// tgba_representation "concrete representations", or \ref
/// 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".
/// \addtogroup tgba_essentials Essential TGBA types
/// \ingroup tgba
/// \addtogroup tgba_essentials Essential TωA types
/// \ingroup twa
/// \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)
/// was coined by Dimitra Giannakopoulou and Flavio Lerda
/// in "From States to Transitions: Improving Translation of LTL
/// Formulae to Büchi Automata". (FORTE'02)
/// The acronym TωA stands for Transition-based ω-automaton.
/// We may write it as TwA or twa, but never as TWA as the
/// w is just a non-utf8 replacement for ω that should not be
/// capitalized.
///
/// TGBAs are transition-based, meanings their labels are put
/// on arcs, not on nodes. They use Generalized Büchi acceptance
/// conditions: there are several acceptance sets (of
/// transitions), and a path can be accepted only if it traverses
/// at least one transition of each set infinitely often.
/// TωAs are transition-based automata, meanings that not-only
/// do they have labels on arcs, they also have an acceptance
/// condition defined in term of sets of transitions.
/// The acceptance condition can be anything supported by
/// 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:
/// \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
/// successor states of any state.
///
/// Note that although this is a transition-based automata,
/// we never represent transitions! Transition informations are
/// obtained by querying the iterator over the successors of
/// a state.
class SPOT_API tgba: public std::enable_shared_from_this<tgba>
/// Note that although this is a transition-based automata, we never
/// represent transitions in the API! Transition data are
/// obtained by querying the iterator over the successors of a
/// state.
class SPOT_API twa: public std::enable_shared_from_this<twa>
{
protected:
tgba(const bdd_dict_ptr& d);
twa(const bdd_dict_ptr& d);
// Any iterator returned via release_iter.
mutable tgba_succ_iterator* iter_cache_;
bdd_dict_ptr dict_;
......@@ -480,10 +490,10 @@ namespace spot
class succ_iterable
{
protected:
const tgba* aut_;
const twa* aut_;
tgba_succ_iterator* it_;
public:
succ_iterable(const tgba* aut, tgba_succ_iterator* it)
succ_iterable(const twa* aut, tgba_succ_iterator* it)
: aut_(aut), it_(it)
{
}
......@@ -512,7 +522,7 @@ namespace spot
};
#endif
virtual ~tgba();
virtual ~twa();
/// \brief Get the initial state of the automaton.
///
......@@ -533,7 +543,7 @@ namespace spot
/// \brief Build an iterable over the successors of \a s.
///
/// 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(const state* s) const
{
......@@ -836,10 +846,10 @@ namespace spot
};
/// \addtogroup tgba_representation TGBA representations
/// \ingroup tgba
/// \ingroup twa
/// \addtogroup tgba_algorithms TGBA algorithms
/// \ingroup tgba
/// \ingroup twa
/// \addtogroup tgba_on_the_fly_algorithms TGBA on-the-fly algorithms
/// \ingroup tgba_algorithms
......
......@@ -169,7 +169,7 @@ namespace spot
};
class SPOT_API tgba_digraph final: public tgba
class SPOT_API tgba_digraph final: public twa
{
public:
typedef digraph<tgba_graph_state, tgba_graph_trans_data> graph_t;
......@@ -181,13 +181,13 @@ namespace spot
public:
tgba_digraph(const bdd_dict_ptr& dict)
: tgba(dict),
: twa(dict),
init_number_(0)
{
}
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_)
{
copy_acceptance_of(other);
......@@ -198,7 +198,7 @@ namespace spot
virtual ~tgba_digraph()
{
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.
last_support_conditions_input_ = 0;
}
......@@ -459,19 +459,19 @@ namespace spot
}
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);
}
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);
}
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);
if (a)
......
......@@ -284,7 +284,7 @@ namespace spot
tgba_product::tgba_product(const const_tgba_ptr& left,
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))
{
assert(get_dict() == right_->get_dict());
......
......@@ -77,7 +77,7 @@ namespace spot
/// \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:
/// \brief Constructor.
......
// -*- 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).
//
// This file is part of Spot, a model checking library.
......@@ -22,7 +22,7 @@
namespace spot
{
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);
acc_.add_sets(original->acc().num_sets());
......
// -*- coding: utf-8 -*-
// Copyright (C) 2013, 2014 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2013, 2014, 2015 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
......@@ -32,7 +32,7 @@ namespace spot
/// original automaton right away. However it is useful
/// to inherit from this class and override some of its
/// methods to implement some on-the-fly algorithm.
class SPOT_API tgba_proxy: public tgba
class SPOT_API tgba_proxy: public twa
{
protected:
tgba_proxy(const const_tgba_ptr& original);
......
......@@ -1074,7 +1074,7 @@ namespace spot
//////////////////////////
tgba_safra_complement::tgba_safra_complement(const const_tgba_digraph_ptr& a)
: tgba(a->get_dict()), automaton_(a),
: twa(a->get_dict()), automaton_(a),
safra_(safra_determinisation::create_safra_automaton(a))
{
assert(safra_ || !"safra construction fails");
......
// -*- coding: utf-8 -*-
// Copyright (C) 2009, 2010, 2011, 2013, 2014 Laboratoire de Recherche
// et Développement de l'Epita (LRDE).
// Copyright (C) 2009, 2010, 2011, 2013, 2014, 2015 Laboratoire de
// Recherche et Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
......@@ -46,7 +46,7 @@ namespace spot
/// is done on-the-fly when successors are called.
///
/// \sa safra_determinisation, tgba_safra_complement::succ_iter.
class SPOT_API tgba_safra_complement : public tgba
class SPOT_API tgba_safra_complement : public twa
{
public:
tgba_safra_complement(const const_tgba_digraph_ptr& a);
......
......@@ -112,7 +112,7 @@ namespace spot
{
isomorphism_checker::isomorphism_checker(const const_tgba_digraph_ptr ref)
{
ref_ = make_tgba_digraph(ref, tgba::prop_set::all());
ref_ = make_tgba_digraph(ref, twa::prop_set::all());
ref_deterministic_ = ref_->is_deterministic();
if (!ref_deterministic_)
{
......@@ -144,7 +144,7 @@ namespace spot
}
}
auto tmp = make_tgba_digraph(aut, tgba::prop_set::all());
auto tmp = make_tgba_digraph(aut, twa::prop_set::all());
spot::canonicalize(tmp);
return *tmp == *ref_;
}
......
......@@ -56,7 +56,7 @@ namespace spot
tgba_digraph_ptr cleanup_acceptance(const_tgba_digraph_ptr aut)
{
return cleanup_acceptance_here(make_tgba_digraph(aut,
tgba::prop_set::all()));
twa::prop_set::all()));
}
......
......@@ -494,7 +494,7 @@ namespace spot
dotty_output d(os, options);
auto aut = std::dynamic_pointer_cast<const tgba_digraph>(g);
if (!aut)
aut = make_tgba_digraph(g, tgba::prop_set::all());
aut = make_tgba_digraph(g, twa::prop_set::all());
d.print(aut);
return os;
}
......
......@@ -36,7 +36,7 @@ namespace spot
class dupexp_iter: public T
{
public:
dupexp_iter(const const_tgba_ptr& a, tgba::prop_set p)
dupexp_iter(const const_tgba_ptr& a, twa::prop_set p)
: T(a), out_(make_tgba_digraph(a->get_dict()))
{
out_->copy_acceptance_of(a);
......@@ -76,7 +76,7 @@ namespace spot
} // anonymous
tgba_digraph_ptr
tgba_dupexp_bfs(const const_tgba_ptr& aut, tgba::prop_set p)
tgba_dupexp_bfs(const const_tgba_ptr& aut, twa::prop_set p)
{
dupexp_iter<tgba_reachable_iterator_breadth_first> di(aut, p);
di.run();
......@@ -84,7 +84,7 @@ namespace spot
}
tgba_digraph_ptr
tgba_dupexp_dfs(const const_tgba_ptr& aut, tgba::prop_set p)
tgba_dupexp_dfs(const const_tgba_ptr& aut, twa::prop_set p)
{
dupexp_iter<tgba_reachable_iterator_depth_first> di(aut, p);
di.run();
......
......@@ -33,10 +33,10 @@ namespace spot
/// \brief Build an explicit automaton from all states of \a aut,
/// numbering states in bread first order as they are processed.
SPOT_API tgba_digraph_ptr
tgba_dupexp_bfs(const const_tgba_ptr& aut, tgba::prop_set p);
tgba_dupexp_bfs(const const_tgba_ptr& aut, twa::prop_set p);
/// \ingroup tgba_misc
/// \brief Build an explicit automaton from all states of \a aut,
/// numbering states in depth first order as they are processed.
SPOT_API tgba_digraph_ptr
tgba_dupexp_dfs(const const_tgba_ptr& aut, tgba::prop_set p);
tgba_dupexp_dfs(const const_tgba_ptr& aut, twa::prop_set p);
}
......@@ -438,7 +438,7 @@ namespace spot
auto a = std::dynamic_pointer_cast<const tgba_digraph>(aut);
if (!a)
a = make_tgba_digraph(aut, tgba::prop_set::all());
a = make_tgba_digraph(aut, twa::prop_set::all());
return hoa_reachable(os, a, opt);
}
......
......@@ -210,7 +210,7 @@ namespace spot
never_claim_output d(os, options);
auto aut = std::dynamic_pointer_cast<const tgba_digraph>(g);
if (!aut)
aut = make_tgba_digraph(g, tgba::prop_set::all());
aut = make_tgba_digraph(g, twa::prop_set::all());
d.print(aut);
return os;
}
......
......@@ -242,7 +242,7 @@ namespace spot
}
else
{
a_ = make_tgba_digraph(in, tgba::prop_set::all());
a_ = make_tgba_digraph(in, twa::prop_set::all());
auto& acccond = a_->acc();
for (auto& t: a_->transitions())
t.acc = acccond.comp(t.acc);
......
......@@ -203,11 +203,11 @@ namespace spot
};
class tgbasl final : public tgba
class tgbasl final : public twa
{
public:
tgbasl(const const_tgba_ptr& a, bdd atomic_propositions)
: tgba(a->get_dict()), a_(a), aps_(atomic_propositions)
: twa(a->get_dict()), a_(a), aps_(atomic_propositions)
{
get_dict()->register_all_propositions_of(&a_, this);
assert(acc_.num_sets() == 0);
......@@ -442,7 +442,7 @@ namespace spot
tgba_digraph_ptr
sl2(const const_tgba_digraph_ptr& a, bdd atomic_propositions)
{
return sl2(make_tgba_digraph(a, tgba::prop_set::all()),
return sl2(make_tgba_digraph(a, twa::prop_set::all()),
atomic_propositions);
}
......
......@@ -94,10 +94,10 @@ main(int argc, char** argv)
{
auto apos =
scc_filter(make_tgba_digraph(ltl_to_taa(fpos, d),
spot::tgba::prop_set::all()));
spot::twa::prop_set::all()));
auto aneg =
scc_filter(make_tgba_digraph(ltl_to_taa(fneg, d),
spot::tgba::prop_set::all()));
spot::twa::prop_set::all()));
if (!spot::product(apos, aneg)->is_empty())
{
std::cerr << "non-empty intersection between pos and neg (TAA)\n";
......
......@@ -102,7 +102,7 @@ main(int argc, char** argv)
{
auto a = spot::ltl_to_taa(f, d);
aut[0] = a;