From 37ebe6af5dc352f9976b40d8f1aca7baa769ae90 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 1 Feb 2022 16:57:47 +0100 Subject: [PATCH] rulegen:: debug improvements --- rulegen.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rulegen.cpp b/rulegen.cpp index 8108a219..b9995cb8 100644 --- a/rulegen.cpp +++ b/rulegen.cpp @@ -1247,7 +1247,7 @@ int get_side(twalker what) { return res; } -int move_code(twalker cs) { +EX int move_code(twalker cs) { bool child = false; if(cs.at->dist) { auto csd = get_parent_dir(cs); @@ -1635,6 +1635,8 @@ void verified_treewalk(twalker& tw, int id, int dir) { treewalk(tw, dir); } +EX bool view_examine_branch = false; + bool examine_branch(int id, int left, int right) { auto rg = treestates[id].giver; @@ -1676,7 +1678,7 @@ bool examine_branch(int id, int left, int right) { auto rl = get_rule(wl, tsl); auto rr = get_rule(wr, tsr); - if(0) if(debugflags & DF_GEOM) + if(view_examine_branch) if(debugflags & DF_GEOM) println(hlog, "wl = ", wl, " -> ", wl+wstep, " R", rl, " wr = ", wr, " -> ", wr+wstep, " R", rr, " lstack = ", lstack, " rstack = ", rstack); if(rl == DIR_RIGHT && rr == DIR_LEFT && lstack.empty() && rstack.empty()) { @@ -1684,7 +1686,7 @@ bool examine_branch(int id, int left, int right) { push_deadstack(hash, wl, tsl, -1); hash.emplace_back(-1, wl.at->dist - wr.at->dist); push_deadstack(hash, wr, tsr, +1); - if(0) if(debugflags & DF_GEOM) + if(view_examine_branch) if(debugflags & DF_GEOM) println(hlog, "got hash: ", hash); if(verified_branches.count(hash)) { return true; @@ -1870,8 +1872,6 @@ EX void rules_iteration() { println(hlog, "deadend states found: ", new_deadends); } - // print_rules(); - handle_distance_errors(); verified_branches.clear();