On 03/11/2010 12:49 AM, Felix Lawrence wrote:
I have created a ticket for this at 
http://trac.sagemath.org/sage_trac/ticket/8495
and have commented about how to fix the regression due to #3587 on the
new ticket.

Jason, it seems like Mathematica.get() currently uses InputForm - how
does this differ to FullForm?



In short (as I understand it), FullForm [1] is basically a full explicit parse tree of the expression, and is the authoritative, definitive representation of the object, while InputForm [2] is an abbreviated form suitable for input.

To parse the FullForm, see http://reference.wolfram.com/mathematica/tutorial/EverythingIsAnExpression.html for a general overview.

See http://reference.wolfram.com/mathematica/tutorial/FormsOfInputAndOutput.html for a short overview of different output formats. See http://reference.wolfram.com/mathematica/tutorial/TextualInputAndOutputOverview.html for lots and lots of documentation on the subject.

One example of the difference is:

In[1]:= 2*I*E//FullForm

Out[1]//FullForm= Times[Complex[0, 2], E]

In[2]:= 2*I*E//InputForm

Out[2]//InputForm= (2*I)*E

If we just define a simple mapping (for example:

[ -> ( (like now)
] -> ) (like now)
Times -> prod (need to convert arguments to a list)
Plus -> sum (need to convert arguments to a list)
Power -> operator.pow
E -> sage.all.e
Pi -> sage.all.pi
Rational -> QQ or SR (some more translation is needed here, since QQ(1,2) doesn't give 1/2)

and just try converting things to lower case (so Complex[0,1] -> complex(0,1), List->list, etc.), then things might work a lot better.

I suppose we still would have to write some code to convert a mathematica real number (with precision/accuracy information) to a corresponding Sage number, or in the short term, we could just set NumberMarks->False.

Thanks,

Jason

[1] http://reference.wolfram.com/mathematica/ref/FullForm.html

[2] http://reference.wolfram.com/mathematica/ref/InputForm.html

--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to