Fix bug in universe levels
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
a4f456c99e
commit
279e524c9e
1 changed files with 11 additions and 10 deletions
|
@ -82,15 +82,17 @@ struct environment::imp {
|
||||||
lean_assert(v1 < num);
|
lean_assert(v1 < num);
|
||||||
lean_assert(v2 < num);
|
lean_assert(v2 < num);
|
||||||
std::vector<unsigned> & v1_dists = m_uvar_distances[v1];
|
std::vector<unsigned> & v1_dists = m_uvar_distances[v1];
|
||||||
v1_dists[v2] = d;
|
if (v1_dists[v2] == uninit || d >= v1_dists[v2]) {
|
||||||
// update forward
|
v1_dists[v2] = d;
|
||||||
std::vector<unsigned> & v2_dists = m_uvar_distances[v2];
|
// update forward
|
||||||
for (uvar v3 = 0; v3 < num; v3++) {
|
std::vector<unsigned> & v2_dists = m_uvar_distances[v2];
|
||||||
if (v2_dists[v3] != uninit) {
|
for (uvar v3 = 0; v3 < num; v3++) {
|
||||||
lean_assert(v1 != v3);
|
if (v2_dists[v3] != uninit) {
|
||||||
unsigned d_v1_v3 = add(d, v2_dists[v3]);
|
lean_assert(v1 != v3);
|
||||||
if (v1_dists[v3] == uninit || d_v1_v3 >= v1_dists[v3])
|
unsigned d_v1_v3 = add(d, v2_dists[v3]);
|
||||||
v1_dists[v3] = d_v1_v3;
|
if (v1_dists[v3] == uninit || d_v1_v3 >= v1_dists[v3])
|
||||||
|
v1_dists[v3] = d_v1_v3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -130,7 +132,6 @@ struct environment::imp {
|
||||||
out << "\n";
|
out << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out << "\n";
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue