feat(library/meng_paulson): minor improvement

This commit is contained in:
Leonardo de Moura 2015-10-15 08:43:29 -07:00
parent 5b6b8257d8
commit 4f394bd979

View file

@ -130,12 +130,13 @@ public:
name_set operator()() { name_set operator()() {
name_set A; name_set A;
name_set Fs = m_relevant;
// unsigned i = 1; // unsigned i = 1;
while (true) { while (true) {
// std::cout << "#" << i << ", p: " << m_p << "\n"; // std::cout << "#" << i << ", p: " << m_p << "\n";
name_set Rel; name_set Rel;
m_relevant.for_each([&](name const & c) { Fs.for_each([&](name const & F) {
name_set used_by = get_used_by_set(m_env, c); name_set used_by = get_used_by_set(m_env, F);
used_by.for_each([&](name const & T) { used_by.for_each([&](name const & T) {
declaration const & T_decl = m_env.get(T); declaration const & T_decl = m_env.get(T);
if (A.contains(T)) if (A.contains(T))
@ -155,6 +156,7 @@ public:
if (Rel.empty()) if (Rel.empty())
break; break;
// include symbols of new theorems in m_relevant // include symbols of new theorems in m_relevant
Fs = name_set(); // reset Fs
Rel.for_each([&](name const & T) { Rel.for_each([&](name const & T) {
name_set uses = get_use_set(m_env, T); name_set uses = get_use_set(m_env, T);
uses.for_each([&](name const & F) { uses.for_each([&](name const & F) {
@ -166,6 +168,7 @@ public:
// if (!m_relevant.contains(F)) // if (!m_relevant.contains(F))
// std::cout << "new relevant: " << F << "\n"; // std::cout << "new relevant: " << F << "\n";
m_relevant.insert(F); m_relevant.insert(F);
Fs.insert(F);
}); });
}); });
m_p = m_p + (1.0 - m_p) / m_c; m_p = m_p + (1.0 - m_p) / m_c;