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

It is possible to use the Aldor compiler WebSite:www.aldor.org to compile functions which you then can use Axiom. For details see:

Support for domains and packages is now in the testing stage. The Axiom/Aldor interface works with the open source version of Axiom (as of Patch-44) by Peter Broadbery. Thanks Peter! But note that the Aldor interface itself is not part of the current Axiom source distribution.

Ralf Hemmecke updated the work of Peter Broadbery and integrated it into FriCAS. In FriCAS you can now simply say:

  ./configure --enable-aldor && make && make install


which will compile a file libaxiom.al and thus make it possible to use the Aldor compiler for FriCAS. Of course, you must have the latest aldor compiler installed. Due to some licensing issues you need Internet access during "make". It will fetch some aldor files that are necessary for the compilation. See https://github.com/hemmecke/fricas-svn/blob/master/src/aldor/Makefile.in#L164 for more details.

There is just one issue left that is connected to either the Aldor compiler or FriCAS. See Issues and links therein for more details.

A new version of Axiom based on axiom--main--1--Patch-44 and Peter's interface has been installed on MathAction including FriCASWiki. So you can use Aldor on this website.

## Aldor on MathAction

This is a simple example of how to use Aldor on MathAction.

To compile an Aldor function, for example this non-recursive method to compute a factorial, in MathAction the Aldor code appears between \begin{aldor}[fact] ... \end{aldor} tags on the edit page.

aldor
#include "axiom.as"
fact(n: PositiveInteger): PositiveInteger == {
n <= 1 => 1;
res: PositiveInteger := 1;
while n > 1 repeat {
res := res * n;
n := n-1;
}
res
}
aldor
   Compiling FriCAS source code from file
/var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/fact.as using
AXIOM-XL compiler and options
-O -Fasy -Fao -Flsp -laxiom -Mno-ALDOR_W_WillObsolete -DAxiom -Y $AXIOM/algebra -I$AXIOM/algebra
Use the system command )set compiler args to change these
options.
The )library system command was not called after compilation.

The optional [name] parameter is used to name the compiled library file which can be used later on another page in a )library command.

Now call the function in Axiom as you would any other. First get the library

fricas
)lib fact
fricas
Reading /var/aw/var/LatexWiki/fact.asy

Now we test it:

fricas
fact(11)
>> System error:
#<SB-SYS:FD-STREAM for "file /var/aw/var/LatexWiki/fact.fasl" {1004AC7CC3}> is
a fasl file compiled with SBCL 1.0.47, and can't be loaded into SBCL 1.1.1.

If you care to, you can also look at the Aldor source generated lisp code and the final compiled result

Here is an example from WebSite:www.aldor.org/docs/HTML/chap18.html

aldor
#include "axiom.as"
#pile
MatrixSymmetry(R:Field): with
symmetricPart : Matrix R -> Matrix R
++ symmetricPart(M)' returns a symmetric
++ matrix S', computed as (M + transpose M)/2'.
++ The difference M - S' is antisymmetric.
antisymmetricPart : Matrix R -> Matrix R
++ antisymmetricPart(M)' returns an antisymmetric
++ matrix A', computed as (M - transpose M)/2'.
++ The difference M - A' is symmetric.
import from R, Integer
symmetricPart(m: Matrix R): Matrix R ==
mt := transpose m
inv(2::R) * (m + mt)
antisymmetricPart(m: Matrix R): Matrix R ==
mt := transpose m
inv(2::R) * (m - mt)
aldor
   Compiling FriCAS source code from file
/var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/2504912445765138530-25px004.as
using AXIOM-XL compiler and options
-O -Fasy -Fao -Flsp -laxiom -Mno-ALDOR_W_WillObsolete -DAxiom -Y $AXIOM/algebra -I$AXIOM/algebra
Use the system command )set compiler args to change these
options.
The )library system command was not called after compilation.

fricas
m := matrix[[1/2,1/3],[1/4,1/5]]
 (1)
Type: Matrix(Fraction(Integer))
fricas
s := symmetricPart m
There are no library operations named symmetricPart
Use HyperDoc Browse or issue
)what op symmetricPart
to learn if there is any operation containing " symmetricPart "
in its name.
Cannot find a definition or applicable library operation named
symmetricPart with argument type(s)
Matrix(Fraction(Integer))
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need. See also the more complex examples: ## More Examples Having put the following simple domain in a file test.as :: aldor #include "axiom.as" Test: with { fact: PositiveInteger -> PositiveInteger } == add { fact(n: PositiveInteger): PositiveInteger == { n <= 1 => 1; res: PositiveInteger := 1; while n > 1 repeat { res := res * n; n := n-1; } res } } aldor  Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/4005392542604933580-25px006.as using AXIOM-XL compiler and options -O -Fasy -Fao -Flsp -laxiom -Mno-ALDOR_W_WillObsolete -DAxiom -Y$AXIOM/algebra -I $AXIOM/algebra Use the system command )set compiler args to change these options. The )library system command was not called after compilation. I compiled it with Aldor as above. In Axiom you should do:  )co test.as  fricas )sh Test The )show system command is used to display information about types or partial types. For example, )show Integer will show information about Integer . Test is not the name of a known type constructor. If you want to see information about any operations named Test , issue )display operations Test fricas fact(5)$Test
Test is not a valid type.

Known Problems

see Issue #219

Here is a precomputed libaxiom.al that has been produced with src_aldor2.tgz and FriCAS (rev 286).

Building the Aldor interface --Bill Page, Mon, 01 Aug 2011 08:28:48 -0700 reply
This page is quite out of date. FriCAS configure now has an option:
 # configure --enable-aldor


If aldor is installed and working on your system, then the above command will build the interface. I build FriCAS using SBCL but there seems to be a problem introduced with the most recent release of FriCAS, so you should use an earlier release such as:

  svn co https://fricas.svn.sourceforge.net/svnroot/fricas/releases/1.1.2 fricas-1.1.2


 Subject:   Be Bold !! ( 14 subscribers )