Get or create a node index for a composite key.
(&mut self, key: EqKey)
| 51 | && left.expr_lbr.max(right.expr_lbr) == lbr |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | /// Union-find structure for tracking definitional equality between |
| 56 | /// context-aware expression keys. |
| 57 | #[derive(Debug, Clone)] |
| 58 | pub struct EquivManager { |
| 59 | /// Map from composite key to union-find node index. |
| 60 | key_to_node: FxHashMap<EqKey, usize>, |
| 61 | /// `parent[i]` = parent of node `i`. Root if `parent[i] == i`. |
| 62 | parent: Vec<usize>, |
| 63 | /// `rank[i]` = upper bound on height of subtree rooted at `i`. |
| 64 | rank: Vec<usize>, |
| 65 | /// Reverse map: node index → composite key. |
| 66 | node_to_key: Vec<EqKey>, |