MCPcopy Create free account
hub / github.com/argumentcomputer/ix / node_for_key

Method node_for_key

crates/kernel/src/equiv.rs:53–63  ·  view source on GitHub ↗

Get or create a node index for a composite key.

(&mut self, key: EqKey)

Source from the content-addressed store, hash-verified

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)]
58pub 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>,

Callers 1

add_equivMethod · 0.80

Calls 4

pushMethod · 0.80
getMethod · 0.45
lenMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected