Hacker News new | ask | show | jobs
by FnuGk 1422 days ago
Isnt that the building blocks of logic based programming languages like Prolog?
2 comments

Yes, at least these egg-based projects are usign this idea, but it looks like it's just one of the options:

https://souffle-lang.github.io/docs.html http://www.philipzucker.com/souffle-egg4/ https://arxiv.org/pdf/2004.03082.pdf

I had a similar thought when I learned about e-graphs. I'm not sure yet, but I think congruence closure is a slightly different problem from the one Prolog unification solves. In particular, if you tell an e-graph that `f(x) = g(y)`, it will take you at your word -- while Prolog would give a unification error. (An e-graph should also handle `X = f(X)`, while this would fail Prolog's admittedly often-ignored occurs check.)