[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiomdeveloper] [#191 exquo and therefore gcd cannot handle UP(x, EXPR
From: 
wyscc 
Subject: 
[Axiomdeveloper] [#191 exquo and therefore gcd cannot handle UP(x, EXPR INT)] 
Date: 
Wed, 13 Jul 2005 11:43:35 0500 
Changes
http://page.axiomdeveloper.org/zope/mathaction/191ExquoAndThereforeGcdCannotHandleUPXEXPRINT/diff

??changed:
 In EXPR INT, $2^a$ and $2^(2a)$ are treated as two variables
In EXPR INT, $2^a$ and $2^{(2a)}$ are treated as two variables
??changed:
Thus, in our case, at one point p1 is $4^a2^(2a)$, which is zero
Thus, in our case, at one point p1 is $4^a2^{(2a)}$, which is zero
??changed:
From wyscc Mon Jul 11 18:08:28 0500 2005
From: wyscc
Date: Mon, 11 Jul 2005 18:08:28 0500
Subject: Step by step works
MessageID: <address@hidden>
>From billpage Wed Jul 13 00:47:27 0500 2005
From: billpage
Date: Wed, 13 Jul 2005 00:47:27 0500
Subject: $2^{{a2}}$ vs $4^a$
MessageID: <address@hidden>
The problem seems to be that Axiom does not always treat $2^{a2}$
the same as $4^a$.
??changed:
q:dom:=(x2^a)*(x+2^a)
q:=(x2^a)*(x+2^a)
qq:= simplify(q)
r:= q::dom
rr:= qq::dom
++added:
gcd(p,r)
gcd(p,qq)
gcd(p,rr)
q  qq
simplify q  qq
simplify ((r  rr)::EXPR INT)
t:Boolean:=(r = rr)
??changed:
But note:
\begin{axiom}
simplify(q::EXPR INT)
\end{axiom}

From wyscc Mon Jul 11 19:39:36 0500 2005
From: wyscc
Date: Mon, 11 Jul 2005 19:39:36 0500
Subject: Conclusion
MessageID: <address@hidden>

When done in step by step, Axiom does coerce 'r' correctly to what a normal
user would expect. So the question is: why would it make a difference when
everything is put on one line?

My guess is that when the command is in one line, the arguments are evaluated
first (supported by the sequence displayed with ')set mess bot on' ) and the
coercion is done without the benefit of knowledge that 'gcd' is to be involved.
Without this, the coercion from 'EXPR INT' to 'UP(x,EXPR INT)' is one from the
[5 more lines...]
Comments from wyscc:
Martin wrote:
> I'm afraid that this cannot be fixed easily, since there is no
> general mechanism to determine whether an expression is zero or not,
> which is needed in exquo.
Your analysis seems to be the correct diagnosis. The problem has nothing to do
with 'gcd' or 'exquo', but with the fact that simplification is an art as there
is no canonical form for expressions and hence no way to test equality (which
is in general *different* from testing zero, a special case needed for
'exquo'). More frequent use of simplification will help but will not eliminate
the problem. Here, it is because the expressions $4^a$ and $2^{2a}$ are not
handled by an automatic simplification in 'UP(x, R)' (that is, not pushed down
to the level of 'R').
??changed:
From billpage Wed Jul 13 00:47:27 0500 2005
From: billpage
Date: Wed, 13 Jul 2005 00:47:27 0500
Subject: $2^{a2}$ vs $4^a$
MessageID: <address@hidden>

Notice the result of the simplification:
\begin{axiom}
p:=(x2^a)::UP(x, EXPR INT)
q:=simplify((x2^a)*(x+2^a))::UP(x, EXPR INT)
gcd(p, q)
\end{axiom}
Without the simplification:
\begin{axiom}
r:=((x2^a)*(x+2^a))::UP(x, EXPR INT)
gcd(p, r)
\end{axiom}
The problem seems to be that Axiom does not always treat $2^{a2}$
the same as $4^a$.

forwarded from http://page.axiomdeveloper.org/zope/mathaction/address@hidden