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

Method add_equiv

crates/kernel/src/equiv.rs:132–136  ·  view source on GitHub ↗

Record that two composite keys are definitionally equal. Kept by-value because `node_for_key` inserts the key into the internal `key_to_node` map on first observation, requiring ownership transfer. Callers that have already consumed their `EqKey`s should clone at the call site, not here.

(&mut self, k1: EqKey, k2: EqKey)

Source from the content-addressed store, hash-verified

130 true
131 }
132
133 /// Check if two composite keys are equivalent.
134 ///
135 /// Takes keys by reference — callers in the `is_def_eq` hot path
136 /// already hold `EqKey` tuples as local bindings, and forcing them to
137 /// pass by value would require an Arc-clone on each component. With
138 /// by-ref we avoid that clone entirely (see `src/ix/kernel/def_eq.rs`
139 /// for the caller pattern).

Callers 4

is_def_eqMethod · 0.80
test_basic_equivFunction · 0.80
test_transitivityFunction · 0.80
test_context_isolationFunction · 0.80

Calls 2

node_for_keyMethod · 0.80
unionMethod · 0.80

Tested by 3

test_basic_equivFunction · 0.64
test_transitivityFunction · 0.64
test_context_isolationFunction · 0.64