Skip to content

Commit

Permalink
Fix root e-classes
Browse files Browse the repository at this point in the history
  • Loading branch information
saulshanabrook committed Jul 26, 2023
1 parent 6905aa3 commit f36aa79
Show file tree
Hide file tree
Showing 13 changed files with 126,771 additions and 127,375 deletions.
4 changes: 2 additions & 2 deletions src/algorithms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ impl EGraph {
for (eclass, nodes) in eclass_to_nodes {
if nodes.len() == 1
&& nodes[0].1.children.is_empty()
&& !self.root_eclasses.contains(&eclass)
{
leaves.push((eclass, nodes[0].0.clone()));
leave_to_op.insert(nodes[0].0.clone(), nodes[0].1.op.clone());
}
}
// 3. Remove leaf nodes from egraph and class data
// 3. Remove leaf nodes from egraph, class data, and root eclasses
for (eclass, node_id) in &leaves {
self.nodes.remove(node_id);
self.class_data.remove(eclass);
self.root_eclasses.retain(|root| root != eclass);
}
// 4. Create mapping from all parents which are updated to the children which are inlined
let mut parents_to_children = std::collections::HashMap::new();
Expand Down
1,792 changes: 896 additions & 896 deletions tests-viz/diff_power_simple-inlined.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,290 changes: 1,146 additions & 1,144 deletions tests-viz/diff_power_simple.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,098 changes: 549 additions & 549 deletions tests-viz/lambda_if-inlined.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,362 changes: 682 additions & 680 deletions tests-viz/lambda_if.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85,955 changes: 42,874 additions & 43,081 deletions tests-viz/list_list_hard_test_ellisk_2019-02-15T11.26.41--bench005_it7-inlined.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
115,738 changes: 57,869 additions & 57,869 deletions tests-viz/list_list_hard_test_ellisk_2019-02-15T11.26.41--bench005_it7.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
304 changes: 152 additions & 152 deletions tests-viz/math_powers-inlined.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
594 changes: 297 additions & 297 deletions tests-viz/math_powers.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20,525 changes: 10,062 additions & 10,463 deletions ...ics_scientific_unsolved_4h_ellisk_2019-07-20T18.05.46--bench000_it0-inlined.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24,404 changes: 12,202 additions & 12,202 deletions ...viz/physics_scientific_unsolved_4h_ellisk_2019-07-20T18.05.46--bench000_it0.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 20 additions & 20 deletions tests-viz/tiny-inlined.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 20 additions & 20 deletions tests-viz/tiny.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f36aa79

Please sign in to comment.