Skip to content

wildcards are not converted to Maxima #16335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dkrenn opened this issue May 12, 2014 · 3 comments
Open

wildcards are not converted to Maxima #16335

dkrenn opened this issue May 12, 2014 · 3 comments

Comments

@dkrenn
Copy link
Contributor

dkrenn commented May 12, 2014

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)
      5 

/usr/opt/Sage-6.2-amd64/local/lib/python2.7/site-packages/sage/symbolic/expression.so 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_()
    398 
    399     #Handle some basic cases first

/usr/opt/Sage-6.2-amd64/local/lib/python2.7/site-packages/sage/symbolic/expression.so 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/sage_object.so 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/lazy_import.so 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)
    197 
    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)
    627 
    628     def _latex_(self):

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

CC: @robertwb @nbruin @jpflori

Component: symbolics

Keywords: dictionary, symbolic function, Maxima

Issue created by migration from https://trac.sagemath.org/ticket/16335

@dkrenn dkrenn added this to the sage-6.3 milestone May 12, 2014
@pjbruin
Copy link
Contributor

pjbruin commented May 22, 2014

comment:1

(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
CODE:
        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.

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@dkrenn
Copy link
Contributor Author

dkrenn commented Apr 16, 2015

comment:3

Still there in 6.6

@rwst rwst changed the title dictionary of symbolic expressions (functions) raises Maxima-error wildcards are not converted to Maxima Oct 2, 2017
@slel
Copy link
Member

slel commented Apr 13, 2021

comment:5

Similar report at #21444.

@mkoeppe mkoeppe removed this from the sage-6.4 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants