On 07.05.2011 21:21, Ronan Lamy wrote:
Le samedi 07 mai 2011 à 17:28 +0100, Tom Bachmann a écrit :
On 06.05.2011 17:32, Ronan Lamy wrote:
Notice that every element that we ever compute with belongs to some
algebra.

Here's our fundamental disagreement, I think. Objects aren't
intrinsically part of an algebra, they happen to belong to some set over
which some algebraic structure is defined and used.


My point is that without being part of an "algebra" (or whatever we call
it), what does an operation on objects even *mean*, let alone how the
result is represented?

And what does an "algebra" mean without its elements? People knew that 2
+ 2 = 4 before Dedekind told them.

Also, if I understand correctly what you're saying, you're going further
than Integer(1) != Rational(1), you're implying IntegerRing(1) !=
IntegerAdditiveGroup(1).


I'm not sure this discussion leads us anywhere. My point is that we cannot expect efficient and maintainable code if there are centralised classes that are supposed to handle (e.g.) all multiplication.

We see outgrowths of the problem as follows: assumptions are tied in deeply in the core although they should not be, everything relies in a fragile way on caching although it should not, the matrix and "core" code hardly play along. [There are probably more but I'm only describing those I know something about.]

I'm saying that the responsibility of both deciding on the data-structure and the algorithm should be decentralised and swappable. Everything else is an implementation detail to me, at least at this stage.

We are drifting away from assumptions here, but I would argue that in
sympy currently there are about three algebras. They are not being
properly identified as such, and they have no standardised way of
"talking to each other", which makes some things cumbersome. Here they are

o The "calculus" algebra (Add/Mul etc),
o the matrix algebra,
o the polynomial algebras.

I'm not sure how your vision of algebras relates to the current code,
but there are more kinds of objects than that. You're forgetting sets,
booleans, the various kinds of quantum objects, ... The "calculus
algebra" is basically Expr and all its subclasses.


I don't really have a "vision". I only see certain patterns (in particular all-aware Add, Mul and Pow) and think "this cannot be the best way to go". Also I see how for example the Gruntz code could be sped up a lot by implementing what would in the framework I outlined above be a "generalised power series" algebra.

It is clear that this could also be done in the current framework. But it would seem to be very painful.



Please note also that I am not actually proposing to rewrite the core in the fashion I outlined. I will be starting my GSoC project soon and I really don't need any of the stuff I described. But IMHO the core design needs improvement. I'm only trying to contribute to that.

Thanks,
Tom

--
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to