I do not understand why this would not be legal.
According to this comment:
a = a->imbue(std::move(a), op, std::move(b));
It looks like you want to use a consumption operation. That is, the function consumes its inputs (ownership is transferred to the function, and they are deleted upon exit), which happens.
One of the objects to be deleted is the one on which you call the member function, but although it seems that it can be difficult, this is certainly normal, because the object is still guaranteed to live during the call.
You are returning an object (presumably moving, since it is unique_ptr again), which is reassigned to the original name. Therefore, instead of c = a->imbue(a, op, b) it is a = a->imbue(a, op, b) .
Well, why not. This, by the way, is the same name, similar to the one you just deleted, but what exactly. The object is valid, and there is nothing that could reassign something else to the name. You reassign something else to the name when you write x = x + 1; and no one would mind it.
Something you may ultimately want to avoid (obvious, but maybe not so obvious?) imbue with the same Expression object in both places.