Ralf Hemmecke wrote: > > Hello Waldek, > > The program (at the end) is malformed (if I am not wrong), but it took > me a while to see where the error is. Compiling it gives: > > (1) -> )co qbug.spad > Compiling FriCAS source code from file > /home/hemmecke/backup/git/fricas/qbug.spad using old system > compiler. > IQETOOL abbreviates package InnerQEtaTools > ------------------------------------------------------------------------ > initializing NRLIB IQETOOL for InnerQEtaTools > compiling into NRLIB IQETOOL > compiling exported etaQuotientGenerators : () -> List Vector Integer > > >> System error: > The value (|SquareMatrix| |n| (|Fraction| (|Integer|))) is not of > type SYMBOL. > > And more confusingly, when removing the line "aa: SQ ...", the spad > compiler does not complain at all. > > Of course the program compiles fine, if I add the missing "==" to the line > > inverseAMatrix(): SQ > > Clearly, the error message here is not very helpful. > > What actually bothers me most, is that the compiler does not complain > about a missing "==". Since there is a block (call it B) following > "inverseAMatrix(): SQ" and B is indended, it is basically the same as > > inverseAMatrix(): SQ B > > So that looks like a declaration > > inverseMatrix: () -> SQ B > > which might be fine if it were known what juxtaposition of SQ and B > actually means for the compiler. But that juxtaposition of > SquareMatrix(n, Q) with something does not make sense? What is the > compiler throwing in to be able to compile that line(s)?
Well, as you noted, SQ B _potentially_ makes sense, so compiler can not complain about missing '=='. Of course it should not pass type checking. Unfortunately, currently in many places compiler just assumes that types are type correct. It looks that original authors assumed that types will be checked later. In your case error is detected when Spad compiler tries to use the type. AFAICS this error is not due to checking, but simply the internal form of type is not the one which can be handled. I will try to add sensible check in this case. However, type checking of types is tricky because of possible recursion. So we must accept various undefined things hoping that they will be defined later. > Ralf > > ------------------------------------------------------------ > N ==> NonNegativeInteger > Z ==> Integer > Q ==> Fraction Z > SQ ==> SquareMatrix(n, Q) > VZ ==> Vector Z > > )abbrev package IQETOOL InnerQEtaTools > InnerQEtaTools(m: N, divs: List Z, n: N): with > etaQuotientGenerators: () -> List VZ > == add > inverseAMatrix(): SQ > g(di: Z, dj: Z): Z == gcd(di, (m exquo dj)::Z) > a: SQ := matrix [[_ > di/dj * ((g(dj, di)^2 - dj) / (24*g(di, di))) _ > for dj in rest divs] for di in rest divs] > inverse(a)::SQ > > -- exported functions > etaQuotientGenerators(): List VZ == > aa: SQ := inverseAMatrix() > empty() > > -- > You received this message because you are subscribed to the Google Groups > "FriCAS - computer algebra system" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/fricas-devel. > For more options, visit https://groups.google.com/d/optout. > -- Waldek Hebisch -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/fricas-devel. For more options, visit https://groups.google.com/d/optout.
