## maxima-discuss

 [Maxima-discuss] Qepmax package: interface to Qepcad From: 本田康晃 - 2014-04-14 13:19:52 Attachments: Message as HTML ```Dear maxima users, Qepmax package, an extension to Maxima to interface with Qepcad B, is available from Github at: https://github.com/YasuakiHonda/qepmax "Download ZIP" button is available for download qepmax-master.zip. You need to separately install Qepcad B program. Qepcad B is a software that performs 'quantifier elimination' or Q.E.. This is quite powerful to solve a large set of issues. Here is an example: Assuming C: x^2+y^2=1, L:y=x+b, let's find a condition on r, a, b, so that C and L cross with each other. Qepmax package can be used to solve such a math problem. (%i1) load(qepmax)\$ (%i2) qe([[E,x],[E,y]], x^2+y^2=1 %and y=x+b); (%o2) b^2-2=<0; Note that in qe() argument, x and y are quantified varialbles, while 'b' is a free variable. The output inequation b^2-2=<0 does not contain any quantified variables. Quantified variables are eliminated!! There are a large collection of literatures on Q.E. and you can find them by using Google search. Qepmax package is written by me and enhanced by Prof. Reinhard Oldenburg san. The Github page includes INSTALL for how to install and README for how to use it. Keep in mind, this is still a beta release quality. If you have any questions and comments, please let me know, or post it here. Yasuaki Honda, Chiba, Japan ```
 Re: [Maxima-discuss] Qepmax package: interface to Qepcad From: Robert Dodier - 2014-04-14 19:53:18 ```On 2014-04-14, 本田康晃 wrote: > Qepmax package, an extension to Maxima to interface with Qepcad B, is > available from Github at: > > https://github.com/YasuakiHonda/qepmax Yasuaki san, thank you so much! That is really terrific. We should probably talk about including it in Maxima. best Robert Dodier ```
 Re: [Maxima-discuss] Qepmax package: interface to Qepcad From: 本田康晃 - 2014-04-15 15:43:15 Attachments: Message as HTML ```Hi Robert san, Thanks for your words. It would be great if you can try it and share with me if it works or not. Anyway, thanks and best regards, Yasuaki Honda 2014-04-15 4:52 GMT+09:00 Robert Dodier : > On 2014-04-14, 本田康晃 wrote: > > > Qepmax package, an extension to Maxima to interface with Qepcad B, is > > available from Github at: > > > > https://github.com/YasuakiHonda/qepmax > > Yasuaki san, thank you so much! That is really terrific. We should > probably talk about including it in Maxima. > > best > > Robert Dodier > > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/NeoTech > _______________________________________________ > Maxima-discuss mailing list > Maxima-discuss@... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > ```
 Re: [Maxima-discuss] Qepmax package: interface to Qepcad From: Richard Fateman - 2014-04-17 23:35:02 Attachments: Message as HTML ```I don't know much about the implementation of Qepcad B, except from a brief peek at the github web site. It seems to me that it is based on an entirely different computer algebra system, SAC-2, and so to use it one ends up loading another parser, a polynomial arithmetic package, an arbitrary-precision arithmetic package, a display package, and who knows what else. It may be that SAC-2 is much more efficient in all of these things than Maxima, but that is not at all guaranteed. It could be that the essential part of QEPcad B can be coded in Maxima's language, or coded in Lisp, in a few pages, given that Maxima already has most of the major components. These include exact evaluation of a polynomial, realroots() which determines root isolation intervals (using Sturm sequences) and resultant(). I have personally avoided looking too closely at qe/ cad because it seemed to me to be computing something I thought I didn't need, and algorithmically guaranteed to be slow, and the program implementations were being refined mostly by George Collins' students in a very deliberative way. It may be, however, that there are applications appearing in tasks involving systems of polynomial inequalities, and that justifies the possibly long computation time. Note for example, solving x^2-1>0 for x is a (univariate) cylindrical decomposition yielding x<-1 or x> 1. We already do this with to_poly_solve(x^2-1<0,x) which gives %union({14 and x>0, [x,y]) for example. Anyway, the thought is that some ambitious person might wish to go through the current best practice for CAD implementation and do it in Maxima. Assuming the underlying lisp has excellent bignum arithmetic, and the rest of the stuff is more-or-less OK, I don't know if there is any reason to believe that SAC-2 would be a better basis than Maxima itself. I vaguely recall doing some timing on SAC-2 vs. Macsyma and was surprised that SAC-2 was not faster. But that was probably 25 or 30 years ago. RJF On 4/15/2014 8:43 AM, 本田康晃 wrote: > Hi Robert san, > Thanks for your words. > > It would be great if you can try it and share with me if it works or not. > > Anyway, thanks and best regards, > Yasuaki Honda > > > 2014-04-15 4:52 GMT+09:00 Robert Dodier >: > > On 2014-04-14, 本田康晃 > wrote: > > > Qepmax package, an extension to Maxima to interface with Qepcad > B, is > > available from Github at: > > > > https://github.com/YasuakiHonda/qepmax > > Yasuaki san, thank you so much! That is really terrific. We should > probably talk about including it in Maxima. > > best > > Robert Dodier > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases > and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/NeoTech > _______________________________________________ > Maxima-discuss mailing list > Maxima-discuss@... > > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > > > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/NeoTech > > > _______________________________________________ > Maxima-discuss mailing list > Maxima-discuss@... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss ```
 Re: [Maxima-discuss] Qepmax package: interface to Qepcad From: Robert Dodier - 2014-04-18 17:34:43 ```On 2014-04-17, Richard Fateman wrote: > It may be that SAC-2 is much more efficient in all of these things > than Maxima, but that is not at all guaranteed. It could be that > the essential part of QEPcad B can be coded in Maxima's language, > or coded in Lisp, in a few pages, given that Maxima already > has most of the major components. That's an interesting idea. I glanced at the QEPCAD B source code and SAClib as well. SAClib is a C++ library and QEPCAD is a C++ program which uses it. SAClib has a lot of functions which are in Maxima, in particular stuff for manipulating polynomials. It seems plausible that SAClib could be reimplemented to punt to Maxima (although as usual probably the last 10% would take forever). Then presumably QEPCAD itself would have to be translated to Maxima, although maybe that could be automated by parsing the C++ code and emitting equivalent Maxima expressions ... just daydreaming. Since all that stuff is C++, it is susceptible to Lisp FFI. Doubtless that's more efficient that calling it as an external program. best Robert Dodier ```
 Re: [Maxima-discuss] Qepmax package: interface to Qepcad From: Richard Fateman - 2014-04-18 18:06:36 ```On 4/18/2014 10:34 AM, Robert Dodier wrote: > On 2014-04-17, Richard Fateman wrote: > >> It may be that SAC-2 is much more efficient in all of these things >> than Maxima, but that is not at all guaranteed. It could be that >> the essential part of QEPcad B can be coded in Maxima's language, >> or coded in Lisp, in a few pages, given that Maxima already >> has most of the major components. > That's an interesting idea. I glanced at the QEPCAD B source code > and SAClib as well. SAClib is a C++ library and QEPCAD is a C++ > program which uses it. SAClib has a lot of functions which are in > Maxima, in particular stuff for manipulating polynomials. It seems > plausible that SAClib could be reimplemented to punt to Maxima This was not what I was suggesting. Rather, the front end would be rewritten in Maxima's language or in Lisp, and would call Maxima (or Lisp). Equivalent functionality is already in there. Saclib presumably has its own memory management (reference counts, if Collins follows the same pattern as his earlier work), and comes with its own baggage. Whether it is fast or not --- I don't know. However, no one else other than Collins' students seem to have used it. e.g. not Singular, CoCoa, NPL, GMP, etc. Replacing calls to Saclib with calls to Lisp sounds like a clumsy way of getting things done. Too many structure reformattings. > (although as usual probably the last 10% would take forever). > Then presumably QEPCAD itself would have to be translated to > Maxima, although maybe that could be automated by parsing the C++ > code and emitting equivalent Maxima expressions ... just daydreaming. > > Since all that stuff is C++, it is susceptible to Lisp FFI. Doubtless > that's more efficient that calling it as an external program. > > best > > Robert Dodier > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/NeoTech > _______________________________________________ > Maxima-discuss mailing list > Maxima-discuss@... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss ```
 Re: [Maxima-discuss] Qepmax package: interface to Qepcad From: Richard Fateman - 2014-04-18 23:59:47 ```perhaps of some interest on this topic.. https://github.com/sagemath/sagelib/blob/master/sage/interfaces/qepcad.py is the python-language interface to qepcad from Sage. There are 520 lines of introductory comments and examples. and probably another 1500 lines of comments, and maybe 500 lines of code. Uses "expect". It looks like qepcad does a bunch of interactive things, not just the "batch" CAD. RJF There areOn 4/18/2014 10:34 AM, Robert Dodier wrote: > On 2014-04-17, Richard Fateman wrote: > >> It may be that SAC-2 is much more efficient in all of these things >> than Maxima, but that is not at all guaranteed. It could be that >> the essential part of QEPcad B can be coded in Maxima's language, >> or coded in Lisp, in a few pages, given that Maxima already >> has most of the major components. > That's an interesting idea. I glanced at the QEPCAD B source code > and SAClib as well. SAClib is a C++ library and QEPCAD is a C++ > program which uses it. SAClib has a lot of functions which are in > Maxima, in particular stuff for manipulating polynomials. It seems > plausible that SAClib could be reimplemented to punt to Maxima > (although as usual probably the last 10% would take forever). > Then presumably QEPCAD itself would have to be translated to > Maxima, although maybe that could be automated by parsing the C++ > code and emitting equivalent Maxima expressions ... just daydreaming. > > Since all that stuff is C++, it is susceptible to Lisp FFI. Doubtless > that's more efficient that calling it as an external program. > > best > > Robert Dodier > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/NeoTech > _______________________________________________ > Maxima-discuss mailing list > Maxima-discuss@... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss ```
 Re: [Maxima-discuss] Qepmax package: interface to Qepcad From: Barton Willis - 2014-04-15 12:25:18 Attachments: Message as HTML ```> Qepmax package, an extension to Maxima to interface with Qepcad B, is available from Github at: Many thanks for this contribution--it could be quite useful. When I tried to load your code, I got an error. I tried using both GCL and CCL. The problem is apparently in the function \$prepare_for_qepcad: (defun \$prepare_for_qepcad () (setf (get '%and 'strsym) '(#\ #\/ #\\ #\ )) ;; <--- GCL and CCL both think something is wrong here (setf (get '%or 'strsym) '(#\ #\\ #\/ #\ )) (setq *mtimes_char* *mtimes_char_qepcad*) t) Specifically: (%i36) :lisp(load "qepmax-support.lisp" :print t) #<"MAXIMA" package> *MTIMES_CHAR_MAXIMA* *MTIMES_CHAR_QEPCAD* *MTIMES_CHAR* Maxima encountered a Lisp error: Error in CONDITIONS::CLCS-LOAD [or a callee]: "/usr/share/locale/RELATIVE/en/LC_MESSAGES/maxima.mo" is an illegal character name. --Barton ________________________________ ```
 Re: [Maxima-discuss] Qepmax package: interface to Qepcad From: 本田康晃 - 2014-04-15 15:39:36 Attachments: Message as HTML ```Dear Barton san, Thanks for the bug report. I have tested with Closure Common Lisp (which I suppose you refer to by 'ccl') on Mac OS X 10.9.2. It works for me. Could you tell me which version of ccl do you use? Also, your error message seems to have something to do with locale. Could you tell me the result of % echo \$LANG in your shell? Thanks and best regards, Yasuaki Honda, Chiba, Japan Maxima 5.33.0 http://maxima.sourceforge.net using Lisp Clozure Common Lisp Version 1.9-r15758 (DarwinX8632) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) load(qepmax); Loading maxima-grobner \$Revision: 1.6 \$ \$Date: 2009-06-02 07:49:49 \$ (%o1) /Users/yasube/Programming/qepmax/qepmax.mac (%i2) qe([[A,x]],x>0 %implies x^3>0); (%o2) true (%i3) qe([[A,x]],x>0 %implies a*x^3+b>0); (%o3) (a >= 0) %and ((a > 0) %or (b > 0)) %and (b >= 0) 2014-04-15 21:25 GMT+09:00 Barton Willis : > > Qepmax package, an extension to Maxima to interface with Qepcad B, is > available from Github at: > > > Many thanks for this contribution--it could be quite useful. When I > tried to load your code, I got an > > error. I tried using both GCL and CCL. The problem is apparently in the > function \$prepare_for_qepcad: > > > (defun \$prepare_for_qepcad () > (setf (get '%and 'strsym) '(#\ #\/ #\\ #\ )) ;; <--- GCL and CCL both > think something is wrong here > (setf (get '%or 'strsym) '(#\ #\\ #\/ #\ )) > (setq *mtimes_char* *mtimes_char_qepcad*) > t) > > > Specifically: > > > (%i36) :lisp(load "qepmax-support.lisp" :print t) > #<"MAXIMA" package> > > > > *MTIMES_CHAR_MAXIMA* > > *MTIMES_CHAR_QEPCAD* > *MTIMES_CHAR* > Maxima encountered a Lisp error: > Error in CONDITIONS::CLCS-LOAD [or a callee]: > "/usr/share/locale/RELATIVE/en/LC_MESSAGES/maxima.mo" is an illegal > character name. > > --Barton > > ------------------------------ > > ```
 Re: [Maxima-discuss] Qepmax package: interface to Qepcad From: Robert Dodier - 2014-04-15 15:42:26 ```On 2014-04-15, Barton Willis wrote: > (defun \$prepare_for_qepcad () > (setf (get '%and 'strsym) '(#\ #\/ #\\ #\ )) ;; <--- GCL and CCL both think something is wrong here > (setf (get '%or 'strsym) '(#\ #\\ #\/ #\ )) Maybe the first and last characters want to be #\Space. Just guessing. Maybe it's simpler and clearer to write (setf (...) (coerce " /\ " 'list)) (setf (...) (coerce " \/ " 'list)) ?? best Robert Dodier ```
 Re: [Maxima-discuss] Qepmax package: interface to Qepcad From: 本田康晃 - 2014-04-19 00:49:23 Attachments: Message as HTML ```Dear Robert san, Barton san, maxima users, I just modified the code as suggested by Robert san, in Github at https://github.com/YasuakiHonda/qepmax As I could not repro the bug Barton san has encountered, I cannot guarantee this fixes the issue, but worth a try. Thanks and best regards, Yasuaki Honda, Chiba, Japan 2014-04-16 0:41 GMT+09:00 Robert Dodier : > On 2014-04-15, Barton Willis wrote: > > > (defun \$prepare_for_qepcad () > > (setf (get '%and 'strsym) '(#\ #\/ #\\ #\ )) ;; <--- GCL and CCL both > think something is wrong here > > (setf (get '%or 'strsym) '(#\ #\\ #\/ #\ )) > > Maybe the first and last characters want to be #\Space. Just guessing. > Maybe it's simpler and clearer to write > > (setf (...) (coerce " /\ " 'list)) > (setf (...) (coerce " \/ " 'list)) > > ?? > > best > > Robert Dodier > > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/NeoTech > _______________________________________________ > Maxima-discuss mailing list > Maxima-discuss@... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > ```