Implementations are expected to be functional (no in-place mutation of the receiver): each update returns a new Metadata value reflecting the post-update EGraph state.
The parallelize strategy passed to onAddMany can be used to parallelize per-element work. Implementations treat it as an optional accelerator: correctness must not depend on parallel execution.
Type parameters
MetadataT
The internal payload/type carried by this metadata instance (e.g., summaries, indices).
NodeT
The e-graph node payload type (your IR node type).
Incorporate a batch of newly-added e-nodes into the metadata.
Incorporate a batch of newly-added e-nodes into the metadata.
Each element of added is the concrete node together with the destination e-class (an EClassCall). The after graph is the post-insertion e-graph where all added nodes already exist.
Incorporate a batch of e-class unions into the metadata.
Incorporate a batch of e-class unions into the metadata.
equivalences is a set of equivalence groups, where each inner set represents the e-classes that were merged together during this step (i.e., they now refer to a single canonical class in after). Groups are disjoint; taken together they summarize this union batch.
The after graph is the post-union e-graph: all classes inside each group are already merged.