From dea96872bc1aa844253da95e089cdcba2e88e9e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffan=20S=C3=B8lvsten?= Date: Thu, 30 May 2024 11:37:15 +0200 Subject: [PATCH] Remove dead code for 'bdd_satmin' and 'bdd_satmax' with consumers --- src/adiar/bdd/evaluate.cpp | 46 +++++--------------------------------- 1 file changed, 6 insertions(+), 40 deletions(-) diff --git a/src/adiar/bdd/evaluate.cpp b/src/adiar/bdd/evaluate.cpp index cfd27f7de..2217d1436 100644 --- a/src/adiar/bdd/evaluate.cpp +++ b/src/adiar/bdd/evaluate.cpp @@ -196,32 +196,16 @@ namespace adiar private: Visitor _visitor; - const generator& _generator; - optional _next_domain; - const consumer>& _consumer; public: - bdd_satX__functional(const generator& g, - const consumer>& c) - : _generator(g) - , _consumer(c) - { - this->_next_domain = this->_generator(); - } + bdd_satX__functional(const consumer>& c) + : _consumer(c) + {} bdd::pointer_type visit(const bdd::node_type& n) { - // Add skipped levels - while (this->_next_domain && this->_next_domain.value() <= n.label()) { - const bdd::label_type next_domain = this->_next_domain.value(); - if (next_domain != n.label()) { - this->_consumer({ next_domain, !Visitor::default_direction }); - } - this->_next_domain = this->_generator(); - } - // Update with this level const bdd::pointer_type next = this->_visitor.visit(n); this->_consumer({ n.label(), next == n.high() }); return next; @@ -230,12 +214,6 @@ namespace adiar void visit(const bool t) { - // Add skipped levels - while (this->_next_domain && this->_next_domain.value()) { - this->_consumer({ this->_next_domain.value(), !Visitor::default_direction }); - this->_next_domain = this->_generator(); - } - // Finally, visit terminal _visitor.visit(t); } }; @@ -262,26 +240,14 @@ namespace adiar return __bdd_satX(f, nothing, f->levels()); } - template - void - __bdd_satX(const bdd& f, - const generator& g, - const consumer>& c) - { - if (bdd_isfalse(f)) { return; } - - bdd_satX__functional v(g, c); - internal::traverse(f, v); - } - template void __bdd_satX(const bdd& f, const consumer>& c) { - if (bdd_istrue(f)) { return; } + if (bdd_isconst(f)) { return; } - const generator nothing = []() -> optional { return {}; }; - return __bdd_satX(f, nothing, c); + bdd_satX__functional v(c); + internal::traverse(f, v); } bdd