login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for #156 Axiom crashes when compiling simple Taylor code revision 4 of 4

1 2 3 4
Editor: test1
Time: 2014/07/28 15:44:54 GMT+0
Note:

added:

From test1 Mon Jul 28 15:44:54 +0000 2014
From: test1
Date: Mon, 28 Jul 2014 15:44:54 +0000
Subject: 
Message-ID: <20140728154454+0000@axiom-wiki.newsynthesis.org>

Status: fix proposed => closed 


Submitted by : (unknown) at: 2007-11-17T21:59:27-08:00 (17 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

When trying this code (that is probably buggy on some level), axiom simply crashes on me without any comment. I'm using the Debian (Ubuntu) build of 20050201

fricas
(1) -> u := operator 'u;
Type: BasicOperator?
fricas
multidiff(expr, variable, count) == 
  if count > 0 then
    D(multidiff(expr, variable, count-1), variable)
  else
    expr
Type: Void
fricas
make_taylor(expr) ==
  series( n +-> multidiff(expr, x, n), x=0)
Type: Void

Can't run this one::

fricas
make_taylor(u(x))
fricas
Compiling function multidiff with type (Expression(Integer), 
      Variable(x), Integer) -> Expression(Integer)
fricas
Compiling function make_taylor with type Expression(Integer) -> Any

\label{eq1}\begin{array}{@{}l}
\displaystyle
{u \left({x}\right)}+{{{u^{\prime}}\left({x}\right)}\  x}+{{{u^{\prime \prime}}\left({x}\right)}\ {{x}^{2}}}+ 
\
\
\displaystyle
{{{u^{\prime \prime \prime}}\left({x}\right)}\ {{x}^{3}}}+{{{u^{\left(iv \right)}}\left({x}\right)}\ {{x}^{4}}}+{{{u^{\left(v \right)}}\left({x}\right)}\ {{x}^{5}}}+ 
\
\
\displaystyle
{{{u^{\left(vi \right)}}\left({x}\right)}\ {{x}^{6}}}+{{{u^{\left(vii \right)}}\left({x}\right)}\ {{x}^{7}}}+{{{u^{\left(viii \right)}}\left({x}\right)}\ {{x}^{8}}}+{{{u^{\left(ix \right)}}\left({x}\right)}\ {{x}^{9}}}+ \
\
\displaystyle
{{{u^{\left(x \right)}}\left({x}\right)}\ {{x}^{10}}}+{O \left({{x}^{11}}\right)}
(1)
Type: UnivariatePuiseuxSeries?(Expression(Integer),x,0)

In fact, series doesn't work as soon as it is wrapped in a function, no matter whether declared or not. While

fricas
series( (n:INT):EXPR INT +-> a^n, x=0)$GenerateUnivariatePowerSeries(INT, EXPR INT)

\label{eq2}\begin{array}{@{}l}
\displaystyle
1 +{a \  x}+{{{a}^{2}}\ {{x}^{2}}}+{{{a}^{3}}\ {{x}^{3}}}+{{{a}^{4}}\ {{x}^{4}}}+{{{a}^{5}}\ {{x}^{5}}}+{{{a}^{6}}\ {{x}^{6}}}+{{{a}^{7}}\ {{x}^{7}}}+ 
\
\
\displaystyle
{{{a}^{8}}\ {{x}^{8}}}+{{{a}^{9}}\ {{x}^{9}}}+{{{a}^{10}}\ {{x}^{10}}}+{O \left({{x}^{11}}\right)}
(2)
Type: UnivariatePuiseuxSeries?(Expression(Integer),x,0)

works alright, the following fails::

fricas
make_taylor(x:Symbol):ANY == series( (n:INT):EXPR INT +-> a^n, x=0)$GenerateUnivariatePowerSeries(INT, EXPR INT)
Function declaration make_taylor : Symbol -> Any has been added to workspace. Compiled code for make_taylor has been cleared. 1 old definition(s) deleted for function or rule make_taylor
Type: Void

Works probably with patch from bug #136 --unknown, Thu, 12 May 2005 10:53:18 -0500 reply
Axiom doesn't crash with this patch.

Cheers

Works with compiled functions --unknown, Thu, 12 May 2005 11:14:17 -0500 reply
Sorry, this code works with or without this patch if you compile the functions: )set function compile on
But
fricas
maketaylor(x:Symbol):UnivariateTaylorSeries(Expression Integer,x,0) == 
        aa:=series( (n:INT):EXPR INT +-> a^n, x=0)$GenerateUnivariatePowerSeries(INT, EXPR INT)
        aa::UnivariateTaylorSeries(Expression Integer,x,0)
Function declaration maketaylor : Symbol -> UnivariateTaylorSeries( Expression(Integer),x,0) has been added to workspace.
Type: Void
fricas
maketaylor(x)
Cannot compile conversion for types involving local variables. In particular, could not compile the expression involving :: UnivariateTaylorSeries(Expression(Integer),#1,0) FriCAS will attempt to step through and interpret the code.
fricas
Compiling function maketaylor with type Symbol -> 
      UnivariateTaylorSeries(Expression(Integer),x,0)

\label{eq3}\begin{array}{@{}l}
\displaystyle
1 +{a \  x}+{{{a}^{2}}\ {{x}^{2}}}+{{{a}^{3}}\ {{x}^{3}}}+{{{a}^{4}}\ {{x}^{4}}}+{{{a}^{5}}\ {{x}^{5}}}+{{{a}^{6}}\ {{x}^{6}}}+{{{a}^{7}}\ {{x}^{7}}}+ 
\
\
\displaystyle
{{{a}^{8}}\ {{x}^{8}}}+{{{a}^{9}}\ {{x}^{9}}}+{{{a}^{10}}\ {{x}^{10}}}+{O \left({{x}^{11}}\right)}
(3)
Type: UnivariateTaylorSeries?(Expression(Integer),x,0)

Cheers

Category: Axiom Compiler => Axiom Interpreter Status: open => fix proposed

Status: fix proposed => closed