[Maxima] assume:problems with fractions or multiples of %pi and %e
drdieterkaiser at web.de
Sat Oct 3 09:31:59 CDT 2009
I think I have found a solution for the problem that the extra facts are
visible to the user.
We write the additional facts from learn-numer and learn-abs in a new
context which I have called '$learndata. We can activate this context.
All facts are present, but not seen by the user with the command
This is an example how it works:
(%o2) [%pi/2 > x]
The user only sees the fact from the assume statement:
(%o3) [%pi/2 > x]
But the following works now too, because Maxima has put an additional
fact into the database:
These are the contexts. The facts from learn-numer are put into the
When we use kill(all) the additional facts in learndata will vanish too:
Maxima no longer knows that x < %pi:
It is possible to have a look at the additional facts. We have to change
(%o4) [%pi/2 > x]
(%o6) [1.570796326794897 > x]
The command forget will work as expected. A fact is removed from both
(%o1) [%pi/2 > x]
(%o2) [%pi/2 > x]
First I had to correct a small bug in the routine killcontext. When a
context is killed it is not removed from the list of active contexts.
This causes problems.
This is the code which collects the additional information in the
(when (not (alike (cdr pat) (cdr patnew)))
(let ((oldcontext $context))
;; Switch to the context '$learndata
;; If '$learndata does not exist, it is created.
(asscontext nil '$learndata)
;; Put the numerically evaluated fact into the database
(learn patnew flag)
;; Switch back to the context on entry
(asscontext nil oldcontext)
;; Make sure that the context '$learndata is active
There is one open problem. One example of the testsuite in rtestint.mac
fails. I have to understand why this happens.
More information about the Maxima