I have recently discovered term rewriting when I watched this video - https://channel9.msdn.com/Series/Beckman-Meijer-Overdrive/Beckman-Meijer-Overdrive-The-Lambda-Calculus-and-Food-Nutrition
It seems that term rewriting is a generalization of which lambda calculus is an instance. A couple of the programming languages that are based on term rewriting that I've noticed are 'pure', and the wolfram language.
Now, it seems to me that the only examples of the usefulness of a TR programming language I've ever seen are in symbolic programming.
I'm interested in using TR to make an automatic inverse function creator.
You would have a few concrete rules like:
incr x = x + 1
decr x = x - 1
inverse incr = decr
Then you would have a rule that handles compositions of functions:
inverse (f(g x)) = inverse g (inverse f x) // Probably not true; it's just an example.
I think TR would be useful in doing this because it gives access to the internals of a function. However, a normal functional language that does this would work as well.
I'm guessing that TR is more than just useful for symbolic computing or inspecting function internals. What's the "big picture" of TR, and would it be good to use for general programming?
Also, do the 'pure' and wolfram languages use full TR, or do they use a specialized form (perhaps to avoid things like non-confluence, whatever that may be)?