Opened 5 years ago

Last modified 17 months ago

#16335 new defect

wildcards are not converted to Maxima

Reported by: dkrenn Owned by:
Priority: major Milestone: sage-6.4
Component: symbolics Keywords: dictionary, symbolic function, Maxima
Cc: robertwb, nbruin, jpflori Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:


The following gives an error:

sage:     D = {}
sage:     f = function('f')
sage:     for dq in srange(0,2):
....:             for du in srange(0,3):
....:                         print dq, du
....:                         D[f(SR.wild(42), dq, du)] = f(SR.wild(42), dq, du)
0 0
0 1
0 2
1 0
TypeError                                 Traceback (most recent call last)
<ipython-input-3-b53f1d26cbca> in <module>()
      2         for du in srange(Integer(0),Integer(3)):
      3                     print dq, du
----> 4                     D[f(SR.wild(Integer(42)), dq, du)] = f(SR.wild(Integer(42)), dq, du)

/usr/opt/Sage-6.2-amd64/local/lib/python2.7/site-packages/sage/symbolic/ in sage.symbolic.expression.Expression.__nonzero__ (sage/symbolic/expression.cpp:12491)()

/usr/opt/Sage-6.2-amd64/local/lib/python2.7/site-packages/sage/symbolic/relation.pyc in test_relation_maxima(relation)
    395         sage: forget()
    396     """
--> 397     m = relation._maxima_()
    399     #Handle some basic cases first

/usr/opt/Sage-6.2-amd64/local/lib/python2.7/site-packages/sage/symbolic/ in sage.symbolic.expression.Expression._maxima_ (sage/symbolic/expression.cpp:5294)()

/usr/opt/Sage-6.2-amd64/local/lib/python2.7/site-packages/sage/structure/ in sage.structure.sage_object.SageObject._interface_ (sage/structure/sage_object.c:4596)()

/usr/opt/Sage-6.2-amd64/local/lib/python2.7/site-packages/sage/misc/ in sage.misc.lazy_import.LazyImport.__call__ (sage/misc/lazy_import.c:3000)()

/usr/opt/Sage-6.2-amd64/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc in __call__(self, x, name)
    198         if isinstance(x, basestring):
--> 199             return cls(self, x, name=name)
    200         try:
    201             return self._coerce_from_special_method(x)

/usr/opt/Sage-6.2-amd64/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc in __init__(self, parent, value, is_name, name)
    624                 self._name = parent._create(value, name=name)
    625             except (TypeError, RuntimeError, ValueError) as x:
--> 626                 raise TypeError(x)
    628     def _latex_(self):

TypeError: ECL says: THROW: The catch MACSYMA-QUIT is undefined.

Change History (4)

comment:1 Changed 5 years ago by pbruin

  • Cc robertwb nbruin jpflori added

(CC-ing the authors of the Maxima library interface)

This seems to be caused by Sage trying to convert the SR.wild(42) object to Maxima. Your code causes Maxima to execute

sage0 : 'f($42,0,2) = 'f($42,1,0)$

but the dollar sign ends statements in Maxima.

The above line is executed via the Maxima library interface, which apparently gives you this cryptic error. Here is a simpler example:

sage: sage.calculus.calculus.maxima(SR.wild(42))    # Maxima library
RuntimeError: ECL says: THROW: The catch MACSYMA-QUIT is undefined.

The error is clearer when using the pexpect interface:

sage: maxima(SR.wild(42))                           # external Maxima program
TypeError: Error executing code in Maxima
        sage1 : $42$
Maxima ERROR:
        incorrect syntax: Premature termination of input at $.
sage1 : $

So there are two issues: the failing conversion and the cryptic error message.

comment:2 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:3 Changed 4 years ago by dkrenn

Still there in 6.6

comment:4 Changed 17 months ago by rws

  • Summary changed from dictionary of symbolic expressions (functions) raises Maxima-error to wildcards are not converted to Maxima
Note: See TracTickets for help on using tickets.