Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into multipattern-explain
Browse files Browse the repository at this point in the history
  • Loading branch information
eytans committed Apr 19, 2024
2 parents 8bcbc34 + 2f1514c commit 38ebcb6
Show file tree
Hide file tree
Showing 6 changed files with 262 additions and 223 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## [Unreleased] - ReleaseDate
- Change the API of `make` to have mutable access to the e-graph for some [advanced uses cases](https://github.com/egraphs-good/egg/pull/277).

- Fix an e-matching performance regression introduced in [this commit](https://github.com/egraphs-good/egg/commit/ae8af8815231e4aba1b78962f8c07ce837ee1c0e#diff-1d06da761111802c793c6e5ca704bfa0d6336d0becf87fddff02d81548a838ab).

## [0.9.5] - 2023-06-29
- Fixed a few edge cases in proof size optimization that caused egg to crash.
Expand Down
10 changes: 5 additions & 5 deletions src/eclass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ pub struct EClass<L, D> {
/// Modifying this field will _not_ cause changes to propagate through the e-graph.
/// Prefer [`EGraph::set_analysis_data`] instead.
pub data: D,
/// The parent enodes and their original Ids.
pub(crate) parents: Vec<(L, Id)>,
/// The original Ids of parent enodes.
pub(crate) parents: Vec<Id>,
}

impl<L, D> EClass<L, D> {
Expand All @@ -37,9 +37,9 @@ impl<L, D> EClass<L, D> {
self.nodes.iter()
}

/// Iterates over the parent enodes of this eclass.
pub fn parents(&self) -> impl ExactSizeIterator<Item = (&L, Id)> {
self.parents.iter().map(|(node, id)| (node, *id))
/// Iterates over the non-canonical ids of parent enodes of this eclass.
pub fn parents(&self) -> impl ExactSizeIterator<Item = Id> + '_ {
self.parents.iter().copied()
}
}

Expand Down
Loading

0 comments on commit 38ebcb6

Please sign in to comment.