From d033633be04b653812b20abdbbcb77eb0eb1ec76 Mon Sep 17 00:00:00 2001 From: Thibaud Michaud Date: Tue, 9 Dec 2014 17:52:30 +0100 Subject: [PATCH] are_isomorphic: do not try to map initial state to a non-initial state * src/tgbaalgos/are_isomorphic.cc: Here. --- src/tgbaalgos/are_isomorphic.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tgbaalgos/are_isomorphic.cc b/src/tgbaalgos/are_isomorphic.cc index 74bb1e864..64f9e3211 100644 --- a/src/tgbaalgos/are_isomorphic.cc +++ b/src/tgbaalgos/are_isomorphic.cc @@ -86,6 +86,9 @@ namespace // the union of in and out is the same. state2class[i] = spot::wang32_hash(hashin[i]) ^ hashout[i]; + // XOR the initial state's hash with a pseudo random value so that it is + // in its own class. + state2class[a->get_init_state_number()] ^= 2654435761U; return state2class; } @@ -100,8 +103,9 @@ namespace for (unsigned s = 0; s < n; ++s) { class_t c1 = state2class[s]; - (*(class2states.emplace(c1, std::vector()).first)).second. - emplace_back(s); + auto& states = + class2states.emplace(c1, std::vector()).first->second; + states.emplace_back(s); } return class2states;