On Thu, Aug 27, 2009 at 1:55 PM, Martin Rubey wrote: > > Bill Page writes: > >> What version of Sage are you using? What patches applied >> (if any)? > > 4.0.2, combinat branch, patches 6318 applied. >
Ok, thanks. I am currently testing with Sage 4.1.1. Without patch 6318, I get the error that I reported. As Adam said, 6318 patch corrects this error. But if I install clisp and fricas-1.0.3.p0 as some other people suggested in this thread I still see some errors in the doc tests. Specifically: wsp...@debian:~/sage-4.1.1$ ./sage ---------------------------------------------------------------------- | Sage Version 4.1.1, Release Date: 2009-08-14 | | Type notebook() for the GUI, and license() for information. | ---------------------------------------------------------------------- sage: b=fricas('x^2 + y^2 + 1/2') sage: b.type() Polynomial Fraction Integer sage: b.sage() ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (6, 0)) --------------------------------------------------------------------------- NotImplementedError Traceback (most recent call last) /home/wspage/.sage/temp/debian/477/_home_wspage__sage_init_sage_0.py in <module>() /home/wspage/sage-4.1.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc in sage(self) 1576 Rational Field 1577 """ -> 1578 return self._sage_() 1579 1580 def __repr__(self): /home/wspage/sage-4.1.1/local/lib/python2.6/site-packages/sage/interfaces/axiom.pyc in _sage_(self) 878 elif type.startswith('Polynomial'): 879 from sage.rings.all import PolynomialRing --> 880 base_ring = P(type.lstrip('Polynomial '))._sage_domain() 881 vars = str(self.variables())[1:-1] 882 R = PolynomialRing(base_ring, vars) /home/wspage/sage-4.1.1/local/lib/python2.6/site-packages/sage/interfaces/fricas.pyc in _sage_domain(self) 284 return P(name)._sage_domain().fraction_field() 285 --> 286 raise NotImplementedError 287 288 class FriCASFunctionElement(PanAxiomFunctionElement): NotImplementedError: sage: -- Looking at the code I can see this is because the fricas.py interface (which depends on the axiom.py interface) assumes that the type will be expressed as a fully parenthesized string like this: Polynomial(Fraction(Integer)) but this only applies in later versions of FriCAS. So this patch really does depend on installing a later version of FriCAS than what is available at the Sage web site. Also, if I try to install the newer version of FriCAS included with patch 6517: $ wget http://www.mediafire.com/file/im5zd201mh0/fricas-1.0.7.p0.spkg $ ./sage -f fricas-1.0.7.p0.spkg I get an error because by default the fricas configure and make files trt to build the Aldor interface and it fails. ... touch -t 199901010000 gendeps/.dir DAASE=/home/wspage/sage-4.1.1/spkg/build/fricas-1.0.7.p0/build-dir/target/i686-pc-linux /home/wspage/sage-4.1.1/spkg/build/fricas-1.0.7.p0/build-dir/target/i686-pc-linux/bin/AXIOMsys < mkinit.lsp > tmp/mkinit.log test -f initlist.lst sed -e 's/^/initaxiom /' initlist.lst > libaxiom.lst for i in lang; do echo "lang $i" >> libaxiom.lst; done for i in minimach boolean0 attrib; do echo "base $i" >> libaxiom.lst; done for i in subsetc; do echo "base $i" >> libaxiom.lst; done for i in ; do echo "axiom $i" >> libaxiom.lst; done for i in axextend axlit; do echo "aldorext $i" >> libaxiom.lst; done aldor -mno-abbrev -mno-mactext -laldor -fx -dTRACE ../../../src/src/aldor/cliques.as /home/wspage/aldor-src/aldor/install/aldor/linux/1.1.0/lib/libfoam.a(bigint.o): In function `bintRadixScanFrString': /home/wspage/aldor-src/aldor/aldor/lib/libfoam/links/bigint.c:567: undefined reference to `log' collect2: ld returned 1 exit status #1 (Fatal Error) Linker failed. Command was: gcc cliques.o aldormain.o -L. -L/home/wspage/aldor-src/aldor/install/aldor/linux/1.1.0/share/lib -L/home/wspage/aldor-src/aldor/install/aldor/linux/1.1.0/lib -o cliques -laldor -lfoam #1 (Warning) Removing file `cliques.o'. #2 (Warning) Removing file `aldormain.o'. make[2]: *** [cliques] Error 1 make[2]: Leaving directory `/home/wspage/sage-4.1.1/spkg/build/fricas-1.0.7.p0/build-dir/src/aldor' make[1]: *** [all-aldor] Error 2 make[1]: Leaving directory `/home/wspage/sage-4.1.1/spkg/build/fricas-1.0.7.p0/build-dir/src' make: *** [all-src] Error 2 *********************************************************** Failed to make FriCAS. *********************************************************** real 11m24.582s user 10m15.414s sys 0m50.943s sage: An error occurred while installing fricas-1.0.7.p0 Please email sage-devel http://groups.google.com/group/sage-devel explaining the problem and send the relevant part of of /home/wspage/sage-4.1.1/install.log. Describe your computer, operating system, etc. If you want to try to fix the problem, yourself *don't* just cd to /home/wspage/sage-4.1.1/spkg/build/fricas-1.0.7.p0 and type 'make'. Instead type "/home/wspage/sage-4.1.1/sage -sh" in order to set all environment variables correctly, then cd to /home/wspage/sage-4.1.1/spkg/build/fricas-1.0.7.p0 (When you are done debugging, you can type "exit" to leave the subshell.) wsp...@debian:~/sage-4.1.1$ -- In fact I have not been able to build the Aldor interface on this system with this version of FriCAS for the last several revisions. Unfortunately I have not had time to try to figure out why it is failing. Maybe for now the fricas-1.0.7.p0.spkg script should explicitly disable aldor? >>> It might make sense to expand FriCASElement a little. Currently we have: >>> >>> P = self._check_valid() >>> name = str(self) >>> if name == 'Integer': >>> from sage.rings.all import ZZ >>> return ZZ >>> elif name == 'DoubleFloat': >>> from sage.rings.all import RDF >>> return RDF >>> elif name.startswith('Fraction('): >>> name = name.lstrip('Fraction(') >>> name = name.rstrip(')') >>> return P(name)._sage_domain().fraction_field() >>> >>> raise NotImplementedError >>> >>> Types that often occur in FriCAS, might have an equivalent in sage, and >>> come to my mind right now are: >>> >>> Polynomial(YourFavoriteRing) [polynomials with arbitrary many >>> variables] >>> Expression(Integer) [probably SymbolicRing] >>> PrimeField(yourFavouritePrime) [probably >>> Integers(yourFavouritePrime)] >>> IntegerMod(yourFavouriteNaturalNumber) [probably >>> Integers(yourFavouriteNaturalNumber)] >>> AlgebraicNumber [probably QQbar] >>> Float [RR with given precision] >>> Complex(YourFavoriteCommutativeRing) [no idea] > > ... > >> Yes, I think that would be an excellent idea. > > Well, I just realized that the axiom interface was done differently: > you used INFORM from axiom there. That worked reasonably well, > as far as I remember. I think it originally parsed the Type: part of the output. But that was inadequate because at least in the original Axiom this was sometimes truncated. At some point I changed the axiom.py interface to use unparse(x::INFORM) that why it does now. But the output of unparse has also changed recently in FriCAS and OpenAxiom to include parenthesis and other minor enhancements. I think the axiom.py and fricas.py interfaces do not quite properly take account of this. As I said above the interpretation of the unparse string in the fricas.py interface is not very robust and assumes that these parenthesis are present. > > And now I also remember that some time ago I thought that the best > way to have a (fricas) package SageForm, that converts InputForm > into something appropriate for sage. That might be nice. For sure this has to be standardized and maintained in either in the FriCAS project or in Sage. Personally, I was in favor of passing the SExpression version of INFORM to Sage and then using some kind of lisp-like parser in the axiom.py interface. In principle this would have a slightly lower parsing overhead. > > Doing the conversion separately for the type (as above) and the > element itself seems a bit like doing things twice, doesn't it? > Well given that things are passed as strings, parsing and re-interpretation is unavoidable. Regards, Bill Page. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---