toparity: rename iar_old()/iar_maybe_old() to iar()/iar_maybe()
* spot/twaalgos/toparity.hh, spot/twaalgos/toparity.cc: Use the original names, to minimize differences with spot 2.8. Deprecate them. * tests/python/except.py: Adjust. * NEWS: Mention the change.
This commit is contained in:
parent
0a95314dca
commit
2b918d1c02
4 changed files with 44 additions and 27 deletions
|
|
@ -39,8 +39,8 @@
|
|||
namespace spot
|
||||
{
|
||||
|
||||
// Old version of IAR.
|
||||
namespace
|
||||
// Old version of IAR.
|
||||
namespace
|
||||
{
|
||||
|
||||
using perm_t = std::vector<unsigned>;
|
||||
|
|
@ -346,31 +346,39 @@ namespace
|
|||
std::vector<unsigned> state2pos_iar_states;
|
||||
std::vector<std::pair<iar_state, unsigned>> iar_states;
|
||||
};
|
||||
}
|
||||
|
||||
twa_graph_ptr
|
||||
iar_maybe_old(const const_twa_graph_ptr& aut, bool pretty_print)
|
||||
{
|
||||
std::vector<acc_cond::rs_pair> pairs;
|
||||
if (!aut->acc().is_rabin_like(pairs))
|
||||
if (!aut->acc().is_streett_like(pairs))
|
||||
return nullptr;
|
||||
// Make this a function different from iar_maybe(), so that
|
||||
// iar() does not have to call a deprecated function.
|
||||
static twa_graph_ptr
|
||||
iar_maybe_(const const_twa_graph_ptr& aut, bool pretty_print)
|
||||
{
|
||||
std::vector<acc_cond::rs_pair> pairs;
|
||||
if (!aut->acc().is_rabin_like(pairs))
|
||||
if (!aut->acc().is_streett_like(pairs))
|
||||
return nullptr;
|
||||
else
|
||||
{
|
||||
iar_generator<false> gen(aut, pairs, pretty_print);
|
||||
return gen.run();
|
||||
}
|
||||
else
|
||||
{
|
||||
iar_generator<false> gen(aut, pairs, pretty_print);
|
||||
iar_generator<true> gen(aut, pairs, pretty_print);
|
||||
return gen.run();
|
||||
}
|
||||
else
|
||||
{
|
||||
iar_generator<true> gen(aut, pairs, pretty_print);
|
||||
return gen.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
twa_graph_ptr
|
||||
iar_old(const const_twa_graph_ptr& aut, bool pretty_print)
|
||||
iar_maybe(const const_twa_graph_ptr& aut, bool pretty_print)
|
||||
{
|
||||
if (auto res = iar_maybe_old(aut, pretty_print))
|
||||
return iar_maybe_(aut, pretty_print);
|
||||
}
|
||||
|
||||
twa_graph_ptr
|
||||
iar(const const_twa_graph_ptr& aut, bool pretty_print)
|
||||
{
|
||||
if (auto res = iar_maybe_(aut, pretty_print))
|
||||
return res;
|
||||
throw std::runtime_error("iar() expects Rabin-like or Streett-like input");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ namespace spot
|
|||
/// It is better to use to_parity() instead, as it will use better
|
||||
/// strategies when possible, and has additional optimizations.
|
||||
SPOT_API twa_graph_ptr
|
||||
to_parity_old(const const_twa_graph_ptr& aut, bool pretty_print=false);
|
||||
to_parity_old(const const_twa_graph_ptr& aut, bool pretty_print = false);
|
||||
|
||||
/// \ingroup twa_acc_transform
|
||||
/// \brief Turn a Rabin-like or Streett-like automaton into a parity automaton
|
||||
|
|
@ -113,17 +113,18 @@ namespace spot
|
|||
///
|
||||
/// It is better to use to_parity() instead, as it will use better
|
||||
/// strategies when possible, and has additional optimizations.
|
||||
SPOT_DEPRECATED("use to_parity() instead") // deprecated since Spot 2.9
|
||||
SPOT_API twa_graph_ptr
|
||||
iar_old(const const_twa_graph_ptr& aut, bool pretty_print = false);
|
||||
iar(const const_twa_graph_ptr& aut, bool pretty_print = false);
|
||||
|
||||
/// \ingroup twa_acc_transform
|
||||
/// \brief Turn a Rabin-like or Streett-like automaton into a parity automaton
|
||||
/// based on the index appearence record (IAR)
|
||||
///
|
||||
/// Returns nullptr if the input automaton is neither Rabin-like nor
|
||||
/// Streett-like, and calls spot::iar_old() otherwise.
|
||||
SPOT_API
|
||||
twa_graph_ptr
|
||||
iar_maybe_old(const const_twa_graph_ptr& aut, bool pretty_print = false);
|
||||
/// Streett-like, and calls spot::iar() otherwise.
|
||||
SPOT_DEPRECATED("use to_parity() and spot::acc_cond::is_rabin_like() instead")
|
||||
SPOT_API twa_graph_ptr // deprecated since Spot 2.9
|
||||
iar_maybe(const const_twa_graph_ptr& aut, bool pretty_print = false);
|
||||
|
||||
} // namespace spot
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue