From 1eb4002ac038a82eca7c653c6ebd67d96a1d2d83 Mon Sep 17 00:00:00 2001 From: Andrew Cheung Date: Thu, 18 Jul 2024 19:52:03 -0700 Subject: [PATCH] Remove all traces of the old egraph --- src/to_egraph_serialized.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/to_egraph_serialized.rs b/src/to_egraph_serialized.rs index decc458..ad290b8 100644 --- a/src/to_egraph_serialized.rs +++ b/src/to_egraph_serialized.rs @@ -19,7 +19,14 @@ pub fn get_term( let node = &choices[cid]; // add the node to the result egraph if !result_egraph.nodes.contains_key(node) { - result_egraph.add_node(node.clone(), egraph.nodes[node].clone()); + let mut new_node = egraph.nodes[node].clone(); + new_node.children = egraph.nodes[node] + .children + .iter() + .map(|child| choices[egraph.nid_to_cid(&child)].clone()) + .collect(); + + result_egraph.add_node(node.clone(), new_node); } }