Papers
Topics
Authors
Recent
Search
2000 character limit reached

Lifting E-Graphs: A Function Isn't a Constant

Published 22 Jun 2026 in cs.PL | (2606.22734v1)

Abstract: Variables are quite subtle and easy to get wrong. An approach is described to support rigid $α$ canonical variables in an e-graph. The lifting e-graph has a baked-in notion of functional lifting combinator. It is implemented by fattening the usual integer identifiers with thinning bitvectors, lift-pulling smart constructors, and a special thinning-aware union find variation. The approach is inspired by slotted e-graphs and Co-de Bruijn syntax.

Authors (1)

Summary

  • The paper presents a novel context-aware variable representation that disambiguates function applications using nameless variables with explicit dimension tracking.
  • It details the use of functional lifting combinators and thinning-aware union-find algorithms to enhance syntactic sharing and efficient equality saturation.
  • The method integrates fat identifiers and smart constructors in e-graphs, ensuring maximal sharing and robust handling of context-sensitive expressions.

Formal Summary of "Lifting E-Graphs: A Function Isn't a Constant" (2606.22734)

Motivation and Problem Analysis

The paper addresses a fundamental flaw in traditional e-graphs with respect to variable representation, highlighting the subtlety and complexity of variables in symbolic program manipulation, particularly in the context of equality saturation. Conventional approaches employ named variables, but these suffer from spurious term proliferation, unclear scope hygiene, missed memory sharing opportunities, and ambiguity in semantic entities linked to function application. The central claim is that function application identities are conflated without explicit context; the context (e.g., xsin(x)x \mapsto \sin(x) vs x,ysin(x)x, y \mapsto \sin(x)) is an inseparable aspect of the term and must not be suppressed.

Nameless and Dimensioned Representation

The paper proposes an alternate representation rooted in nameless variables indexed by context size—mirroring de Bruijn indices but augmented with explicit dimension tracking. Rather than generic variable names, variables are indexed as (dimension,index)(\text{dimension}, \text{index}). Functions are similarly indexed by context, producing disambiguated versions (sin0\text{sin}_0, sin1\text{sin}_1, etc.), thus enforcing well-typedness and eliminating ill-typed equality comparisons across different arities. This improves syntactic sharing for expressions like xf(g(h(x)))x \mapsto f(g(h(x))) regardless of superficial variable names, but at the cost of losing sharing across terms with differing arities/dimensions.

Functional Lifting and Thinning

To reconcile context discrepancies and increase sharing, the work introduces functional lifting combinators parameterized by "thinnings"—bitvectors specifying which arguments are retained when transitioning between contexts of differing dimensions. Lifting allows one to represent, for instance, xsin(x)x \mapsto \sin(x) in a higher-dimensional context by dropping irrelevant arguments via thinning. Thinnings are compositional, forming a category, and can be efficiently represented as bitvectors. The paper provides formalization and algorithms for their composition, domain/codomain computation, and identity. Lifting possesses equational properties, most notably parametric polymorphism (push/pull rules), enabling systematic normalization of terms and efficient reasoning across context-bound expressions.

Integration with E-Graphs: Fat Identifiers and Lift-Pulling Constructors

The architecture is reified via "fat identifiers"—pairs of (thinning, integer ID)—enabling ephemeral, context-sensitive term referencing in the e-graph. E-nodes reference fat IDs as children, systematically normalizing by "pulling up" lifts via smart constructors: when a node is constructed with arguments that are lifted more than necessary, the constructor extracts and interns the minimal version, then re-applies the common lift. This design underpins efficient hash-consing, ensures maximal sharing, and aligns with co-de Bruijn normalization of lambda terms. Notably, minimal thinnings facilitate a semantic-free-variable analysis, as dependency reductions in equality saturation are directly reflected in the context representation.

Thinning-Aware Union-Find

Generalizing classic union-find, the paper introduces thinning-aware union-find algorithms. This construction supports the semantic requirements of lifted equivalence, permitting unions that peel off common thinnings and unite base terms when liftings are congruent. It expands on offset, monus, and factor-based union-finds, demonstrating the necessary augmentation for context-sensitive term equality. The union operation is only valid for terms in matching dimensions, enforcing soundness.

Critical cases are discussed, such as x0=0x * 0 = 0, where bidirectional equality introduces variable redundancy, handled through forced orientation and make-set parent generation. The algorithmic union for irreconcilable liftings produces a fresh identifier, ensuring both sides are solvable to a common term.

E-Matching and Rewrite Complexity

E-matching within the lifting e-graph occurs via thinning composition as rules are traversed. The push/pull formalism justifies movement of liftings through function application; matches may fail when redundant variable expressions are encountered. If matching redundancy is desired, the solution involves solving for thinnings with potentially multiple answers—a space analogous to non-deterministic matching in standard named representations.

The methodology elaborated is inspired by slotted e-graphs, co de-Bruijn notation, type theory semantics, and explicit weakening calculi. The relation to alpha-equivalence hashing and previous approaches in e-graphs reflects ongoing evolution towards canonical, highly-compact, context-sensitive representations. The work advances prior e-graph designs by prioritizing ordered slots and sparse thinning representations, shifting away from purely permutative renaming.

Implications and Prospects

Practically, the lifting e-graph model enables more efficient symbolic program manipulation in equality saturation engines, increasing sharing, reducing redundancy, and offering a principled variable framework suitable for type theory, lambda calculus, and higher-order rewriting. Theoretically, it provides a robust foundation for context-aware reasoning and explicit free-variable analysis, with extensibility towards binders and higher-order projection functions.

Looking forward, the notion of thinning union-find may generalize further, building richer frameworks for annotated edge reasoning beyond group axioms. The connection to internalizable proof structures in type theory positions e-graphs as versatile instruments for mechanized mathematics and formal programming language semantics.

Conclusion

"Lifting E-Graphs: A Function Isn't a Constant" (2606.22734) advances e-graph machinery by formally integrating context-aware variable representation using functional lifting and thinning combinators. The resultant architecture achieves canonical, maximal sharing and efficient manipulation of symbolic expressions under context-sensitive equality. The implications are far-reaching for program optimization, type theory applications, and the scalable design of symbolic engines.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 1 tweet with 12 likes about this paper.

HackerNews