Question: why assuming keeps assumptions on variables after command finishes?

I was debugging another Maple problem and found this.

According to help, it says

Computations performed using assuming do not affect computations performed before or after calling assuming.

But this example below shows this is not the case at all.

I used hasassumptions(y(x)); before calling a command that uses assuming, and it gave false as expected since there are no assumption put on y(x).

After the command is complete, now I find that  hasassumptions(y(x)); returns true  which is wrong. 

This only happens when adding Physics:-Setup('assumingusesAssume'=true); and also when the command that uses assuming timesout.

But from help, this should not cause this. Here is the help on this

assumingusesAssume
  true or false.

The default for this option is true, so that, when Physics is loaded, the Maple assuming command uses Physics:-Assume to place temporary assumptions. This makes the assuming command fully compatible with the Physics, DifferentialGeometry, DifferentialAlgebra and VectorCalculus packages. It is recommended to not change this setting. If assumingusesAssume is set to false, temporary assumptions placed by assuming are placed using the assume command, which redefines the variables receiving assumptions, so that, depending on the computation, the commands of these packages mentioned will fail in recognizing them within expressions (for example: when placing assumptions on the coordinates and computing with the spacetime metric).

Could someone please explain in very simple terms (as I find all this very confusing), why that after calling a command which uses assuming, I find my variables have assumption still attached to them? 

Because of this, commands that uses these variables after this will and could fail depending on what command is used.

This explains many of the problems I am seeing when using assuming command.  

My question is simple: Should any variable which did not have assumptions on it, still not have assumptions on it after using assuming regadless if the command that uses assuming timedout or not?

Notice that I am not even using the Physics package explicitly anywhere in the following. I am just called odetest with timeout.

Here is worksheet to illustrate this.

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1873 and is the same as the version installed in this computer, created 2025, May 18, 21:44 hours Pacific Time.`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 23 and is the same as the version installed in this computer, created June 2, 2025, 12:08 hours Eastern Time.`

restart

 

#this shows no assumptions on y(x);
ode:=y(x)*sqrt(1 + diff(y(x), x)^2) - a*y(x)*diff(y(x), x) - a*x = 0:
sol:=-_C4^2 + (-y(x)*sqrt(_C4^2/y(x)^2) + a*x)^2/a^2 + y(x)^2 = 0;
hasassumptions(y(x));
getassumptions(y(x));

-_C4^2+(-y(x)*(_C4^2/y(x)^2)^(1/2)+a*x)^2/a^2+y(x)^2 = 0

false

{}

#now use a command that uses assuming
Physics:-Setup('assumingusesAssume'=true):
timelimit(10,(odetest(sol,ode,y(x)) assuming integer)):

Error, (in simplify/sqrt/local) time expired

 

#this shows that y(x) has assumptions still stuck on it.

hasassumptions(y(x));
getassumptions(y(x));

true

{a::integer, x::integer, (-(-csgn(1/y(x))*a*x+(y(x)^2*a^4+csgn(1/y(x))^2*a^2*x^2+a^4*x^2-y(x)^2*a^2-a^2*x^2)^(1/2))/(a^2-1)+x)::0, ((csgn(1/y(x))*a*x-(y(x)^2*a^4+csgn(1/y(x))^2*a^2*x^2+a^4*x^2-y(x)^2*a^2-a^2*x^2)^(1/2))/(a^2-1)-x)::0, ((csgn(1/y(x))*a*x+(y(x)^2*a^4+csgn(1/y(x))^2*a^2*x^2+a^4*x^2-y(x)^2*a^2-a^2*x^2)^(1/2))/(a^2-1)-x)::0, ((csgn(1/y(x))*a*x+(y(x)^2*a^4+csgn(1/y(x))^2*a^2*x^2+a^4*x^2-y(x)^2*a^2-a^2*x^2)^(1/2))/(a^2-1)+x)::0}

 

 

Download why_variable_have_assumption_june_3_2025.mw

My quess is this: Because the command that uses assuming timedout, Maple failed to remove/clear any temporary assumptions it added to the variables involved.   But this only happens when using Physics:-Setup('assumingusesAssume'=true):

If the command did not timeout, this does not happen. At least on some examples I tried this on.

Please Wait...