|
|
last edited 10 years ago by test1 |
1 2 3 4 | ||
Editor:
Time: 2007/11/17 21:56:34 GMT-8 |
||
Note: status change |
changed: - Original Date: Fri, 25 Mar 2005 10:47:55 -0600 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 involves probably some invalid type. I will give some hint to understand this. Here the interpreter has to coerce the series (EXPR (INT OR OTHER)), the variable and the expansion point. 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 ?) :: )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 Now you can create power series: a:=series(sin(x)) 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 does not coerce all types (for example sometimes 0 (expansion point) remain Integer but of type EXPR FLOAT). Normally:: x in displayed type is of type Symbol 0.0 (expansion point) has the same type as the coefficients of the power series. For example: EXPR FLOAT. Now you can restart and create 2 power series, one with integer the other with float:: a:=series(sin(x)) Coerce it (see above):: a:= a::UnivariatePuiseuxSeries(Expression Integer,x,0) b:= a::UnivariatePuiseuxSeries(Expression Float,x,0.0) You can type:: a*b restart do the same type:: 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:: -- 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) 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 (two different symbols crash axiom for example). Regards <a href="power-series.patch">power-series.patch</a> From unknown Fri Mar 25 11:03:14 -0600 2005 From: unknown Date: Fri, 25 Mar 2005 11:03:14 -0600 Subject: This result is cached Message-ID: <20050325110314-0600@page.axiom-developer.org> The previous patch change the resolved type. It's internally cached and resolveTTspecial is only invoked once. From unknown Fri Mar 25 11:08:50 -0600 2005 From: unknown Date: Fri, 25 Mar 2005 11:08:50 -0600 Subject: .axiom.input Message-ID: <20050325110850-0600@page.axiom-developer.org> After the above patch applied one bug remain: If you add this text to the file .axiom.input (interpreted at the start of axiom) you will crash axiom:: 1.0::UnivariatePuiseuxSeries(Expression Float,x,0.0 Regards From unknown Sun May 15 19:13:57 -0500 2005 From: unknown Date: Sun, 15 May 2005 19:13:57 -0500 Subject: Problem to patch Message-ID: <20050515191357-0500@page.axiom-developer.org> Here is another patch if you run into problem with a 'maformed patch 'message . <pre> Change to axiom directory: cat power-series.patch2 |patch -0 </pre> Cheers <a href="power-series.patch2">power-series.patch2</a> From unknown Sun May 22 09:22:00 -0500 2005 From: unknown Date: Sun, 22 May 2005 09:22:00 -0500 Subject: Crash with this patch Message-ID: <20050522092200-0500@page.axiom-developer.org> This patch doesn't check the equality of the expansion points and the symbols for different power series. </br> Example:: a:=series(sin(x)) b:=taylor(sin(x),x=2) a*b From unknown Sun May 22 11:44:57 -0500 2005 From: unknown Date: Sun, 22 May 2005 11:44:57 -0500 Subject: New patch Message-ID: <20050522114457-0500@page.axiom-developer.org> Break if expansion point or variable are not equal for UnivariatePowerSeriesCategory (fix Sun, 22 May 2005 09:22:00 -0500 bug) <br> Simplified code. <a href="power-serie.patch3">power-serie.patch3</a> From unknown Wed Jun 1 13:15:30 -0500 2005 From: unknown Date: Wed, 01 Jun 2005 13:15:30 -0500 Subject: Some information Message-ID: <20050601131530-0500@page.axiom-developer.org> Possible information about this bug:: http://lists.gnu.org/archive/html/axiom-developer/2004-11/msg00137.html From unknown Fri Oct 7 10:46:23 -0500 2005 From: unknown Date: Fri, 07 Oct 2005 10:46:23 -0500 Subject: status change Message-ID: <20051007104623-0500@wiki.axiom-developer.org>
Original Date: Fri, 25 Mar 2005 10:47:55 -0600
I will give some hint to understand this. Here the interpreter has to coerce the series (EXPR (INT OR OTHER)), the variable and the expansion point. In Axiom trace all these functions: P2Uls P2Upxs P2Uts Expr2Up NDmp?2domain 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 ?) :
)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
a:=series(sin(x))
Beware axiom will crash. Now type:
a*1.0
restart do the same and type:
You will see that axiom in this process does not coerce all types (for example sometimes 0 (expansion point) remain Integer but of type EXPR FLOAT). Normally:
x in displayed type is of type Symbol 0.0 (expansion point) has the same type as the coefficients of the power series. For example: EXPR FLOAT.
Now you can restart and create 2 power series, one with integer the other with float:
a:=series(sin(x))
Coerce it (see above):
a:= a::UnivariatePuiseuxSeries(Expression Integer,x,0) b:= a::UnivariatePuiseuxSeries(Expression Float,x,0.0)
You can type:
a*b
restart do the same type:
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:
-- 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)
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 (two different symbols crash axiom for example). Regards
If you add this text to the file .axiom.input (interpreted at the start of axiom) you will crash axiom:
1.0::UnivariatePuiseuxSeries(Expression Float,x,0.0
Regards
Here is another patch if you run into problem with a 'maformed patch 'message .Change to axiom directory: cat power-series.patch2 |patch -0Cheers This patch doesn't check the equality of the expansion points and the symbols for different power series. Example:
a:=series(sin(x)) b:=taylor(sin(x),x=2) a*bBreak if expansion point or variable are not equal for UnivariatePowerSeriesCategory? (fix Sun, 22 May 2005 09:22:00 -0500 bug)