Hi all.

Since some of you are willing to improve the logic and  assumption
system, I'll just say my opinion on the current state of these modules.

The logic framework (sympy.logic) in my opinion is ok. Sure, it could be
improved with quantifiers (first-order logic) and other niceties, but
overall it fulfills its purposes, and after 6 months I believe it is
considered API stable.

On the other hand, I am not at all happy with the assumption system that
I coded. It works, but there are some places that surely could be improved:

   - Performance. I have to restore to ugly hacks to have an acceptable
performance. See known_facts_compiled in assumptions.ask

   - Scalability. When the size of the known_facts database grows, the
performance grows exponentially. Plus, each time there is a query, a
Satisfiability solver is run over *all* variables. There are algorithms
that use previous knowledge to run faster.

   - API. The API is cumbersome and far too verbose (ask(x, Q.integer,
Assume(x, Q.rational) just to query if a rational is an integer).
Unfortunately, I do not know a better one.


The old assumption system
-------------------------
Having the old assumption still around is a pain, but the core is
extremely fragile and removing the old assumption and plugging the new
one is not a trivial task.

The HOWTO is rather simple: you remove the inheritance of Basic from
AssumeMeths, that is where all the old assumption framework is
encapsulated, and you start fixing tests.

See this commit for an example on how this could be done.[1]

Now you have two kinds of bugs. One type is derived from the fact that
the new assumption system supports less keys than the old one. This is
done because in the new system I removed all keys that where redundant
or could be derived from others. See also [1] for an example on how this
could be done. Note that you will have to re-generate
known_facts_compiled each time you add new keys.

The other type of bugs are bugs that come from the fragility of the core
and are bugs that give strange (or simply different) results for things
that apparently have nothing to do with the core nor with the assumption
system. These bugs are really painful to solve and will likely not be
solved unless there is a real interest in the community and someone who
understands the core (Ondrej?) is willing to work on this.

Note that also Ronan Lamy (search in this list) tried to remove the old
assumption system by splitting Basic into two subclasses, although I do
not know how far that effort went.

[1]
http://github.com/fseoane/SymPy/commit/2343cdac1023e0205a8db8c2a326312350268ae5

Cheers,



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

Reply via email to