[GiNaC-list] Parse error involving factorial symbol
Roberto Bagnara
bagnara at cs.unipr.it
Fri May 14 22:36:13 CEST 2021
On 5/14/21 3:33 PM, Vladimir V. Kisil wrote:
>>>>>> On Fri, 14 May 2021 15:08:09 +0200, Roberto Bagnara <bagnara at cs.unipr.it> said:
>
> RB> On 5/14/21 9:52 AM, Vladimir V. Kisil wrote:
> >> Dear Roberto! It seems that Ginsh and parser in GiNaC are
> >> implemented differently. Ginsh understands postfix factorial
> >> notation like "3!" but GiNaC parser is not. GiNaC parser is
> >> still happy with "factorial(3)". Best wishes, Vladimir
> >>
>
> RB> Thanks Vladimir! But please help me understand: I did not
> RB> change anything in the part of the code invoking the GiNaC
> RB> parser, and I did not change the tests. So the situation you
> RB> are describing, i.e., GiNaC parser not understanding postfix
> RB> factorial notation, is something that changed from, say, 10
> RB> years ago. In other words, do you agree that, say, 10 years
> RB> ago, the GiNaC parser was accepting that notation?
>
> It seems that before 2008-08-21 GiNaC and Ginsh had used the same
> parser, which Ginsh is using till now. After a patch they diverged in
> this respect. So it is quite well possible that your code was running
> with the old version of GiNaC but cannot do this now without some alteration.
Dear Vladimir,
This explains everything. Now I am investigating failures in the regression
test-suite. One of the most promising examples for my diagnosis efforts
is this:
simplification for output of -1+1/12*sqrt(sqrt(3)*sqrt(12))*sqrt(12)+1/12*sqrt(-sqrt(3)*sqrt(12))*sqrt(12)
was expected to be -1+(1/2+1/2*I)*sqrt(2)
but resulted in -1+(1/2+1/2*I)*4^(1/4)
From what you write I gather that back in 2008, or even before,
we obtained sqrt(2) where we now obtain 4^(1/4).
Thanks,
Roberto
--
Prof. Roberto Bagnara
Applied Formal Methods Laboratory
Department of Mathematical, Physical and Computer Sciences
University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it
More information about the GiNaC-list
mailing list