Skip to content

Commit

Permalink
Expose egraph.nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
mwillsey committed Dec 17, 2024
1 parent 639ef3c commit 1458b82
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/egraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ impl<L: Language, N: Analysis<L>> EGraph<L, N> {
self.classes_by_op.get(&op).map(|s| s.iter().copied())
}

/// Exposes the actual nodes in the egraph.
///
/// Un-canonical id's can be used to index into this.
/// In normal circumstances, you should not need to use this.
pub fn nodes(&self) -> &[L] {
&self.nodes
}

/// Returns `true` if the egraph is empty
/// # Example
/// ```
Expand Down

0 comments on commit 1458b82

Please sign in to comment.