If I substitute 'tr' into '\int', for example,
\nabla{#}::Derivative.
{A,B,C}::Depends(\nabla{#}).
tr{#}::Trace.
ex:=tr{A} tr{B\nabla{C}};
substitute(_,$tr{A??}->\int{A??}$);
Is there possible to find a more direct solution of this question? As you know, sometimes it is very tedious to do this all "by hand" with the substitute, because the actual situation may be very complicated.