On Wed, 01 May 2013 20:40:24 +0200
Daniel Krenn <
kr...@aon.at> wrote:
> Am 2013-04-28 18:21, schrieb sharad gupta:> Sir,
> > It will be beneficial for me if you provide me with some detailed
> > guidelines about the project so that it will help me in my project
> > template.
>
> The project description on the ideas page contains five parts. You can
> start with any you like. The main idea is to extend the exiting
> substitute command.
IMHO, the project proposal contains only a list of goals and does not
address the methodology. I know quite a bit about symbolics in Sage.
I'd be surprised if a student can find out how to implement this
functionality when I'm having difficulty coming up with a solution
myself.
> It can be helpful to study (not detailled) the
> code of that command, as well as the way how wildcards are
> implemented at the moment (since those should also be used
> extensively)
The substitute() function for symbolic expressions in Sage is
implemented in Pynac [1] and it is in C++. I don't know if advanced
rewriting rules can be implemented purely in Python, without
understanding how Pynac and Sage interact.
[1]
http://pynac.org/
A couple of students have tried to work with Pynac for the "symbolic
expressions" project this year. But the barrier to entry is rather
high and nobody managed to get there yet. One needs to know Sage,
Cython, C++, Python C-API and how all these things interact.
Here are some random suggestions about symbolics and rewriting rules.
Please do not attempt to build anything on string processing based on
symbolic expression, similar to mtype.py included here:
http://trac.sagemath.org/sage_trac/attachment/ticket/8616/trac_8616_symbolic_sage_correct.patch
Pynac/GiNaC provides a framework for traversing expression trees [2]
and rewriting parts of it [3]. This is
[2]
http://www.ginac.de/tutorial/Visitors-and-tree-traversal.html
[3]
http://www.ginac.de/tutorial/Applying-a-function-on-subexpressions.html
However, these are not exposed to the Python interface yet. If they
were, they could be used to implement the rewrite() interface suggested
by Francois Maltey [4, 5].
[4]
http://trac.sagemath.org/sage_trac/ticket/10137
[5]
http://wiki.sagemath.org/symbolics/rewrite
We could also think about improving the pattern matching facilities if
there were more concrete examples of missing functionality. This would
require delving into the guts of Pynac/GiNaC. Here is some relevant
documentation:
[6]
http://www.ginac.de/tutorial/Pattern-matching-and-advanced-substitutions.html
Cheers,
Burcin