Adding function to canonicalize an automaton.
* src/tgbaalgos/are_isomorphic.cc, src/tgbaalgos/are_isomorphic.hh, src/bin/autfilt.cc: are_isomorphic now uses canonicalize. It returns a bool, because the mapping cannot be deduced easily from the canonicalized automaton. * src/graph/graph.hh: Add equality operator to trans_storage_t for easy comparison of transition vectors. * src/tgba/tgbagraph.hh: Add equality operator to tgba_graph_trans_data and to tgba_digraph. * src/tgbaalgos/canonicalize.cc, src/tgbaalgos/canonicalize.hh: New files. * src/tgbaalgos/Makefile.am: Add them. * src/tgbatest/isomorph.test: Test them.
This commit is contained in:
parent
b83d6d7f29
commit
1995602df5
9 changed files with 271 additions and 187 deletions
|
|
@ -96,6 +96,12 @@ namespace spot
|
|||
return false;
|
||||
return acc < other.acc;
|
||||
}
|
||||
|
||||
bool operator==(const tgba_graph_trans_data& other) const
|
||||
{
|
||||
return cond.id() == other.cond.id() &&
|
||||
acc == other.acc;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -458,6 +464,17 @@ namespace spot
|
|||
return state_is_accepting(state_number(s));
|
||||
}
|
||||
|
||||
bool operator==(const tgba_digraph& aut) const
|
||||
{
|
||||
if (num_states() != aut.num_states() ||
|
||||
num_transitions() != aut.num_transitions() ||
|
||||
acc().num_sets() != aut.acc().num_sets())
|
||||
return false;
|
||||
auto& trans1 = transition_vector();
|
||||
auto& trans2 = aut.transition_vector();
|
||||
return std::equal(trans1.begin() + 1, trans1.end(),
|
||||
trans2.begin() + 1);
|
||||
}
|
||||
};
|
||||
|
||||
inline tgba_digraph_ptr make_tgba_digraph(const bdd_dict_ptr& dict)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue