I will just mention http://fungrim.org/grim/ which is somewhat related to 
the present discussion.

This is an attempt to design a symbolic formula language that is easy to 
parse and has well-defined semantics. Key points:

* Can be used within Python (and other languages) without special syntax
* Expressly designed to describe mathematical objects and not for 
reflection (manipulation of symbolic expressions is meant to be done in the 
environment, e.g. Python, not from within the symbolic expression language)
* Expressions are inert by default (there is no automatically-enforced 
pseudo-canonical form, and any form of evaluation or rewriting must be 
invoked explicitly by the user)
* Evaluation and simplification is subject to a rigorous assumptions system
* There is an explicit distinction between symbolic variables and 
polynomial indeterminates
* Real numbers are mathematical real numbers
* Functions are mathematical functions, with well-defined and consistent 
behavior at "exceptional points"

The specification is still far from complete and the implementation still 
has a long way to go, but I'm working on it :-)

I'm using it with some success to build http://fungrim.org/. Thanks to the 
strong semantics, it is possible to do automated randomized testing of the 
formulas and their assumptions. To illustrate:

>>> formula = Equal(Gamma(x+1), x*Gamma(x))
>>> formula.test(variables=[x], assumptions=Element(x, CC))
{x: -3}    ...  True
{x: 8}    ...  True
{x: 0}    ...  False
Traceback (most recent call last):
  ...
ValueError

(Gamma(0+1) = 0*Gamma(0) is not a true identity.) With correct assumptions, 
excluding the poles:

>>> formula.test(variables=[x], assumptions=Element(x, SetMinus(CC, 
ZZLessEqual(0))))
{x: Sqrt(2)}    ...  Unknown
{x: Mul(Mul(2, Pi), ConstI)}    ...  Unknown
{x: Div(Mul(3, Pi), 2)}    ...  Unknown
{x: Neg(Div(1, 2))}    ...  True
{x: Div(1, 2)}    ...  True
{x: Add(Sqrt(2), 1)}    ...  Unknown
{x: Add(1, ConstI)}    ...  Unknown
...
{x: Sub(Pi, ConstI)}    ...  Unknown
{x: Sub(Sqrt(2), 1)}    ...  Unknown
{x: 64}    ...  True
{x: 255}    ...  Unknown
{x: 7}    ...  True
Passed 100 instances (25 True, 75 Unknown, 0 False)
{'True': 25, 'Unknown': 75, 'False': 0, 'Total': 100}

Fredrik

On Friday, July 10, 2020 at 5:21:07 PM UTC+2 rocky.b...@gmail.com wrote:

> Ok. This is on my back-burner list of things to get to. 
>
> It is something I would like to do, and think I could do reasonably well, 
> but I never know if I'll have the free time. 
>
> And if someone else wants to take the lead, I'll be happy to share what I 
> know on the compiler/transpiler end and contribute.
>
> Also, if there is funding for this effort, then it will most likely get 
> done. 
>
>
>
> On Fri, Jul 10, 2020 at 10:52 AM kcrisman <kcri...@gmail.com> wrote:
>
>>
>>
>>
>>   Clearly, adding the ability to parse some Mathematica code fits well 
>>> into that goal.  If nothing else, it could be a helpful step in converting 
>>> existing Mathematica user code so that it can work in Sage, and that's 
>>> part of being a viable alternative.    
>>>
>>
>> This is an important point that I am sorry we did not mention earlier; 
>> thanks, William.  I have definitely had many requests for such an automated 
>> tool in the past from colleagues with a lot of Mma stuff.
>>
>> -- 
>>
> You received this message because you are subscribed to a topic in the 
>> Google Groups "sage-devel" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/sage-devel/z3XBhQOCh9E/unsubscribe.
>>
> To unsubscribe from this group and all its topics, send an email to 
>> sage-devel+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-devel/8dd1a617-6bcc-40e3-a1c7-89efb2927597o%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/sage-devel/8dd1a617-6bcc-40e3-a1c7-89efb2927597o%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/050a44ed-e31b-4ddb-8687-fc9dcd53e3c1n%40googlegroups.com.

Reply via email to