From 9c0231c45580dca42ed9ec6539686d5a6b203a04 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 18 Aug 2022 18:01:31 +0200 Subject: [PATCH] rulegen3:: minor bugfixes --- rulegen3.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rulegen3.cpp b/rulegen3.cpp index 851af4ca..9ac2b5cb 100644 --- a/rulegen3.cpp +++ b/rulegen3.cpp @@ -339,6 +339,10 @@ void error_found(vstate& vs) { twalker pw = p; pw.at->code = MYSTERY_LARGE; int tsid = get_treestate_id(pw).second; + if(!treestates[tsid].giver.at) { + be_important(pw.at); + continue; + } if(error_debug >= 2 && imp_as_set.count(p) && imp_as_set.count(p1)) println(hlog, "last: ", p, " -> ", p1, " actual diff = ", p1->dist, "-", p->dist, " expected diff = ", diff, " dir = ", dir, " ts = ", tsid); indenter ind(2); @@ -525,7 +529,8 @@ bool check_det(vstate& vs) { vs.vcells[vs.current_pos].adj[p.first] = isize(vs.vcells); vs.vcells.emplace_back(); vs.vcells.back().become(rule); - vs.vcells.back().adj[treestates[rule].giver.spin] = vs.current_pos; + int dir = treestates[rule].giver.spin; + vs.vcells.back().adj[dir] = vs.current_pos; goto back; } @@ -649,7 +654,8 @@ template int build_vstate(vstate& vs, vector& path1, const vector< if(dir == -1) continue; vs.vcells.emplace_back(); vs.vcells.back().become(state(at)); - vs.vcells[vs.current_root].adj[treestates[ots].giver.at->parent_dir] = vs.current_root+1; + int xdir = treestates[ots].giver.at->parent_dir; + vs.vcells[vs.current_root].adj[xdir] = vs.current_root+1; vs.vcells[vs.current_root+1].adj[dir] = vs.current_root; vs.current_root++; } @@ -1285,7 +1291,7 @@ EX void test_transducers() { for(int i=0; i