Re: [sage-devel] Re: Parsing an expression according to a given grammar in Sage

2011-02-25 Thread Nicolas M. Thiery
On Wed, Feb 23, 2011 at 12:24:25PM -0800, Alexandre Blondin Massé wrote: > > Something which is quite related is how species / lazy power series > > can be defined by implicit equations in Sage: > > > >         sage: L = LazyPowerSeriesRing(QQ) > >         sage: one = L(1) > >         sage: monom =

[sage-devel] Re: Parsing an expression according to a given grammar in Sage

2011-02-23 Thread Alexandre Blondin Massé
Hi, Nicolas! On 23 fév, 02:44, "Nicolas M. Thiery" wrote: >         Hi Alexandre! > > > I assume Eviatar's message was really about using Sage's symbolic > capabilities for manipulating systems of equations. Not Sage's > symbolic solver. So one could imagine doing something like: > >     sage: sy

Re: [sage-devel] Re: Parsing an expression according to a given grammar in Sage

2011-02-23 Thread Nicolas M. Thiery
Hi Alexandre! On Wed, Feb 16, 2011 at 01:13:57PM -0800, Alexandre Blondin Massé wrote: > On 16 fév, 15:52, Eviatar wrote: > > Another option would be to use Sage's existing symbolic capabilities. > > For example: > > > > sage: solve(u*v==log(u*v), u) > > [u == log(u*v)/v] > > The equatio

[sage-devel] Re: Parsing an expression according to a given grammar in Sage

2011-02-16 Thread Alexandre Blondin Massé
You're right! Thanks! Alex On 16 fév, 17:42, Mike Hansen wrote: > On Wed, Feb 16, 2011 at 11:40 PM, Alexandre Blondin Massé > > wrote: > > Maybe it's worth including such a package in Sage if it's not already > > done? > > I believe it's included in matplotlib as matplotlib.pyparsing. > > --Mi

Re: [sage-devel] Re: Parsing an expression according to a given grammar in Sage

2011-02-16 Thread Mike Hansen
On Wed, Feb 16, 2011 at 11:40 PM, Alexandre Blondin Massé wrote: > Maybe it's worth including such a package in Sage if it's not already > done? I believe it's included in matplotlib as matplotlib.pyparsing. --Mike -- To post to this group, send an email to sage-devel@googlegroups.com To unsub

[sage-devel] Re: Parsing an expression according to a given grammar in Sage

2011-02-16 Thread Alexandre Blondin Massé
> > > In that case I would think specialized functions would be better, such > > as palindromes(u). For parsing, could you not use regular expressions? > > I guess regular expressions would be ok, but more work is needed. > Ideally, I would like to delegate that work to a module that does all > the

[sage-devel] Re: Parsing an expression according to a given grammar in Sage

2011-02-16 Thread Alexandre Blondin Massé
On 16 fév, 15:52, Eviatar wrote: > Another option would be to use Sage's existing symbolic capabilities. > For example: > > sage: solve(u*v==log(u*v), u) > [u == log(u*v)/v] The equations I'm handling are on words, not on numbers. More precisely, the * operation is the concatenation (it has a mon

[sage-devel] Re: Parsing an expression according to a given grammar in Sage

2011-02-16 Thread Alexandre Blondin Massé
On 16 fév, 15:47, Eviatar wrote: > Hello! > > I'm wondering why you would want to include it like this; it doesn't > follow Python syntax. "=" is for assignment, and this: "u * v = phi(u > * v)" would return a syntax error in Python. I suppose you mean "=="? This would be a new syntax between sin

[sage-devel] Re: Parsing an expression according to a given grammar in Sage

2011-02-16 Thread Eviatar
Another option would be to use Sage's existing symbolic capabilities. For example: sage: solve(u*v==log(u*v), u) [u == log(u*v)/v] -- 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

[sage-devel] Re: Parsing an expression according to a given grammar in Sage

2011-02-16 Thread Eviatar
Hello! I'm wondering why you would want to include it like this; it doesn't follow Python syntax. "=" is for assignment, and this: "u * v = phi(u * v)" would return a syntax error in Python. I suppose you mean "=="? In that case I would think specialized functions would be better, such as palindro