Question: how to do this patmatch

I want to match   a*x^b only if "a" and "b" are both not the symbol "y"

Therefore 5*x^y should fail to match, but this below matches.

restart;
expr:=5*x^y;
if patmatch(expr,conditional(a::anything*x^(b::anything),(a<>y and b<>y)),'la') then
   print("it matched, why??");
   map(assign,la):
   print("a = ",a, " b=",b);
fi;

it gives

                      "it matched, why??"
                      "a = ", 5, " b=", y

What did I do wrong? is my conditional wrong above?

 

Please Wait...