#10169: Operands and Operator of symbolic expressions
-------------------------+--------------------------------------------------
Reporter: SimonKing | Owner: burcin
Type: defect | Status: new
Priority: major | Milestone: sage-4.6
Component: symbolics | Keywords: operator operands symbolics
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-------------------------+--------------------------------------------------
Description changed by SimonKing:
Old description:
> I think that for all symbolic expression {{{s}}} should hold
> {{{
> sage: s == s.operator()(*s.operands())
> }}}
>
> That currently does not work, for two reasons.
>
> 1. There may be no operator at all:
> {{{
> sage: print x.operator()
> None
> sage: x.operands()
> []
> }}}
> I believe there should instead be an identity operator.
>
> 2. The list of operands may be longer than what the operator accepts:
> {{{
> sage: s = 0.001*x^2+0.01*x+0.1*sin(1.01*x)+1
> sage: s.operands()
> [0.00100000000000000*x^2, 0.0100000000000000*x,
> 0.100000000000000*sin(1.01000000000000*x), 1]
> sage: s.operator()(*s.operands())
> ---------------------------------------------------------------------------
> TypeError Traceback (most recent call
> last)
>
> /home/king/<ipython console> in <module>()
>
> TypeError: op_add expected 2 arguments, got 4
> }}}
New description:
I think that for all symbolic expression {{{s}}} should hold
{{{
sage: s == s.operator()(*s.operands())
}}}
That currently does not work, for two reasons.
1. There may be no operator at all:
{{{
sage: print x.operator()
None
sage: x.operands()
[]
}}}
I believe there should instead be an identity operator.
2. The list of operands may be longer than what the operator accepts:
{{{
sage: s = 0.001*x^2+0.01*x+0.1*sin(1.01*x)+1
sage: s.operands()
[0.00100000000000000*x^2, 0.0100000000000000*x,
0.100000000000000*sin(1.01000000000000*x), 1]
sage: s.operator()(*s.operands())
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/home/king/<ipython console> in <module>()
TypeError: op_add expected 2 arguments, got 4
}}}
Compare this thread at [http://groups.google.com/group/sage-
support/browse_thread/thread/844ac19f3ce597a2 sage-devel].
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10169#comment:2>
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.