Hi Bill,
I threw together a Sage package. (fricas-1.0.6.p0.spkg,
http://www.mediafire.com/file/whwmdzfimg2) The big change is that the
new version of fricas does not install an 'axiom' script. This makes
sense to me. I assume that if someone wanted to, they could install
axiom into sage as an (separate) optional package. The install worked
but there were a few errors that came up in testing. They seem to be
related to expect.
I found these running sage -t --optional fricas.py which gave the result:
......
traceback ommited
.....
2 items had failures:
2 of 21 in __main__.example_0
2 of 8 in __main__.example_11
***Test Failed*** 4 failures.
For whitespace errors, see the file
/home/adamwebb/local/sage/tmp/.doctest_fricas.py
[8.0 s]
exit code: 1024
----------------------------------------------------------------------
The following tests failed:
sage -t --optional "devel/sage-main/build/sage/interfaces/fricas.py"
from __main__.example_11
sage: from sage.interfaces.fricas import __doctest_cleanup
sage: a = FriCAS()
sage: two = a(2) #optional - fricas <===== gives error
sage: a.is_running() #optional - fricas
True
sage: __doctest_cleanup()
sage: a.is_running()
False
The traceback is:
sage: from sage.interfaces.fricas import __doctest_cleanup
sage: a = FriCAS()
sage: two = a(2)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/home/adamwebb/.sage/temp/haso220w/18889/_home_adamwebb__sage_init_sage_0.py
in <module>()
/home/adamwebb/local/sage/local/lib/python2.5/site-packages/sage/interfaces/expect.pyc
in __call__(self, x, name)
1024 return cls(self, x, name=name)
1025 try:
-> 1026 return self._coerce_from_special_method(x)
1027 except TypeError:
1028 raise
/home/adamwebb/local/sage/local/lib/python2.5/site-packages/sage/interfaces/expect.pyc
in _coerce_from_special_method(self, x)
1048 s = '_gp_'
1049 try:
-> 1050 return (x.__getattribute__(s))(self)
1051 except AttributeError:
1052 return self(x._interface_init_())
/home/adamwebb/local/sage/local/lib/python2.5/site-packages/sage/structure/sage_object.so
in sage.structure.sage_object.SageObject._axiom_
(sage/structure/sage_object.c:3875)()
/home/adamwebb/local/sage/local/lib/python2.5/site-packages/sage/structure/sage_object.so
in sage.structure.sage_object.SageObject._interface_
(sage/structure/sage_object.c:2853)()
/home/adamwebb/local/sage/local/lib/python2.5/site-packages/sage/interfaces/expect.pyc
in __call__(self, x, name)
1022
1023 if isinstance(x, basestring):
-> 1024 return cls(self, x, name=name)
1025 try:
1026 return self._coerce_from_special_method(x)
/home/adamwebb/local/sage/local/lib/python2.5/site-packages/sage/interfaces/expect.pyc
in __init__(self, parent, value, is_name, name)
1426 except (TypeError, KeyboardInterrupt, RuntimeError,
ValueError), x:
1427 self._session_number = -1
-> 1428 raise TypeError, x
1429 self._session_number = parent._session_number
1430
TypeError: Unable to start axiom because the command 'axiom -nox
-noclef' failed.
From __main__.example_0
sage: a = fricas(x+2); a
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/home/adamwebb/.sage/temp/haso220w/18889/_home_adamwebb__sage_init_sage_0.py
in <module>()
/home/adamwebb/local/sage/local/lib/python2.5/site-packages/sage/interfaces/expect.pyc
in __call__(self, x, name)
1024 return cls(self, x, name=name)
1025 try:
-> 1026 return self._coerce_from_special_method(x)
1027 except TypeError:
1028 raise
/home/adamwebb/local/sage/local/lib/python2.5/site-packages/sage/interfaces/expect.pyc
in _coerce_from_special_method(self, x)
1048 s = '_gp_'
1049 try:
-> 1050 return (x.__getattribute__(s))(self)
1051 except AttributeError:
1052 return self(x._interface_init_())
/home/adamwebb/local/sage/local/lib/python2.5/site-packages/sage/structure/sage_object.so
in sage.structure.sage_object.SageObject._fricas_
(sage/structure/sage_object.c:4113)()
/home/adamwebb/local/sage/local/lib/python2.5/site-packages/sage/symbolic/expression.so
in sage.symbolic.expression.Expression._interface_
(sage/symbolic/expression.cpp:3275)()
/home/adamwebb/local/sage/local/lib/python2.5/site-packages/sage/structure/sage_object.so
in sage.structure.sage_object.SageObject._interface_
(sage/structure/sage_object.c:2716)()
/home/adamwebb/local/sage/local/lib/python2.5/site-packages/sage/structure/sage_object.so
in sage.structure.sage_object.SageObject._fricas_init_
(sage/structure/sage_object.c:4164)()
TypeError: _interface_init_() takes exactly one argument (0 given)
cheers,
Adam Webb
__________________________________________________________________
The new Internet Explorer® 8 - Faster, safer, easier. Optimized for
Yahoo! Get it Now for Free! at
http://downloads.yahoo.com/ca/internetexplorer/
The conversion of Sage expressions to "axiom" syntax is not done in
the axiom/fricas.py interface but in several other places in Sage. You
might want to try
sage: set_verbose(10)
to see more of what is going on.
>
> A fricas specific thing seems to cause two errors. The returned type
> is different in fricas than from axiom in some cases.
>
> example 1:
> sage: a = axiom('Fraction Integer')
> sage: print a
> Fraction Integer
>
> sage: b = fricas('Fraction Integer')
> sage: print b
> Fraction(Integer)
>
> When the type is one word like 'Integer' they give the same string.
>
This is an expected difference between Axiom and FriCAS.
> ...
Regards,
Bill Page.
> Tuple(PositiveInteger) <======== expected result is Tuple
> PositiveInteger
>
> There is a specific line in the type() method of
> axiom.PanAxiomElement that evaluates self.name() and receives a string
> from axiom or fricas which contains the type information. I am
> guessing that it is also used to make the print string. The change
> breaks the tests. Is the change intentional or accidental? Someone
> from fricas will have to say.
>
The change is intentional. This change is intended to make
parsing of FriCAS output easier. Compare sin x + 1 and
sin(x) + 1. Sage needs to adjust tests.
--
Waldek Hebisch
heb...@math.uni.wroc.pl