[wip] 8413 and 8373 related changes

See #8413 and #8373 

- [ ] check coverage, especially the handling of duplicate args by Xor and Equivalent

(If anybody would like to take this over, that would be fine with me.)
No.  Probably, you should start from testing `a.func` and `b.func`.  If they are equal - you can test (a.lhs - b.lhs).equals(0) and so on.