Но это для совсем простых вещей. Даже по ссылке выше автор сделал простую систему переписывания:
"We can have a small set of simple local rewrite rules. Local meaning, we don't need to look around, only at one subexpression at the time.
Then we try to match the rule everywhere, and if it match, perform the rewrite.
And loop until there's nothing to do."