egglog 3.0.0

egglog is a language that combines the benefits of equality saturation and datalog. It can be used for analysis, optimization, and synthesis of programs. It is the successor to the popular rust library egg.
Documentation

(datatype Math
  (Add i64 i64)
  (Num i64))

;; Commutativity
(rule ((Add a b)) ((union (Add a b) (Add b a))) :name "rw1")

;; Constant folding with an extra condition, forcing commute first
(rule ((Add a b)
       (> a b))
      ((union (Add a b) (Num (+ a b)))) :name "rw2")

;; 2 + 3
(let start (Add 2 3))

(run 2)

;; 2 + 3 = 5 by
;; 2 + 3 = 3 + 2 (commute)
;; 3 + 2 = 5 (constant fold)
(prove (= (Add 2 3) (Num 5)))