Question: how to get the integers indicating positions of a specific operand in an expression?


for example, there is an expression exp1=(a+b)*(a+c),  I want to find all the position in DAG of a specific operand, such as 'a' ; also I want to find the position in the DAG of  sub-expression which type is '+' .
 is there any function in maple which can return the  integers indicating position of an operand or type in an expression? i.e. with this function, assume its name is 'find',then
find(exp1, a) will return  [1,1],[2,1];
find(exp1,'+') will return  [1,0],[2,0];

Please Wait...