feat(library/blast/state): add initialized event handler for branch extensions.
This commit is contained in:
parent
107c155574
commit
70a1aebfe3
3 changed files with 4 additions and 4 deletions
|
@ -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() {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue