egglog 2.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 Math Math)
  (Num i64))
  
(let $zero (Num 0))


;; $zero here refers to the function/constant zero, not a free variable
(rewrite (Add $zero x) x)

(let $a (Add (Num 0) (Num 3)))
(let $b (Add (Num 7) (Num 9)))
(let $c (Num 16))
(union $b $c)

;; crash if we merge two numbers
(rule (
 (= (Num x) (Num y))
 (!= x y)
)(
 (panic "ahhh")
))
      
      
(run 10)