login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for #217 Invalid variables revision 2 of 2

1 2
Editor: test1
Time: 2017/02/23 18:56:27 GMT+0
Note:

added:

From test1 Thu Feb 23 18:56:27 +0000 2017
From: test1
Date: Thu, 23 Feb 2017 18:56:27 +0000
Subject: 
Message-ID: <20170223185627+0000@axiom-wiki.newsynthesis.org>

Status: open => rejected 


Submitted by : (unknown) at: 2007-11-17T22:10:22-08:00 (17 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

I'm afraid I found my first severe compiler error. Unfortunately, I do not know yet how to workaround. I cannot even see how to localize it.

fricas
(1) -> <spad>
fricas
)abbrev package TEST Test
Test(): Exports == Implementation where
NNI ==> NonNegativeInteger
Exports == with
subsetToComp: List Integer -> List NNI
Implementation == add
subsetToComp v == res: List NNI := []</spad>
fricas
Compiling FriCAS source code from file 
      /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/125188740751070590-25px001.spad
      using old system compiler.
   TEST abbreviates package Test 
------------------------------------------------------------------------
   initializing NRLIB TEST for Test 
   compiling into NRLIB TEST 
   compiling exported subsetToComp : List Integer -> List NonNegativeInteger
      TEST;subsetToComp;LL;1 is replaced by LETres 
Time: 0.01 SEC.
(time taken in buildFunctor: 0)
;;; *** |Test| REDEFINED
;;; *** |Test| REDEFINED Time: 0 SEC.
Cumulative Statistics for Constructor Test Time: 0.01 seconds
finalizing NRLIB TEST Processing Test for Browser database: --->-->Test(constructor): Not documented!!!! --->-->Test((subsetToComp ((List (NonNegativeInteger)) (List (Integer))))): Not documented!!!! --->-->Test(): Missing Description ; compiling file "/var/aw/var/LatexWiki/TEST.NRLIB/TEST.lsp" (written 19 FEB 2023 07:17:13 PM):
; /var/aw/var/LatexWiki/TEST.NRLIB/TEST.fasl written ; compilation finished in 0:00:00.018 ------------------------------------------------------------------------ Test is now explicitly exposed in frame initial Test will be automatically loaded when needed from /var/aw/var/LatexWiki/TEST.NRLIB/TEST

fricas
)set stream calculate 3
s := coefficients series(q^(m-i),q=1)

\label{eq1}\left[ 1, \:{m - i}, \:{\frac{{{m}^{2}}+{{\left(-{2 \  i}- 1 \right)}\  m}+{{i}^{2}}+ i}{2}}, \: \ldots \right](1)
Type: Stream(Expression(Integer))
fricas
)lib TEST
Test is already explicitly exposed in frame initial Test will be automatically loaded when needed from /var/aw/var/LatexWiki/TEST.NRLIB/TEST eval(s.2,i,%A)

\label{eq2}m - \%A(2)
Type: Expression(Integer)
fricas
eval(s.2,i,%B)

\label{eq3}m - \%B(3)
Type: Expression(Integer)

Obviously, the final lines should read m-%A and m-%B. The error seems to go away if the series is generated after the )lib command or if the series contains no other variables apart from q and i. Furthermore, %A seems to be somehow special, but I cannot reproduce this peculiarity here.

I would be very grateful if somebody could at least localize the error, so that I can determine when it happens. This bug has unfortunately tremendous implications, for example, a product like \prod_{i=1}^n f(i) is replaced by f(i)^n...

If we issue the )lib command before defining any variables, the problem goes away.

Actually core of the problem is how Expression works. More precisely Expression uses Kernel and Kernels are cached inside SortedCache?. In order to force use of newly loaded domain )lib has to invalidate all existing domains, including SortedCache? storing cached kernels. In effect all Kernel-s (hence Expression-s) stored in variables became invalid. In many cases those invalid expressions still give sensible results so one may be fooled to think that expressions should work after )lib, but this is not the case...

Status: open => rejected