Open jmbrod opened 4 months ago
For your 3rd example, both v4.3.1
and v5.0.0-beta.1-19-g6531a25
gave me the unsubstituted answer, + x^2
.
Anyway, x?^y?
and (x?)^y?
are completely different objects. The former is an integer power of some symbol (note that x
and y
are declared as symbols). The latter is equivalent to exp_(x?,y?)
(you can see this by turning on the codes
switch, namely On codes;
and comparing what is printed for the left-hand side with id (x?)^y? = ...
and id exp_(x?,y?) = ...
), meaning an arbitrary power of some subexpression. This matches with, for example, (1+x)^(1+y)
but doesn't for x^2
.
Thanks, I was not aware of this!
(And indeed, my 3rd example gives the unsubstituted answer, it was my mistake.)
Hi, another quick question of no urgency. Just came across this behaviour:
yields
+ fun(x^2)
as expected, while enclosing the symbol in brackets within the substitution rule leaves it unsubstituted:yields
+ x^2
. Removing the restriction to the set in the exponent, it does get substituted:gives
+ fun(x^2)
. I was just wondering about the reason, because it seems that including the brackets, though of course not necessary, is not wrong?Thanks,
Joachim