is_alternating() -> !is_existential()

Part of #212.

* spot/misc/common.hh (SPOT_DEPRECATED): Improve support current
compilers and options flags.
* spot/twa/twagraph.hh, spot/graph/graph.hh (is_alternating): Mark it
as deprecated.
(is_existential): New method.
* bin/autfilt.cc, bin/ltlcross.cc, spot/parseaut/parseaut.yy,
spot/twa/twa.cc, spot/twa/twagraph.cc, spot/twaalgos/alternation.cc,
spot/twaalgos/are_isomorphic.cc, spot/twaalgos/canonicalize.cc,
spot/twaalgos/couvreurnew.cc, spot/twaalgos/cycles.cc,
spot/twaalgos/degen.cc, spot/twaalgos/determinize.cc,
spot/twaalgos/dot.cc, spot/twaalgos/dtbasat.cc,
spot/twaalgos/dtwasat.cc, spot/twaalgos/hoa.cc,
spot/twaalgos/isunamb.cc, spot/twaalgos/isweakscc.cc,
spot/twaalgos/mask.hh, spot/twaalgos/minimize.cc,
spot/twaalgos/postproc.cc, spot/twaalgos/product.cc,
spot/twaalgos/randomize.cc, spot/twaalgos/remfin.cc,
spot/twaalgos/sbacc.cc, spot/twaalgos/sccfilter.cc,
spot/twaalgos/sccinfo.cc, spot/twaalgos/simulation.cc,
spot/twaalgos/strength.cc, tests/core/graph.cc, tests/core/ngraph.cc,
tests/python/alternating.py: Adjust all uses.
* NEWS: Mention the renaming.
This commit is contained in:
Alexandre Duret-Lutz 2017-02-12 13:36:35 +01:00
parent 7f7d078f2f
commit fefb375d5f
36 changed files with 127 additions and 93 deletions

4
NEWS
View file

@ -13,6 +13,10 @@ New in spot 2.3.0.dev (not yet released)
- spot::twa_run::as_twa() has an option to preserve state names. - spot::twa_run::as_twa() has an option to preserve state names.
- the method spot::twa::is_alternating(), introduced in Spot 2.3 was
badly named and has been deprecated. Use the negation of the new
spot::twa::is_existential() instead.
Bugs fixed: Bugs fixed:
- spot::otf_product() was incorrectly registering atomic - spot::otf_product() was incorrectly registering atomic

View file

@ -485,7 +485,7 @@ static bool opt_highlight_languages = false;
static spot::twa_graph_ptr static spot::twa_graph_ptr
ensure_deterministic(const spot::twa_graph_ptr& aut, bool nonalt = false) ensure_deterministic(const spot::twa_graph_ptr& aut, bool nonalt = false)
{ {
if (!(nonalt && aut->is_alternating()) && spot::is_deterministic(aut)) if ((!nonalt || aut->is_existential()) && spot::is_deterministic(aut))
return aut; return aut;
spot::postprocessor p; spot::postprocessor p;
p.set_type(spot::postprocessor::Generic); p.set_type(spot::postprocessor::Generic);
@ -1044,7 +1044,7 @@ namespace
matched &= opt_used_ap_n.contains(aut->ap().size() - unused); matched &= opt_used_ap_n.contains(aut->ap().size() - unused);
} }
if (matched && opt_is_alternating) if (matched && opt_is_alternating)
matched &= aut->is_alternating(); matched &= !aut->is_existential();
if (matched && opt_is_complete) if (matched && opt_is_complete)
matched &= is_complete(aut); matched &= is_complete(aut);
if (matched && (opt_sccs_set | opt_art_sccs_set)) if (matched && (opt_sccs_set | opt_art_sccs_set))

View file

@ -648,7 +648,7 @@ namespace
if (verbose) if (verbose)
std::cerr << "info: getting statistics\n"; std::cerr << "info: getting statistics\n";
st->ok = true; st->ok = true;
st->alternating = res->is_alternating(); st->alternating = !res->is_existential();
spot::twa_sub_statistics s = sub_stats_reachable(res); spot::twa_sub_statistics s = sub_stats_reachable(res);
st->states = s.states; st->states = s.states;
st->edges = s.edges; st->edges = s.edges;
@ -1118,7 +1118,7 @@ namespace
std::cerr << "info: " << prefix << i << "\t("; std::cerr << "info: " << prefix << i << "\t(";
printsize(x[i]); printsize(x[i]);
std::cerr << ')'; std::cerr << ')';
if (x[i]->is_alternating()) if (!x[i]->is_existential())
std::cerr << " univ-edges"; std::cerr << " univ-edges";
if (is_deterministic(x[i])) if (is_deterministic(x[i]))
std::cerr << " deterministic"; std::cerr << " deterministic";
@ -1142,7 +1142,7 @@ namespace
auto unalt = [&](std::vector<spot::twa_graph_ptr>& x, auto unalt = [&](std::vector<spot::twa_graph_ptr>& x,
unsigned i, char prefix) unsigned i, char prefix)
{ {
if (!(x[i] && x[i]->is_alternating())) if (!x[i] || x[i]->is_existential())
return; return;
if (verbose) if (verbose)
{ {

View file

@ -656,11 +656,23 @@ namespace spot
return edges_.size() - killed_edge_ - 1; return edges_.size() - killed_edge_ - 1;
} }
/// Whether the automaton is alternating /// Whether the automaton uses only existential branching.
bool is_existential() const
{
return dests_.empty();
}
#ifndef SWIG
/// \brief Whether the automaton has universal branching
///
/// The name of this function is confusing since non-deterministic
/// automata should be a subclass of alternating automata.
SPOT_DEPRECATED("use !is_existential() instead")
bool is_alternating() const bool is_alternating() const
{ {
return !dests_.empty(); return !is_existential();
} }
#endif
/// \brief Create a new states /// \brief Create a new states
/// ///

View file

@ -32,17 +32,21 @@
#endif #endif
#ifdef __has_cpp_attribute #ifdef __has_cpp_attribute
# if __has_cpp_attribute(deprecated) # if __has_cpp_attribute(deprecated) && __cplusplus >= 201402L
# define SPOT_DEPRECATED [[deprecated]] # define SPOT_DEPRECATED(msg) [[deprecated(msg)]]
# elif __has_cpp_attribute(gnu::deprecated)
# define SPOT_DEPRECATED(msg) [[gnu::deprecated(msg)]]
# elif __has_cpp_attribute(clang::deprecated)
# define SPOT_DEPRECATED(msg) [[clang::deprecated(msg)]]
# endif # endif
#endif #endif
#ifndef SPOT_DEPRECATED #ifndef SPOT_DEPRECATED
# ifdef __GNUC__ # ifdef __GNUC__
# define SPOT_DEPRECATED __attribute__ ((deprecated)) # define SPOT_DEPRECATED(msg) __attribute__ ((deprecated))
# elif defined(_MSC_VER) # elif defined(_MSC_VER)
# define SPOT_DEPRECATED __declspec(deprecated) # define SPOT_DEPRECATED(msg) __declspec(deprecated)
# else # else
# define SPOT_DEPRECATED # define SPOT_DEPRECATED(msg)
# endif # endif
#endif #endif

View file

@ -2436,7 +2436,7 @@ namespace spot
fix_acceptance(r); fix_acceptance(r);
fix_initial_state(r); fix_initial_state(r);
fix_properties(r); fix_properties(r);
if (r.h->aut && r.h->aut->is_alternating()) if (r.h->aut && !r.h->aut->is_existential())
r.h->aut->merge_univ_dests(); r.h->aut->merge_univ_dests();
return r.h; return r.h;
}; };

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2011, 2014-2016 Laboratoire de Recherche et Developpement de // Copyright (C) 2011, 2014-2017 Laboratoire de Recherche et Developpement de
// l'EPITA (LRDE). // l'EPITA (LRDE).
// Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
@ -53,7 +53,7 @@ namespace spot
const_twa_ptr remove_fin_maybe(const const_twa_ptr& a) const_twa_ptr remove_fin_maybe(const const_twa_ptr& a)
{ {
auto aa = std::dynamic_pointer_cast<const twa_graph>(a); auto aa = std::dynamic_pointer_cast<const twa_graph>(a);
if ((!aa || !aa->is_alternating()) && !a->acc().uses_fin_acceptance()) if ((!aa || aa->is_existential()) && !a->acc().uses_fin_acceptance())
return a; return a;
if (!aa) if (!aa)
aa = make_twa_graph(a, twa::prop_set::all()); aa = make_twa_graph(a, twa::prop_set::all());

View file

@ -86,7 +86,7 @@ namespace spot
{ {
set_named_prop("highlight-edges", nullptr); set_named_prop("highlight-edges", nullptr);
g_.remove_dead_edges_(); g_.remove_dead_edges_();
if (is_alternating()) if (!is_existential())
merge_univ_dests(); merge_univ_dests();
typedef graph_t::edge_storage_t tr_t; typedef graph_t::edge_storage_t tr_t;
@ -245,7 +245,7 @@ namespace spot
std::vector<unsigned> order; std::vector<unsigned> order;
order.reserve(num_states); order.reserve(num_states);
if (!is_alternating()) if (is_existential())
{ {
std::vector<std::pair<unsigned, unsigned>> todo; // state, edge std::vector<std::pair<unsigned, unsigned>> todo; // state, edge
useful[get_init_state_number()] = 1; useful[get_init_state_number()] = 1;
@ -399,7 +399,7 @@ namespace spot
void twa_graph::defrag_states(std::vector<unsigned>&& newst, void twa_graph::defrag_states(std::vector<unsigned>&& newst,
unsigned used_states) unsigned used_states)
{ {
if (is_alternating()) if (!is_existential())
{ {
auto& g = get_graph(); auto& g = get_graph();
auto& dests = g.dests_vector(); auto& dests = g.dests_vector();

View file

@ -294,7 +294,7 @@ namespace spot
virtual const twa_graph_state* get_init_state() const override virtual const twa_graph_state* get_init_state() const override
{ {
unsigned n = get_init_state_number(); unsigned n = get_init_state_number();
if (SPOT_UNLIKELY(is_alternating())) if (SPOT_UNLIKELY(!is_existential()))
throw std::runtime_error throw std::runtime_error
("the abstract interface does not support alternating automata"); ("the abstract interface does not support alternating automata");
return state_from_number(n); return state_from_number(n);
@ -479,10 +479,23 @@ namespace spot
return g_.univ_dests(e); return g_.univ_dests(e);
} }
/// Whether the automaton uses only existential branching.
bool is_existential() const
{
return g_.is_existential();
}
#ifndef SWIG
/// \brief Whether the automaton has universal branching
///
/// The name of this function is confusing since non-deterministic
/// automata should be a subclass of alternating automata.
SPOT_DEPRECATED("use !is_existential() instead")
bool is_alternating() const bool is_alternating() const
{ {
return g_.is_alternating(); return !is_existential();
} }
#endif
#ifndef SWIG #ifndef SWIG
auto states() const auto states() const

View file

@ -479,7 +479,7 @@ namespace spot
twa_graph_ptr remove_alternation(const const_twa_graph_ptr& aut, twa_graph_ptr remove_alternation(const const_twa_graph_ptr& aut,
bool named_states) bool named_states)
{ {
if (!aut->is_alternating()) if (aut->is_existential())
// Nothing to do, why was this function called at all? // Nothing to do, why was this function called at all?
return std::const_pointer_cast<twa_graph>(aut); return std::const_pointer_cast<twa_graph>(aut);

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2014, 2015, 2016 Laboratoire de Recherche et // Copyright (C) 2014-2017 Laboratoire de Recherche et Développement
// Développement de l'Epita (LRDE). // de l'Epita (LRDE).
// Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
@ -132,7 +132,7 @@ namespace spot
bool bool
isomorphism_checker::is_isomorphic_(const const_twa_graph_ptr aut) isomorphism_checker::is_isomorphic_(const const_twa_graph_ptr aut)
{ {
if (aut->is_alternating()) if (!aut->is_existential())
throw std::runtime_error throw std::runtime_error
("isomorphism_checker does not yet support alternation"); ("isomorphism_checker does not yet support alternation");
trival autdet = aut->prop_deterministic(); trival autdet = aut->prop_deterministic();

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2014, 2015, 2016 Laboratoire de Recherche et // Copyright (C) 2014-2017 Laboratoire de Recherche et Développement
// Developpement de 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.
// //
@ -73,7 +73,7 @@ namespace spot
twa_graph_ptr twa_graph_ptr
canonicalize(twa_graph_ptr aut) canonicalize(twa_graph_ptr aut)
{ {
if (aut->is_alternating()) if (!aut->is_existential())
throw std::runtime_error throw std::runtime_error
("canonicalize does not yet support alternation"); ("canonicalize does not yet support alternation");
std::vector<unsigned> state2class(aut->num_states(), 0); std::vector<unsigned> state2class(aut->num_states(), 0);

View file

@ -1,5 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2016 Laboratoire de Recherche et Développement de l'Epita. // Copyright (C) 2016-2017 Laboratoire 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.
// //
@ -219,7 +220,7 @@ namespace spot
state_t state_t
initial_state(const const_twa_graph_ptr& twa_p) initial_state(const const_twa_graph_ptr& twa_p)
{ {
if (twa_p->is_alternating()) if (!twa_p->is_existential())
throw std::runtime_error throw std::runtime_error
("couvreur99_new does not support alternation"); ("couvreur99_new does not support alternation");
return twa_p->get_init_state_number(); return twa_p->get_init_state_number();

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2012, 2014, 2015, 2016 Laboratoire de Recherche et // Copyright (C) 2012, 2014-2017 Laboratoire de Recherche et
// Developpement 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.
// //
@ -27,7 +27,7 @@ namespace spot
info_(aut_->num_states(), aut_->num_states()), info_(aut_->num_states(), aut_->num_states()),
sm_(map) sm_(map)
{ {
if (aut_->is_alternating()) if (!aut_->is_existential())
throw std::runtime_error throw std::runtime_error
("enumerate_cycles does not support alternation"); ("enumerate_cycles does not support alternation");
} }

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013, 2014, 2015, 2016 Laboratoire de Recherche // Copyright (C) 2012-2017 Laboratoire de Recherche
// et Développement de l'Epita. // 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.
// //
@ -197,7 +197,7 @@ namespace spot
if (!a->acc().is_generalized_buchi()) if (!a->acc().is_generalized_buchi())
throw std::runtime_error throw std::runtime_error
("degeneralize() can only works with generalized Büchi acceptance"); ("degeneralize() can only works with generalized Büchi acceptance");
if (a->is_alternating()) if (!a->is_existential())
throw std::runtime_error throw std::runtime_error
("degeneralize() does not support alternation"); ("degeneralize() does not support alternation");

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2015, 2016, 2017 Laboratoire de Recherche et // Copyright (C) 2015-2017 Laboratoire de Recherche et
// Développement de l'Epita. // Développement de l'Epita.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -579,7 +579,7 @@ namespace spot
bool pretty_print, bool use_scc, bool pretty_print, bool use_scc,
bool use_simulation, bool use_stutter) bool use_simulation, bool use_stutter)
{ {
if (a->is_alternating()) if (!a->is_existential())
throw std::runtime_error throw std::runtime_error
("tgba_determinize() does not support alternation"); ("tgba_determinize() does not support alternation");
if (a->prop_deterministic()) if (a->prop_deterministic())

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2011, 2012, 2014, 2015, 2016 Laboratoire de Recherche // Copyright (C) 2011, 2012, 2014-2017 Laboratoire de Recherche
// et Developpement de l'Epita (LRDE). // et Développement de l'Epita (LRDE).
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
@ -707,7 +707,7 @@ namespace spot
start(); start();
if (si) if (si)
{ {
if (!aut->is_alternating()) if (aut->is_existential())
si->determine_unknown_acceptance(); si->determine_unknown_acceptance();
unsigned sccs = si->scc_count(); unsigned sccs = si->scc_count();

View file

@ -715,7 +715,7 @@ namespace spot
dtba_sat_synthetize(const const_twa_graph_ptr& a, dtba_sat_synthetize(const const_twa_graph_ptr& a,
int target_state_number, bool state_based) int target_state_number, bool state_based)
{ {
if (a->is_alternating()) if (!a->is_existential())
throw std::runtime_error throw std::runtime_error
("dtba_sat_synthetize() does not support alternating automata"); ("dtba_sat_synthetize() does not support alternating automata");
if (!a->acc().is_buchi()) if (!a->acc().is_buchi())

View file

@ -992,7 +992,7 @@ namespace spot
int target_state_number, int target_state_number,
bool state_based, bool colored) bool state_based, bool colored)
{ {
if (a->is_alternating()) if (!a->is_existential())
throw std::runtime_error throw std::runtime_error
("dtwa_sat_synthetize() does not support alternating automata"); ("dtwa_sat_synthetize() does not support alternating automata");
if (target_state_number == 0) if (target_state_number == 0)

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2011, 2012, 2014, 2015, 2016 Laboratoire de Recherche et // Copyright (C) 2011, 2012, 2014, 2015, 2016, 2017 Laboratoire de Recherche et
// Developpement de l'Epita (LRDE). // Developpement de l'Epita (LRDE).
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
@ -445,7 +445,7 @@ namespace spot
// property. The "univ-branch" property seems more important to // property. The "univ-branch" property seems more important to
// announce that the automaton might not be parsable by tools that // announce that the automaton might not be parsable by tools that
// do not support alternating automata. // do not support alternating automata.
if (aut->is_alternating()) if (!aut->is_existential())
{ {
prop(" univ-branch"); prop(" univ-branch");
} }

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2013, 2015, 2016 Laboratoire de Recherche et Developpement // Copyright (C) 2013, 2015-2017 Laboratoire de Recherche et
// de l'Epita (LRDE). // Developpement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -37,7 +37,7 @@ namespace spot
// we used to have, was motivated by issue #188. // we used to have, was motivated by issue #188.
bool is_unambiguous(const const_twa_graph_ptr& aut) bool is_unambiguous(const const_twa_graph_ptr& aut)
{ {
if (aut->is_alternating()) if (!aut->is_existential())
throw std::runtime_error throw std::runtime_error
("is_unambiguous() does not support alternation"); ("is_unambiguous() does not support alternation");

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013, 2014, 2015, 2016 Laboratoire de Recherche // Copyright (C) 2012-2017 Laboratoire de Recherche et Développement
// et Developpement de 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.
// //
@ -27,7 +27,7 @@ namespace spot
scc_has_rejecting_cycle(scc_info& map, unsigned scc) scc_has_rejecting_cycle(scc_info& map, unsigned scc)
{ {
auto aut = map.get_aut(); auto aut = map.get_aut();
if (aut->is_alternating()) if (!aut->is_existential())
throw std::runtime_error throw std::runtime_error
("scc_has_rejecting_cycle() does not support alternation"); ("scc_has_rejecting_cycle() does not support alternation");
// We check that by cloning the SCC and complementing its // We check that by cloning the SCC and complementing its
@ -45,7 +45,7 @@ namespace spot
bool bool
is_inherently_weak_scc(scc_info& map, unsigned scc) is_inherently_weak_scc(scc_info& map, unsigned scc)
{ {
if (map.get_aut()->is_alternating()) if (!map.get_aut()->is_existential())
throw std::runtime_error throw std::runtime_error
("is_inherently_weak_scc() does not support alternation"); ("is_inherently_weak_scc() does not support alternation");
// Weak SCCs are inherently weak. // Weak SCCs are inherently weak.
@ -60,7 +60,7 @@ namespace spot
bool bool
is_weak_scc(scc_info& map, unsigned scc) is_weak_scc(scc_info& map, unsigned scc)
{ {
if (map.get_aut()->is_alternating()) if (!map.get_aut()->is_existential())
throw std::runtime_error throw std::runtime_error
("is_weak_scc() does not support alternation"); ("is_weak_scc() does not support alternation");
@ -75,7 +75,7 @@ namespace spot
is_complete_scc(scc_info& map, unsigned scc) is_complete_scc(scc_info& map, unsigned scc)
{ {
auto a = map.get_aut(); auto a = map.get_aut();
if (a->is_alternating()) if (!a->is_existential())
throw std::runtime_error throw std::runtime_error
("is_complete_scc() does not support alternation"); ("is_complete_scc() does not support alternation");
for (auto s: map.states_of(scc)) for (auto s: map.states_of(scc))
@ -99,7 +99,7 @@ namespace spot
bool bool
is_terminal_scc(scc_info& map, unsigned scc) is_terminal_scc(scc_info& map, unsigned scc)
{ {
if (map.get_aut()->is_alternating()) if (!map.get_aut()->is_existential())
throw std::runtime_error throw std::runtime_error
("is_terminal_scc() does not support alternation"); ("is_terminal_scc() does not support alternation");

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2015, 2016 Laboratoire de Recherche et Développement // Copyright (C) 2015, 2016, 2017 Laboratoire de Recherche et Développement
// de 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.
@ -43,7 +43,7 @@ namespace spot
twa_graph_ptr& cpy, twa_graph_ptr& cpy,
Trans trans, unsigned int init) Trans trans, unsigned int init)
{ {
if (old->is_alternating()) if (!old->is_existential())
throw std::runtime_error throw std::runtime_error
("transform_accessible() does not support alternation"); ("transform_accessible() does not support alternation");
@ -105,7 +105,7 @@ namespace spot
twa_graph_ptr& cpy, twa_graph_ptr& cpy,
Trans trans, unsigned int init) Trans trans, unsigned int init)
{ {
if (old->is_alternating()) if (!old->is_existential())
throw std::runtime_error throw std::runtime_error
("transform_copy() does not support alternation"); ("transform_copy() does not support alternation");

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Laboratoire de // Copyright (C) 2010-2017 Laboratoire de Recherche et Développement
// Recherche et Développement de 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.
// //
@ -474,7 +474,7 @@ namespace spot
twa_graph_ptr minimize_monitor(const const_twa_graph_ptr& a) twa_graph_ptr minimize_monitor(const const_twa_graph_ptr& a)
{ {
if (a->is_alternating()) if (!a->is_existential())
throw std::runtime_error throw std::runtime_error
("minimize_monitor() does not support alternation"); ("minimize_monitor() does not support alternation");
@ -495,7 +495,7 @@ namespace spot
twa_graph_ptr minimize_wdba(const const_twa_graph_ptr& a) twa_graph_ptr minimize_wdba(const const_twa_graph_ptr& a)
{ {
if (a->is_alternating()) if (!a->is_existential())
throw std::runtime_error throw std::runtime_error
("minimize_wdba() does not support alternation"); ("minimize_wdba() does not support alternation");
@ -610,7 +610,7 @@ namespace spot
const_twa_graph_ptr aut_neg_f, const_twa_graph_ptr aut_neg_f,
bool reject_bigger) bool reject_bigger)
{ {
if (aut_f->is_alternating()) if (!aut_f->is_existential())
throw std::runtime_error throw std::runtime_error
("minimize_obligation() does not support alternation"); ("minimize_obligation() does not support alternation");

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013, 2014, 2015, 2016 Laboratoire de Recherche et // Copyright (C) 2012-2017 Laboratoire de Recherche et Développement
// Développement de 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.
// //
@ -182,7 +182,7 @@ namespace spot
if (type_ == BA || SBACC_) if (type_ == BA || SBACC_)
state_based_ = true; state_based_ = true;
if (a->is_alternating() && if (!a->is_existential() &&
// We will probably have to revisit this condition later. // We will probably have to revisit this condition later.
// Currently, the intent is that postprocessor should never // Currently, the intent is that postprocessor should never
// return an alternating automaton, unless it is called with // return an alternating automaton, unless it is called with

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2014, 2015, 2016 Laboratoire de Recherche et // Copyright (C) 2014-2017 Laboratoire de Recherche et Développement
// Développement de 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.
// //
@ -46,7 +46,7 @@ namespace spot
unsigned right_state, unsigned right_state,
bool and_acc) bool and_acc)
{ {
if (left->is_alternating() || right->is_alternating()) if (!(left->is_existential() && right->is_existential()))
throw std::runtime_error throw std::runtime_error
("product() does not support alternating automata"); ("product() does not support alternating automata");
std::unordered_map<product_state, unsigned, product_state_hash> s2n; std::unordered_map<product_state, unsigned, product_state_hash> s2n;

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2014, 2015, 2016 Laboratoire de Recherche et Développement // Copyright (C) 2014-2017 Laboratoire de Recherche et Développement
// de 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.
@ -29,7 +29,7 @@ namespace spot
randomize(twa_graph_ptr& aut, bool randomize_states, randomize(twa_graph_ptr& aut, bool randomize_states,
bool randomize_edges) bool randomize_edges)
{ {
if (aut->is_alternating()) if (!aut->is_existential())
throw std::runtime_error throw std::runtime_error
("randomize() does not yet support alternation"); ("randomize() does not yet support alternation");

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2015, 2016, 2017 Laboratoire de Recherche et // Copyright (C) 2015-2017 Laboratoire de Recherche et Développement
// Développement de l'Epita. // de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -494,7 +494,7 @@ namespace spot
if (aut->prop_weak().is_true()) if (aut->prop_weak().is_true())
return remove_fin_weak(aut); return remove_fin_weak(aut);
if (aut->is_alternating()) if (!aut->is_existential())
return remove_fin(remove_alternation(aut)); return remove_fin(remove_alternation(aut));
if (auto maybe = streett_to_generalized_buchi_maybe(aut)) if (auto maybe = streett_to_generalized_buchi_maybe(aut))

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2015, 2016 Laboratoire de Recherche et Développement // Copyright (C) 2015-2017 Laboratoire de Recherche et Développement
// de l'Epita. // de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -29,7 +29,7 @@ namespace spot
{ {
if (old->prop_state_acc()) if (old->prop_state_acc())
return old; return old;
if (old->is_alternating()) if (!old->is_existential())
throw std::runtime_error throw std::runtime_error
("sbacc() does not support alternation"); ("sbacc() does not support alternation");

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 // Copyright (C) 2009-2017 Laboratoire de Recherche et Développement
// Laboratoire de Recherche et Développement de 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.
// //
@ -276,7 +276,7 @@ namespace spot
twa_graph_ptr scc_filter_apply(const_twa_graph_ptr aut, twa_graph_ptr scc_filter_apply(const_twa_graph_ptr aut,
scc_info* given_si, Args&&... args) scc_info* given_si, Args&&... args)
{ {
if (aut->is_alternating()) if (!aut->is_existential())
throw std::runtime_error throw std::runtime_error
("scc_filter() does yet not support alternation"); ("scc_filter() does yet not support alternation");

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2014, 2015, 2016 Laboratoire de Recherche et Développement // Copyright (C) 2014-2017 Laboratoire de Recherche et Développement
// de l'Epita. // de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -353,7 +353,7 @@ namespace spot
void scc_info::determine_unknown_acceptance() void scc_info::determine_unknown_acceptance()
{ {
if (aut_->is_alternating()) if (!aut_->is_existential())
throw std::runtime_error("scc_info::determine_unknown_acceptance() " throw std::runtime_error("scc_info::determine_unknown_acceptance() "
"does not support alternating automata"); "does not support alternating automata");
std::vector<bool> k; std::vector<bool> k;

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013, 2014, 2015, 2016 Laboratoire de Recherche // Copyright (C) 2012-2017 Laboratoire de Recherche et Développement
// et Développement de 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.
// //
@ -160,7 +160,7 @@ namespace spot
if (!has_separate_sets(in)) if (!has_separate_sets(in))
throw std::runtime_error throw std::runtime_error
("direct_simulation() requires separate Inf and Fin sets"); ("direct_simulation() requires separate Inf and Fin sets");
if (in->is_alternating()) if (!in->is_existential())
throw std::runtime_error throw std::runtime_error
("direct_simulation() does not yet support alternation"); ("direct_simulation() does not yet support alternation");

View file

@ -172,7 +172,7 @@ namespace spot
void check_strength(const twa_graph_ptr& aut, scc_info* si) void check_strength(const twa_graph_ptr& aut, scc_info* si)
{ {
if (aut->is_alternating()) if (!aut->is_existential())
is_type_automaton<false, false, true>(aut, si); is_type_automaton<false, false, true>(aut, si);
else else
is_type_automaton<true, true, true>(aut, si); is_type_automaton<true, true, true>(aut, si);

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2014, 2015, 2016 Laboratoire de Recherche et // Copyright (C) 2014, 2015, 2016, 2017 Laboratoire de Recherche et
// Développement de l'Epita. // Développement de l'Epita.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -225,7 +225,7 @@ f6()
f += t.first; f += t.first;
h += t.second; h += t.second;
} }
return f == 3 && (h > 2.49 && h < 2.51) && !g.is_alternating(); return f == 3 && (h > 2.49 && h < 2.51) && g.is_existential();
} }
static bool static bool
@ -247,7 +247,7 @@ f7()
g.dump_storage(std::cout); g.dump_storage(std::cout);
return f == 15 && g.is_alternating(); return f == 15 && !g.is_existential();
} }

View file

@ -264,7 +264,7 @@ static bool f6()
f += t.first; f += t.first;
h += t.second; h += t.second;
} }
return f == 3 && (h > 2.49 && h < 2.51) && !g.is_alternating(); return f == 3 && (h > 2.49 && h < 2.51) && g.is_existential();
} }
static bool f7() static bool f7()
@ -287,7 +287,7 @@ static bool f7()
for (unsigned tt: g.univ_dests(t.dst)) for (unsigned tt: g.univ_dests(t.dst))
f += t.label * g.state_data(tt); f += t.label * g.state_data(tt);
return f == 15 && g.is_alternating(); return f == 15 && !g.is_existential();
} }

View file

@ -1,6 +1,6 @@
#!/usr/bin/python3 #!/usr/bin/python3
# -*- mode: python; coding: utf-8 -*- # -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2016 Laboratoire de Recherche et Développement de # Copyright (C) 2016, 2017 Laboratoire de Recherche et Développement de
# l'EPITA. # l'EPITA.
# #
# This file is part of Spot, a model checking library. # This file is part of Spot, a model checking library.
@ -40,7 +40,7 @@ tr = [(s, [[x for x in aut.univ_dests(i)] for i in aut.out(s)])
for s in range(3)] for s in range(3)]
print(tr) print(tr)
assert [(0, [[1, 2], [0, 1]]), (1, [[0, 2, 1]]), (2, [[2]])] == tr assert [(0, [[1, 2], [0, 1]]), (1, [[0, 2, 1]]), (2, [[2]])] == tr
assert aut.is_alternating() assert not aut.is_existential()
received = False received = False
try: try: