<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
an	O
e-graph	B-Data_Structure
is	O
a	O
data	B-General_Concept
structure	I-General_Concept
that	O
stores	O
an	O
equivalence	O
relation	O
over	O
terms	O
of	O
some	O
language	O
.	O
</s>
<s>
An	O
e-graph	B-Data_Structure
contains	O
a	O
union-find	B-Algorithm
structure	O
over	O
e-class	O
IDs	O
with	O
standard	O
operations	O
,	O
,	O
and	O
.	O
</s>
<s>
An	O
e-graph	B-Data_Structure
is	O
the	O
combination	O
of	O
:	O
</s>
<s>
the	O
union-find	B-Algorithm
structure	O
,	O
</s>
<s>
a	O
hashcons	B-Application
(	O
i.e.	O
</s>
<s>
In	O
addition	O
to	O
the	O
above	O
structure	O
,	O
a	O
valid	O
e-graph	B-Data_Structure
conforms	O
to	O
several	O
data	B-General_Concept
structure	I-General_Concept
invariants	O
.	O
</s>
<s>
The	O
congruence	O
invariant	O
states	O
that	O
an	O
e-graph	B-Data_Structure
must	O
ensure	O
that	O
equivalence	O
is	O
closed	O
under	O
congruence	O
,	O
where	O
two	O
e-nodes	O
are	O
congruent	O
when	O
.	O
</s>
<s>
The	O
hashcons	B-Application
invariant	O
states	O
that	O
the	O
hashcons	B-Application
maps	O
canonical	O
e-nodes	O
to	O
their	O
e-class	O
ID	O
.	O
</s>
<s>
E-graphs	B-Data_Structure
expose	O
wrappers	O
around	O
the	O
,	O
,	O
and	O
operations	O
from	O
the	O
union-find	B-Algorithm
that	O
preserve	O
the	O
e-graph	B-Data_Structure
invariants	O
.	O
</s>
<s>
An	O
e-graph	B-Data_Structure
represents	O
a	O
ground	O
term	O
if	O
one	O
of	O
its	O
e-classes	O
represents	O
.	O
</s>
<s>
e-matching	O
is	O
an	O
operation	O
that	O
takes	O
a	O
pattern	O
and	O
an	O
e-graph	B-Data_Structure
,	O
and	O
yields	O
all	O
pairs	O
where	O
is	O
a	O
substitution	O
mapping	O
the	O
variables	O
in	O
to	O
e-class	O
IDs	O
and	O
is	O
an	O
e-class	O
ID	O
such	O
that	O
each	O
term	O
is	O
represented	O
by	O
.	O
</s>
<s>
Equality	O
saturation	O
is	O
a	O
technique	O
for	O
building	O
optimizing	B-Application
compilers	I-Application
using	O
e-graphs	B-Data_Structure
.	O
</s>
<s>
It	O
operates	O
by	O
applying	O
a	O
set	O
of	O
rewrites	O
using	O
e-matching	O
until	O
the	O
e-graph	B-Data_Structure
is	O
saturated	O
,	O
a	O
timeout	O
is	O
reached	O
,	O
an	O
e-graph	B-Data_Structure
size	O
limit	O
is	O
reached	O
,	O
a	O
fixed	O
number	O
of	O
iterations	O
is	O
exceeded	O
,	O
or	O
some	O
other	O
halting	O
condition	O
is	O
reached	O
.	O
</s>
<s>
After	O
rewriting	O
,	O
an	O
optimal	O
term	O
is	O
extracted	O
from	O
the	O
e-graph	B-Data_Structure
according	O
to	O
some	O
cost	O
function	O
,	O
usually	O
related	O
to	O
AST	B-Data_Structure
size	O
or	O
performance	O
considerations	O
.	O
</s>
<s>
E-graphs	B-Data_Structure
are	O
used	O
in	O
automated	B-Application
theorem	I-Application
proving	I-Application
.	O
</s>
<s>
They	O
are	O
a	O
crucial	O
part	O
of	O
modern	O
SMT	B-Application
solvers	I-Application
such	O
as	O
Z3	B-Language
and	O
CVC4	O
.	O
</s>
<s>
They	O
are	O
also	O
used	O
in	O
the	O
Simplify	O
theorem	O
prover	O
of	O
ESC/Java	B-Application
.	O
</s>
<s>
Equality	O
saturation	O
is	O
used	O
in	O
specialized	O
optimizing	B-Application
compilers	I-Application
,	O
e.g.	O
</s>
<s>
for	O
deep	B-Algorithm
learning	I-Algorithm
and	O
linear	B-Language
algebra	I-Language
.	O
</s>
<s>
Equality	O
saturation	O
has	O
also	O
been	O
used	O
for	O
translation	O
validation	O
applied	O
to	O
the	O
LLVM	B-Application
toolchain	O
.	O
</s>
<s>
E-graphs	B-Data_Structure
have	O
been	O
applied	O
to	O
several	O
problems	O
in	O
program	O
analysis	O
,	O
including	O
fuzzing	O
,	O
abstract	O
interpretation	O
,	O
and	O
library	O
learning	O
.	O
</s>
