safra: Fix the nesting comparision function

* src/twaalgos/safra.cc, src/twaalgos/safra.hh: Here.
This commit is contained in:
Alexandre Lewkowicz 2015-05-28 19:11:02 +02:00 committed by Alexandre Duret-Lutz
parent ebe03cf3d0
commit 64cdd1adc7
2 changed files with 5 additions and 4 deletions

View file

@ -37,8 +37,8 @@ namespace spot
size_t i = 0;
for (; i < m; ++i)
{
if (lhs[i] < rhs[i])
return true;
if (lhs[i] != rhs[i])
return lhs[i] < rhs[i];
}
return lhs.size() > rhs.size();
}
@ -255,7 +255,7 @@ namespace spot
return nodes_ < other.nodes_;
}
void safra_state::print_debug(unsigned state_id)
void safra_state::print_debug(unsigned state_id) const
{
std::cerr << "State: " << state_id << "{ ";
for (auto& n: nodes_)

View file

@ -43,7 +43,8 @@ namespace spot
typedef std::vector<std::pair<safra_state, unsigned>> succs_t;
bool operator<(const safra_state& other) const;
// Print each sub-state with their associated braces of a safra state
void print_debug(unsigned state_id);
void print_debug(unsigned state_id) const;
// Printh the number of states in each brace
safra_state(unsigned state_number, bool init_state = false);
// Given a certain transition_label, compute all the successors of that
// label, and return that new node.