We should think carefully about where the second rule has to apply - it might be just applying the second rule to the replacement pattern of the first rule (not to the replacement subtree formed by substituting in parts of the actual Expression). Not sure if it's more complex than that.
From PR comment: consider defining
We should think carefully about where the second rule has to apply - it might be just applying the second rule to the replacement pattern of the first rule (not to the replacement subtree formed by substituting in parts of the actual Expression). Not sure if it's more complex than that.