feat(library/blast/state): add initialized event handler for branch extensions.

This commit is contained in:
Leonardo de Moura 2015-11-18 17:24:04 -08:00
parent 107c155574
commit 70a1aebfe3
3 changed files with 4 additions and 4 deletions

View file

@ -20,8 +20,6 @@ struct recursor_branch_extension : public branch_extension {
recursor_branch_extension(recursor_branch_extension const & b):m_rec_queue(b.m_rec_queue) {}
virtual ~recursor_branch_extension() {}
virtual branch_extension * clone() { return new recursor_branch_extension(*this); }
virtual void hypothesis_activated(hypothesis const &, hypothesis_idx) {}
virtual void hypothesis_deleted(hypothesis const &, hypothesis_idx) {}
};
void initialize_recursor_action() {

View file

@ -712,6 +712,7 @@ branch_extension & state::get_extension(unsigned extid) {
ext->inc_ref();
m_branch.m_extensions[extid] = ext;
lean_assert(ext.get_rc() == 1);
ext->initialized();
m_branch.m_active.for_each([&](hypothesis_idx hidx) {
hypothesis const * h = get_hypothesis_decl(hidx);
lean_assert(h);

View file

@ -104,8 +104,9 @@ class branch_extension {
public:
virtual ~branch_extension() {}
virtual branch_extension * clone() = 0;
virtual void hypothesis_activated(hypothesis const & h, hypothesis_idx hidx) = 0;
virtual void hypothesis_deleted(hypothesis const & h, hypothesis_idx hidx) = 0;
virtual void initialized() {}
virtual void hypothesis_activated(hypothesis const &, hypothesis_idx) {}
virtual void hypothesis_deleted(hypothesis const &, hypothesis_idx) {}
};
unsigned register_branch_extension(branch_extension * initial);