# Pattern matching on Orderless functions

I'm trying the following pattern matching command:

ReplaceList[Hold[b + a], Hold[x___ + y___] -> {{x}, {y}}]


And Mathematica returns:

{{{}, {b, a}}, {{b}, {a}}, {{a}, {b}}, {{b, a}, {}}}


Can someone help me to understand why {{}, {a, b}} and {{a, b}, {}} don't belong to the solution?

As Plus head has Orderless attribute, the pattern matcher should try all permutations (and this explains why {{}, {a, b}} belongs to the solution). Where am I wrong?

• Orderless means {a, b} and {b, a} are equivalent. They are (probably) considered identical in pattern matching to reduce combinatorial explosion of cases. – Michael E2 Dec 8 '18 at 12:03
Orderless means {a, b} and {b, a} are equivalent. They are (probably) considered identical in pattern matching to reduce combinatorial explosion of cases. So in terms of ReplaceList applying the replacement in "all possible ways", {a, b} and {b, a} are considered the same and only one result is returned in the list.