diff --git a/rulegen.cpp b/rulegen.cpp index 065b708e..0b4e1387 100644 --- a/rulegen.cpp +++ b/rulegen.cpp @@ -1640,6 +1640,32 @@ void find_possible_parents() { ts.is_possible_parent = false; changes++; } + + if(!changes) for(auto& ts: treestates) + if(ts.is_possible_parent) { + set visited; + vector vis; + auto visit = [&] (int v) { if(visited.count(v)) return; visited.insert(v); vis.push_back(v); }; + bool left_found = false, right_found = false; + visit(ts.id); + for(int i=0; i= 0 && treestates[r[j]].is_live) { + if(j < ppar) left_found = true; + if(j > ppar) right_found = true; + } + } + if(left_found && right_found) break; + } + if(!left_found || !right_found) { + ts.is_possible_parent = false; + changes++; + } + } if(!changes) break; }