From 1d1deeb9576133243880520418c9dc51018fbca2 Mon Sep 17 00:00:00 2001 From: Alex Fischman Date: Sat, 13 Apr 2024 16:28:52 -0700 Subject: [PATCH] Ignored children aren't reachable --- dag_in_context/src/greedy_dag_extractor.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dag_in_context/src/greedy_dag_extractor.rs b/dag_in_context/src/greedy_dag_extractor.rs index 482e488af..58d6c2fa7 100644 --- a/dag_in_context/src/greedy_dag_extractor.rs +++ b/dag_in_context/src/greedy_dag_extractor.rs @@ -213,8 +213,12 @@ pub fn extract( continue; } // Add the children to the frontier - for child in &egraph.nodes.get(&nid).unwrap().children { - frontier.push_back(child.clone()); + let node = egraph.nodes.get(&nid).unwrap(); + let ignored_children = cm.ignored_children(&node.op); + for (i, child) in node.children.iter().enumerate() { + if !ignored_children.contains(&i) { + frontier.push_back(child.clone()); + } } } // Get unreachable nodes with set complement