Is there a way to compare two functions for equality? For example, (λx.2*x) == (λx.x+x)
should return true, because those are obviously equivalent.
It's pretty well-known that general function equality is undecidable in general, so you'll have to pick a subset of the problem that you're interested in. You might consider some of these partial solutions: