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:
parent
7f7d078f2f
commit
fefb375d5f
36 changed files with 127 additions and 93 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// -*- 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).
|
||||
// Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// 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)
|
||||
{
|
||||
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;
|
||||
if (!aa)
|
||||
aa = make_twa_graph(a, twa::prop_set::all());
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ namespace spot
|
|||
{
|
||||
set_named_prop("highlight-edges", nullptr);
|
||||
g_.remove_dead_edges_();
|
||||
if (is_alternating())
|
||||
if (!is_existential())
|
||||
merge_univ_dests();
|
||||
|
||||
typedef graph_t::edge_storage_t tr_t;
|
||||
|
|
@ -245,7 +245,7 @@ namespace spot
|
|||
std::vector<unsigned> order;
|
||||
order.reserve(num_states);
|
||||
|
||||
if (!is_alternating())
|
||||
if (is_existential())
|
||||
{
|
||||
std::vector<std::pair<unsigned, unsigned>> todo; // state, edge
|
||||
useful[get_init_state_number()] = 1;
|
||||
|
|
@ -399,7 +399,7 @@ namespace spot
|
|||
void twa_graph::defrag_states(std::vector<unsigned>&& newst,
|
||||
unsigned used_states)
|
||||
{
|
||||
if (is_alternating())
|
||||
if (!is_existential())
|
||||
{
|
||||
auto& g = get_graph();
|
||||
auto& dests = g.dests_vector();
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ namespace spot
|
|||
virtual const twa_graph_state* get_init_state() const override
|
||||
{
|
||||
unsigned n = get_init_state_number();
|
||||
if (SPOT_UNLIKELY(is_alternating()))
|
||||
if (SPOT_UNLIKELY(!is_existential()))
|
||||
throw std::runtime_error
|
||||
("the abstract interface does not support alternating automata");
|
||||
return state_from_number(n);
|
||||
|
|
@ -479,10 +479,23 @@ namespace spot
|
|||
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
|
||||
{
|
||||
return g_.is_alternating();
|
||||
return !is_existential();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef SWIG
|
||||
auto states() const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue