Skip to content

Commit

Permalink
move subsume directly to serialized node
Browse files Browse the repository at this point in the history
  • Loading branch information
saulshanabrook committed Sep 11, 2024
1 parent b3eaf72 commit 9f0997c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ smallvec = "1.11"

generic_symbolic_expressions = "5.0.4"

egraph-serialize = { git = "https://github.com/egraphs-good/egraph-serialize", rev = "325f7c6b4b909752ee0f57f9619f698a52cc343e", features = [
egraph-serialize = { git = "https://github.com/egraphs-good/egraph-serialize", rev = "fdfbbcae20a21098ad6484c0b9da44314016b4f7", features = [
"serde",
"graphviz",
] }
Expand Down
9 changes: 3 additions & 6 deletions src/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,7 @@ impl EGraph {
eclass: class_id.clone(),
cost: NotNan::new(decl.cost.unwrap_or(1) as f64).unwrap(),
children,
data: egraph_serialize::NodeData {
subsumed: output.subsumed,
},
subsumed: output.subsumed,
},
);
}
Expand Down Expand Up @@ -264,7 +262,7 @@ impl EGraph {
eclass: class_id.clone(),
cost: NotNan::new(f64::INFINITY).unwrap(),
children: vec![],
data: egraph_serialize::NodeData { subsumed: false },
subsumed: false,
},
);
VecDeque::from(vec![node_id])
Expand Down Expand Up @@ -296,8 +294,7 @@ impl EGraph {
eclass: class_id.clone(),
cost: NotNan::new(1.0).unwrap(),
children,
// primitives can never be subsumed
data: egraph_serialize::NodeData { subsumed: false },
subsumed: false,
},
);
};
Expand Down

0 comments on commit 9f0997c

Please sign in to comment.