convert: simplify interfaces

* spot/twacube_algos/convert.cc, spot/twacube_algos/convert.hh,
tests/core/twacube.cc: here.
This commit is contained in:
Etienne Renault 2016-04-20 14:22:21 +02:00
parent e11f24dbc1
commit d430129bb1
3 changed files with 15 additions and 19 deletions

View file

@ -59,12 +59,14 @@ namespace spot
return result;
}
spot::twacube* twa_to_twacube(spot::twa_graph_ptr& aut,
std::unordered_map<int, int>& ap_binder,
std::vector<std::string>& aps)
spot::twacube* twa_to_twacube(const spot::const_twa_graph_ptr aut)
{
// Compute the necessary binder and extract atomic propositions
std::unordered_map<int, int> ap_binder;
std::vector<std::string>* aps = extract_aps(aut, ap_binder);
// Declare the twa cube
spot::twacube* tg = new spot::twacube(aps);
spot::twacube* tg = new spot::twacube(*aps);
// Fix acceptance
tg->acc() = aut->acc();
@ -111,11 +113,12 @@ namespace spot
}
// Must be contiguous to support swarming.
assert(tg->succ_contiguous());
delete aps;
return tg;
}
std::vector<std::string>*
extract_aps(spot::twa_graph_ptr& aut,
extract_aps(const spot::const_twa_graph_ptr aut,
std::unordered_map<int, int>& ap_binder)
{
std::vector<std::string>* aps = new std::vector<std::string>();

View file

@ -40,16 +40,15 @@ namespace spot
SPOT_API bdd cube_to_bdd(spot::cube cube, const cubeset& cubeset,
std::unordered_map<int, int>& reverse_binder);
/// \brief Extract the atomic propositions from the automaton
/// \brief Extract the atomic propositions from the automaton. This method
/// also fill the binder, i.e. the mapping between BDD indexes to cube indexes
SPOT_API std::vector<std::string>*
extract_aps(spot::twa_graph_ptr& aut,
extract_aps(spot::const_twa_graph_ptr aut,
std::unordered_map<int, int>& ap_binder);
/// \brief Convert a twa into a twacube
SPOT_API spot::twacube*
twa_to_twacube(spot::twa_graph_ptr& aut,
std::unordered_map<int, int>& ap_binder,
std::vector<std::string>& aps);
twa_to_twacube(spot::const_twa_graph_ptr aut);
/// \brief Convert a twacube into a twa
SPOT_API spot::twa_graph_ptr