Question: why select(has,-a^2,x); returns 1?

I do not understand why select(has,-a^2,x); returns 1 but select(has,a^2,x); returned undefined.

Should not both return undefined, since there is no anywhere in the expression?

I looked at help and do not see a clue so far.

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1849 and is the same as the version installed in this computer, created 2025, March 12, 12:37 hours Pacific Time.`

restart;

C:=a^2;
select(has,C,x);

a^2

undefined

C:=-a^2;
select(has,C,x);

-a^2

1

 

 

Download select_question_march_23_2025.mw

Here is another variation, where I changed a^2 to a

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1849 and is the same as the version installed in this computer, created 2025, March 12, 12:37 hours Pacific Time.`

restart;

C:=a;
r:=select(has,C,x);

a

C:=-a;
r:=select(has,C,x);

-a

1

 

 

Download select_question_v2_march_23_2025.mw

The good thing is that has(C,x) returns false in both case. So the problem is not with the has call. It is select which decided to return 1 when there is negative sign. But why?

restart;

C:=a;
r:=has(C,x);

a

false

C:=-a;
r:=has(C,x);

-a

false

 

 

Download select_question_v3_march_23_2025.mw

Please Wait...