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

Edit detail for #338 'eval' misses main variable revision 5 of 6

1 2 3 4 5 6
Editor: gdr
Time: 2008/10/13 20:30:41 GMT-7
Note: Fixed in OpenAxiom

added:

From gdr Mon Oct 13 20:30:41 -0700 2008
From: gdr
Date: Mon, 13 Oct 2008 20:30:41 -0700
Subject: Fixed in OpenAxiom
Message-ID: <20081013203041-0700@axiom-wiki.newsynthesis.org>



Submitted by : (unknown) at: 2007-11-17T22:29:19-08:00 (16 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

Axiom provides functionality to evaluate operators using a given evaluation function. Unfortunately, it is broken.

axiom
g := operator 'g;
Type: BasicOperator?
axiom
eval(g(1783), g, i+->i)
LatexWiki Image(1)
Type: Expression Integer
axiom
eval(g(n), g, i+->i)
LatexWiki Image(2)
Type: Expression Integer
axiom
eval(a*g(n), g, i+->i)
LatexWiki Image(3)
Type: Expression Integer
axiom
eval(a*g(1783), g, i+->i)
LatexWiki Image(4)
Type: Expression Integer

I guess that the problem is in 'smprep$FS':

      smprep(lop, lexp, lfunc, p) ==
      ..(v := mainVariable p) case "failed" => p::%
      ..symbolIfCan(k := v::K) case SY => p::%
      ..g := (op := operator k)
      .....(arg := [eval(a,lop,lexp,lfunc) for a in argument k]$List(%))
      ..q := map(eval(#1::%, lop, lexp, lfunc),
      ...........univariate(p, k))$SparseUnivariatePolynomialFunctions2(MP, %)
      ..(n := position(name op, lop)) < minIndex lop => q g
      ..a:%  := 0
      ..f    := eval((lfunc.n) arg, lop, lexp, lfunc)
      ..e    := lexp.n
      ..while q ^= 0 repeat
      ....m  := degree q
      ....qr := divide(m, e)
      ....t1 := f ** (qr.quotient)::N
      ....t2 := g ** (qr.remainder)::N
      ....a  := a + leadingCoefficient(q) * t1 * t2
      ....q  := reductum q
      ..a

It seems that Axiom picks the wrong mainVariable in the broken case, namely a instead of g(1783). I badly need this fixed...

Martin

fixed in FriCAS? --kratt6, Mon, 24 Dec 2007 05:31:42 -0800 reply
Status: open => fix proposed

Status: fix proposed => fixed somewhere

no patch available

From wh-sandbox --alfredo, Thu, 28 Aug 2008 18:49:01 -0700 reply
http://axiom.svn.sourceforge.net/viewvc/axiom/branches/wh-sandbox/src/algebra/fspace.spad.pamphlet?r1=432&r2=585

Fixed in OpenAxiom? --gdr, Mon, 13 Oct 2008 20:30:41 -0700 reply