#13655: anonymous symbols lose their identity when passed through maxima
-----------------------------+----------------------------------------------
Reporter: tkluck | Owner: burcin
Type: defect | Status: new
Priority: major | Milestone: sage-5.5
Component: symbolics | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
-----------------------------+----------------------------------------------
Comment (by nbruin):
The problem is a little more widespread:
{{{
sage: s = SR.symbol()
sage: s1 = s._maxima_().sage()
sage: s2 = sage.calculus.calculus.maxima(s).sage()
sage: s3 = integrate(s,s).variables()[0]
sage: [id(s),id(s1),id(s2),id(s3)]
[140326504362424, 96060840, 96060840, 96060696]
sage: (s^2 + 3*s + 1).taylor(s,0,2).coefficient(s3)
0
sage: (s1^2 + 3*s1 + 1).taylor(s1,0,2).coefficient(s3)
0
sage: (s3^2 + 3*s3 + 1).taylor(s3,0,2).coefficient(s1)
3
}}}
{{{
sage: s = SR('t')
sage: s1 = s._maxima_().sage()
sage: s2 = sage.calculus.calculus.maxima(s).sage()
sage: s3 = integrate(s,s).variables()[0]
sage: [id(s),id(s1),id(s2),id(s3)]
[95996024, 95996024, 95996024, 96062064]
sage: (s^2 + 3*s + 1).taylor(s,0,2).coefficient(s3)
3
sage: L=[integrate(s,s).variables()[0] for i in range(10)]
sage: [id(l) for l in L]
[96062928, 96061704, 96062568, 96061200, 97231576, 97231504, 97231936,
97232008, 97232080, 97232152]
}}}
As you see, the variables produced by integrate, which go through the
symbol-based interface with libmaxima (i.e., no direct string
translations) don't maintain symbol identity at all. However, that doesn't
always seem to affect how they behave (perhaps the python wrapper id
doesn't reflect the identity of the wrapped pynac entity).
Perhaps `SR.symbol` produces an "uninterned" symbol? In that case, the
most straightforward solution would be to let `SR.symbol()` produce
interned symbols. That would leak memory, but converting symbols to maxima
already does (because we have to interface with a non-refcounting system)
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13655#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.