@@ -40,7 +40,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
4040
4141#include < sstream>
4242
43- // #define DEBUG
43+ // #define DEBUG
4444
4545using namespace cadabra ;
4646
@@ -272,8 +272,10 @@ Algorithm::result_t Algorithm::apply_deep(Ex::iterator& it)
272272 result_t res = apply (work);
273273 if (res==Algorithm::result_t ::l_applied || res==Algorithm::result_t ::l_applied_no_new_dummies) {
274274 some_changes_somewhere=result_t ::l_applied;
275- if (res==Algorithm::result_t ::l_applied)
275+ if (res==Algorithm::result_t ::l_applied) {
276+ // std::cerr << "rename replacement on " << work << std::endl;
276277 rename_replacement_dummies (work, true );
278+ }
277279 deepest_action=tr.depth (work);
278280 // If we got a zero at 'work', we need to propagate this up the tree and
279281 // then restart our post-order traversal such that everything that has
@@ -660,7 +662,7 @@ bool Algorithm::rename_replacement_dummies(iterator two, bool still_inside_algo)
660662 index_map_t ind_free, ind_dummy;
661663 index_map_t ind_free_full, ind_dummy_full;
662664
663- if (still_inside_algo) {
665+ if (false && still_inside_algo) {
664666 if (tr.is_head (two)==false )
665667 classify_indices_up (tr.parent (two), ind_free_full, ind_dummy_full);
666668 }
@@ -675,6 +677,9 @@ bool Algorithm::rename_replacement_dummies(iterator two, bool still_inside_algo)
675677 std::cerr << " free indices above us" << std::endl;
676678 for (auto & ii: ind_free_full)
677679 std::cerr << ii.first << std::endl;
680+ std::cerr << " dummy indices above us" << std::endl;
681+ for (auto & ii: ind_dummy_full)
682+ std::cerr << ii.first << std::endl;
678683#endif
679684
680685 index_map_t must_be_empty;
@@ -684,7 +689,9 @@ bool Algorithm::rename_replacement_dummies(iterator two, bool still_inside_algo)
684689 determine_intersection (ind_dummy_full, ind_dummy, must_be_empty);
685690 index_map_t ::iterator it=must_be_empty.begin ();
686691 while (it!=must_be_empty.end ()) {
687- // std::cerr << "double index pair" << std::endl;
692+ #ifdef DEBUG
693+ std::cerr << " double index pair" << std::endl;
694+ #endif
688695 Ex the_key=(*it).first ;
689696 const Indices *dums=kernel.properties .get <Indices>(it->second , true );
690697 if (!dums)
0 commit comments