# Egglog

Type: Programming language

Egglog is a language and reasoning system presented at PLDI in 2023. Its authors combined Datalog-style rules with equality saturation so that a program can infer facts and maintain equalities between expressions in one system.[1][2]

## Facts and equalities

A Datalog program draws new facts from existing facts by applying rules. Equality saturation records when expressions are interchangeable and retains equivalent representations for later reasoning. Egglog gives rules a way to work with both relational information and equivalence among terms. [1]

## Applications in the paper

The authors present examples involving program optimization and analysis. Keeping the associated equalities in the same reasoning system makes it possible for a rule to use what has been learned about equivalent expressions. The project publishes the implementation and examples in its repository. [1][2]

## Related articles

- [Datalog](/wiki/datalog/) (extends)

## References

1. [Better Together: Unifying Datalog and Equality Saturation](https://arxiv.org/abs/2304.04332)
2. [Egglog · Project repository](https://github.com/egraphs-good/egglog)
