# comb will return all combinations of three element in the input. # this algorithm deals with all different cases: a=b=c or two of them equal and they aren't equal to each other. comb:=proc(a,b,c) local i,j,k, A; A:={}; if nops({a,b,c})=1 then return {[a,b,c]} fi; if nops({a,b,c})=2 then if a=b then return {[a,b,c],[a,c,b],[c,a,b]} elif a=c then return {[a,b,c],[a,c,b],[b,a,c]} else return {[a,b,c],[b,a,c],[b,c,a]} fi fi; for i in {a,b,c} do for j in {a,b,c} minus {i} do for k in {a,b,c} minus {i,j} do A:=A union {[i,j,k]}; od; od; od; A; end: # ei are generalized exponents of the given operator L # fi are generalized exponents of the operator Lc~F1(a,b1,b2,c,u,v) MatchExp1:=proc(e1,e2,e3,f1,f2,f3) #options trace; local d,A,d1,d2,C,i,s,j,k,n,ind,neweq; A:={}; d1:=e2-e1; d2:=e3-e2; #d3:=e3-e1; # take differences C:=comb(f1,f2,f3); # include 6 cases for i in C do s:={i[2]-i[1]=d1,i[3]-i[2]=d2}; A:=A union {s}; od; for i in A do if solve(i)=NULL then A:=A minus {i}; fi; od; A; end: