axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] [#122 Handling of power series] PATCH: Temporary hack


From: unknown
Subject: [Axiom-developer] [#122 Handling of power series] PATCH: Temporary hack
Date: Fri, 25 Mar 2005 10:47:57 -0600

Changes 
http://page.axiom-developer.org/zope/mathaction/122HandlingOfPowerSeries/diff
--
In axiom the cercion of power series is really strange:
  . ExpressionToUnivariatePowerSeries (function: series,taylor,laurent...) 
return Any type. 
  . When this Any type is printed, the series is coerced. For example to 
UnivariatePuiseuxSeries.
  . This process of coercion is strange.
I will give some hint to understand this. First here is the actions that you 
have to do for a better understanding of this bug.
Here the interpreter has to coerce the series (EXPR (INT OR OTHER)), the 
variable  and the expansion point in type.
In Axiom trace all these functions: P2Uls P2Upxs P2Uts Expr2Up NDmp2domain 
Var2OtherPS Var2QF P2Us canCoerceLocal coerceIntTableOrFunction coerceIntTower 
canCoerce1 canCoerceTower canCoerce canCoerceFrom resolveTT1 resolveTTSpecial 
(you can had HasCate hasCaty hasCaty1 hasCate1 if you want to better understand
ofCategory bug (not parameterized ?)
<pre>
)tr P2Uls 
)tr P2Upxs 
)tr P2Uts 
)tr Expr2Up 
)tr NDmp2domain
)tr Var2OtherPS
)tr Var2QF
)tr P2Us
)tr canCoerceLocal
)tr coerceIntTableOrFunction
)tr coerceIntTower
)tr canCoerce1
)tr canCoerceTower
)tr canCoerce
)tr canCoerceFrom
)tr resolveTT1
)tr coerceInt
)tr algEqual
)tr resolveTTSpecial
</pre>
Now you can create power series integer: 
<pre>
a:=series(sin(x))
</pre>
Beware axiom will crash.
Now type a*1.0, restart do the same and type 1.0*a.
You will see that axiom in this process do not coerce all type (for example 
sometimes 0.0 (expansion point) remain Integer but of type EXPR FLOAT).
<pre>
Normally:
x in type is of type Symbol
0.0 (expansion point is of type Expression (type of internal representation of 
the power series). For example: EXPR FLOAT.
</pre>
Now you can restart and create 2 power series, one with integer the other with 
float:
<pre>
a:=series(sin(x))
Coerce it (see above):
a:= a::UnivariatePuiseuxSeries(Expression Integer,x,0)
b:= a::UnivariatePuiseuxSeries(Expression Float,x,0.0)
</pre>
You can do a*b restart do the same and b*a. This process of coercion involve 
some strange type and axiom coerce sometimes to
UnivariatePuiseuxSeries(UnivariatePuiseuxSeries) etc ...
This and the expansion point not really coerced trigger bug.
In boot code there is a function resolveTTSpecial and its commentary:
<pre>
  -- tries to resolve things that would otherwise get mangled in the
  -- rest of the resolve world. I'll leave it for Albi to fix those
  -- things. (RSS 1/-86)
</pre>
In this patch I use this function to express the resolved type. It' a temporary 
hack and I'm not sure that this patch is correct (see the code).
Second, I add two other tests: I check the equality of the Symbol(s) and the 
two expansion points.
Test it, check it, enhance it.
  Regards


--
forwarded from http://page.axiom-developer.org/zope/mathaction/address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]