From cedricstuderus at gmail.com Sun Dec 4 12:59:53 2011 From: cedricstuderus at gmail.com (Cedric Studerus) Date: Sun, 4 Dec 2011 12:59:53 +0100 Subject: [GiNaC-devel] bugs related to parser Message-ID: Dear GiNaC developer, I'm using GiNaC version 1.6.2 with compiler gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2 When working with the parser to read in user defined functions from strings I noticed 3 things: 1) parsing a user defined function (declared to have 1 argument) from a string does not throw an exception when the string contains this function with zero arguments. 2) parsing products of user defined non-commutative functions returns a commutative product 3) The parser accepts userdefined functions with zero arguments and parsing such a function does not throw when there is 1 argument. I have attached a small file "main.cpp" such that you can reproduce this behavior. I'm using these user defined functions with zero arguments but it looks to me like a hack and I would like to know if you are going to allow them ( e.g. with macro definition) or if you completely suppress them in future releases of GiNaC. Thank you very much! Cedric Studerus -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: main.cpp Type: text/x-c++src Size: 1661 bytes Desc: not available URL: From alexei.sheplyakov at gmail.com Tue Dec 6 06:39:27 2011 From: alexei.sheplyakov at gmail.com (Alexei Sheplyakov) Date: Tue, 6 Dec 2011 07:39:27 +0200 Subject: [GiNaC-devel] bugs related to parser In-Reply-To: References: Message-ID: <20111206053927.GA7764@vargsbox.jinr.ru> Hello, On Sun, Dec 04, 2011 at 12:59:53PM +0100, Cedric Studerus wrote: > When working with the parser to read in user defined functions from strings > I noticed 3 things: > > 1) > parsing a user defined function (declared to have 1 argument) from a string > does not throw an exception when the string contains this function with > zero arguments. This looks like a bug. > > 2) > parsing products of user defined non-commutative functions returns a > commutative product Built-in GiNaC parser does not handle non-commutative products. You can either 1) Transform all non-commutative products into some dummy function(s), and explain the parser how to handle them (i.e. define and set the custom prototype table). 2) Use the archiving facility to (de)serialize expressions. > 3) > The parser accepts userdefined functions with zero arguments and parsing > such a function does not throw when there is 1 argument. > > > I have attached a small file "main.cpp" such that you can reproduce this > behavior. > > I'm using these user defined functions with zero arguments but it looks to > me like a hack and I would like to know if you are going to allow them ( > e.g. with macro definition) or if you completely suppress them in future > releases of GiNaC. Zero-argument functions sound a bit strange (why don't you use symbols instead?), and I doubt we actually support them (they might work by accident). I don't think we will disable defining zero-arguments functions on purpose: preventing users from doing silly things typically prevents them from doing smart things, too. However I doubt zero-argument functions will be supported properly (unless someone sends a patch). Best regards, Alexei From git at ginac.de Thu Dec 8 18:10:54 2011 From: git at ginac.de (Richard B. Kreckel) Date: Thu, 8 Dec 2011 18:10:54 +0100 (CET) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, master, updated. release_1-4-0-365-ga104ecb Message-ID: <20111208171055.09999F0018D@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, master has been updated via a104ecb34a015fc40a4bdc16ae6ea038ecb8c55d (commit) from dadfd94652601011351c18ae020c5b473fc8e0a3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a104ecb34a015fc40a4bdc16ae6ea038ecb8c55d Author: Richard B. Kreckel Date: Thu Dec 8 16:59:16 2011 +0000 Documentation: Update branch cut convention Now that C++11 is out, there is no more need for oracling about how it might eventually standardize the branch cuts of elementary and inverse trigonometric and hyperbolic functions. ----------------------------------------------------------------------- Summary of changes: doc/tutorial/ginac.texi | 27 +++++++++++++-------------- 1 files changed, 13 insertions(+), 14 deletions(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations