[sage-devel] Re: Pattern matching in Sage

2017-11-17 Thread rjf
It includes this probably bad idea ---
"Often, tree-walkers would prefer to see divisions instead of 
multiplications and negative exponents"

which means that a programmer may have to write the same code twice.
Example:  Once for exp(-x) and once for 1/exp(x).  or   for 2^(-x),   or  
even 2^n for 
possibly negative n.
RJF


On Friday, November 17, 2017 at 3:24:20 AM UTC-8, Eric Gourgoulhon wrote:
>
> Le dimanche 12 novembre 2017 16:04:38 UTC+1, Eric Gourgoulhon a écrit :
>>
>>
>> Yes for sure, I will rewrite it using the expression tree walker, but in 
>> another ticket. 
>>
>
> This is now  #24232 . This ticket 
> rebases all simplifications in calculus on manifolds on direct 
> manipulations of the expression tree, by subclassing ExpressionTreeWalker 
> .
>  
>
>
> Eric.
>

-- 
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 post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Pattern matching in Sage

2017-11-17 Thread Eric Gourgoulhon
Le dimanche 12 novembre 2017 16:04:38 UTC+1, Eric Gourgoulhon a écrit :
>
>
> Yes for sure, I will rewrite it using the expression tree walker, but in 
> another ticket. 
>

This is now  #24232 . This ticket 
rebases all simplifications in calculus on manifolds on direct 
manipulations of the expression tree, by subclassing ExpressionTreeWalker 
.
 


Eric.

-- 
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 post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Pattern matching in Sage

2017-11-16 Thread rjf


On Wednesday, November 15, 2017 at 12:07:45 AM UTC-8, Dima Pasechnik wrote:
>
> I would not be  too surprised if someone had written a Lisp interpreter 
>  in Python, representing Lisp code as stings :-)


There is a certain universality in strings, given that humans
read and write strings of characters.  And even speech
consists of strings of phonemes.

  There is a long history
of string-oriented programming languages going back
to SNOBOL.  I assume that at least one person wrote a simple
lisp system in SNOBOL.  If I recall correctly, there was some kind
of parenthesis-balancing feature in SNOBOL IV.

There is also a long history of people writing
programs based on a bad idea, poorly designed,
and destined to be discarded.  I've done some of
that myself.

RJF


 

-- 
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 post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Pattern matching in Sage

2017-11-15 Thread Dima Pasechnik
I would not be  too surprised if someone had written a Lisp interpreter  in 
Python, representing Lisp code as stings :-)

-- 
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 post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Pattern matching in Sage

2017-11-14 Thread rjf
It seems to me that the use of python matching programs for implementing
Rubi suggest that this (or other?) matching programs were too slow to
be effective. From a brief scan through the papers, it seems that the 
authors
do not compare their programs with programs that
have been written by others. This makes the whole enterprise somewhat
suspicious.  Should you depend on this library?  The fact that
you have ever even considering string representations furthermore
suggests you should do some further investigation of the
literature before plunging into writing code.

RJF
 

On Sunday, November 12, 2017 at 7:04:38 AM UTC-8, Eric Gourgoulhon wrote:
>
> Hi,
>
> Le dimanche 12 novembre 2017 14:45:54 UTC+1, Ralf Stephan a écrit :
>>
>> Is the documentation really so bad that you couldn't find
>>
>> http://doc.sagemath.org/html/en/reference/calculus/sage/symbolic/expression_conversions.html
>>
>> Of course Sage uses pattern matching, e.g. to convert expressions.
>> I'm not reverting that positive on that ticket but I urge the author to 
>> rewrite it.
>>
>>
> Yes for sure, I will rewrite it using the expression tree walker, but in 
> another ticket. #24199  simply 
> ammends a previous version that was based on string representations. To go 
> further and introduce new simplification rules, I of course agree that it 
> is much more robust to use the expression tree.
>
> Best regards,
>
> Eric.
>
>

-- 
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 post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Pattern matching in Sage

2017-11-12 Thread Eric Gourgoulhon
Hi,

Le dimanche 12 novembre 2017 14:45:54 UTC+1, Ralf Stephan a écrit :
>
> Is the documentation really so bad that you couldn't find
>
> http://doc.sagemath.org/html/en/reference/calculus/sage/symbolic/expression_conversions.html
>
> Of course Sage uses pattern matching, e.g. to convert expressions.
> I'm not reverting that positive on that ticket but I urge the author to 
> rewrite it.
>
>
Yes for sure, I will rewrite it using the expression tree walker, but in 
another ticket. #24199  simply 
ammends a previous version that was based on string representations. To go 
further and introduce new simplification rules, I of course agree that it 
is much more robust to use the expression tree.

Best regards,

Eric.

-- 
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 post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Pattern matching in Sage

2017-11-12 Thread Ralf Stephan
Is the documentation really so bad that you couldn't find
http://doc.sagemath.org/html/en/reference/calculus/sage/symbolic/expression_conversions.html

Of course Sage uses pattern matching, e.g. to convert expressions.
I'm not reverting that positive on that ticket but I urge the author to 
rewrite it.

Regards,

On Sunday, November 12, 2017 at 2:08:03 AM UTC+1, Richard_L wrote:
>
>
> Inspired by this trac comment, 
> https://trac.sagemath.org/ticket/24199#comment:2, I noticed two preprints 
> on the arXiv extolling the virtues of MatchPy. Instead of custom coding 
> string manipulations, would Sage and/or its upstream partners (SymPy comes 
> to mind) find MatchPy convenient? The preprints may be found at 
> https://arxiv.org/abs/1710.00077 and https://arxiv.org/abs/1710.06915.
>

-- 
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 post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.