Packages in AXIOM

40 views
Skip to first unread message

Esma T

unread,
Oct 19, 2015, 6:15:47 AM10/19/15
to aldor-devel
Hi,

I am working on a paper which has some packages and examples for AXIOM but I don't know how to apply packages in AXIOM. 
I've tried to write a package in interactive Axiom session but it didn't work. 
What should I do?

Best regards,

Esma  

Ralf Hemmecke

unread,
Oct 19, 2015, 6:58:12 AM10/19/15
to aldor...@googlegroups.com
Hi Esma,

I'm the maintainer of the FriCAS-Aldor connection.

FriCAS (http://fricas.github.io) is a fork of AXIOM
(http://axiom-developer.org/) and (up to my knowledge) the only system
that can use Aldor to extend its library.

There is an example at http://axiom-wiki.newsynthesis.org/FormalFraction
. It's a bit old, you have to add the following code into the "add" part
of the FormalFraction domain in order to make it compile in the current
version of FriCAS+Aldor

hashUpdate!(s: HashState, x: %): HashState == {
s := hashUpdate!(s, rep(x).num)$X;
s := hashUpdate!(s, rep(x).den)$X;
s
}

So copy the code from the website put it in a file

formalfraction.as

add the above code and then start fricas and type

)compile formalfraction.as

After successful compilation you should be able to run the following
session:

(1) -> F ==> FormalFraction(Integer)
Type:
Void
(2) -> f: F := 1/2


1
(2) -
2
Type:
FormalFraction(Integer)
(4) -> f := 4/6

4
(4) -
6
Type:
FormalFraction(Integer)

Of course, before the compilation will work, you have to compile FriCAS,
i.e.

./configure --enable-aldor

.

Hope that helps.
Good luck.

Ralf

Esma Tayran

unread,
Oct 19, 2015, 9:50:33 AM10/19/15
to aldor-devel
Hi,

I've copied the code and pasted it on the  LibreOffice Writer and changed the file extension to ".as". But it didn't work again.

Which writing app do I need to use? 

I am new in AXIOM, so hope I don't bother you.

Thanks,

Esma

19 Ekim 2015 Pazartesi 13:15:47 UTC+3 tarihinde Esma Tayran yazdı:

Ralf Hemmecke

unread,
Oct 19, 2015, 12:49:28 PM10/19/15
to Esma Tayran, aldor-devel
> I've copied the code and pasted it on the LibreOffice Writer and
> changed the file extension to ".as".

Huh? Sorry, but LibreOffice isn't the application that you should use
for editing ordinary ASCII text files. A simple editor is enough, emacs,
gedit (https://en.wikipedia.org/wiki/Category:Linux_text_editors)

> But it didn't work again.

Wow! That's a problem description. :-(
What exactly do you want to achieve?

> Which writing app do I need to use?

> I am new in AXIOM, so hope I don't bother you.

You are currently writing to the aldor-devel mailing list. If you want
to learn about AXIOM you should write to the axiom-developer mailing
list. AXIOM is not FriCAS is not Aldor.

Ralf

Esma Tayran

unread,
Oct 19, 2015, 1:05:35 PM10/19/15
to aldor-devel
When I found AXIOM, it seemed relevant with FriCAS and Aldor. But it's ok.

Thank you for help. 

Regards,

Esma

19 Ekim 2015 Pazartesi 13:15:47 UTC+3 tarihinde Esma Tayran yazdı:
Hi,

Waldek Hebisch

unread,
Oct 19, 2015, 3:45:45 PM10/19/15
to aldor...@googlegroups.com
Esma Tayran wrote:
>
> I've copied the code and pasted it on the LibreOffice Writer and changed
> the file extension to ".as". But it didn't work again.
> Which writing app do I need to use?

If you want to use LibreOffice you should look at 'File type'
option in save dialog. There should be something called 'Text'
(as opposed to 'Rich text' or 'Document ...'). It will probably
want to give '.txt' extension to the file so you need to change
it. Note that Axiom syntax was sensitive to indentation, wrong
indentation can cause syntax errors.

Concerning 'didn't work again': I encourage you to read:

www.catb.org/esr/faqs/smart-questions.html

especially part titled 'Be precise and informative about your
problem'. Without details we can not say it you stored file
in wront format, made some error during copy and paste or
maybe do not have installed Aldor interface.

IIUC your immediate problem is that you want to run some
published code. The first step is to identify what you
need to run this code. During nineties Axiom came bundled
with Aldor and the code may either use Axiom syntax or
Aldor syntax. If code uses Axiom syntax, then save it
as a '.spad' file and use compile command:

)compile plik.spad

This does not need Aldor, so should be simpler than Aldor
case. If the code uses Aldor syntax, then it may
be standalone code (which only uses Aldor domains) or
may use Axiom domains. If the code is standalone Aldor
it may be easier to run it in Aldor (without Axiom). As
Ralf wrote currently you can use FriCAS with Aldor
interface. Unless you have an old comercial version of Axiom
which included Aldor as "library compiler" this is
not going to work in other Axiom versions/forks.
To install FriCAS with Aldor you need to follow instructions.
First install Aldor. IIUC you should use version from:

https://github.com/pippijn/aldor

and follow instructions in README.md file there. Then
fetch and compile FriCAS using configure line:

./configure --enable-aldor

Compiling Aldor file will _not_ work before you install
Aldor compiler. And to you Aldor file inside FriCAS
need FriCAS and the interface. You wrote about LibreOffice
but nothing about installation, so it seems that you try
to compile Aldor file without installing Aldor compiler.

>
> I am new in AXIOM, so hope I don't bother you.

The paper is likely to be from time when Axiom was a commercial
product. Now Axiom is open-source, but it is split into
several project. Core Axiom forked twice, so there are
3 different project: Axiom, FriCAS and OpenAxiom. When
core Axiom was freed Aldor became separate project, initially
with restricitve licence. In 2013 Aldor was released under
open-source licence but still is a separete project.
If the paper really use Aldor inside Axiom, than you
either need old commercial version or need to go trough
installing FriCAS with Aldor interface. This
requires some work and there may be some problems on the
way. Problems with Aldor alone should be reported here.
Problems with FriCAS or FriCAS-Aldor interface should be
go to FriCAS mailing list:

fricas...@googlegroups.com

OTOH, if the paper uses Axiom sysntax (or can be change to
use it), then any of forks could be used. I am maintining
FriCAS and I encourage you to use it. However, when
asking about FriCAS it is better to use FriCAS list.

Also, note that but FriCAS and Aldor develop and there
are some incompatible changes. If you have specific
problem then please give details, we will tell you if
problem is due to changes or there is some other
reason.

--
Waldek Hebisch

Esma Tayran

unread,
Oct 20, 2015, 4:37:57 PM10/20/15
to aldor-devel

 
I am using Ubuntu 14.10 on VirtualBox and currently using OpenAxiom. But I didn't install Aldor. I can only use Terminal interface and HyperDoc.


The paper is likely to be from time when Axiom was a commercial
product.  Now Axiom is open-source, but it is split into
several project.  Core Axiom forked twice, so there are
3 different project: Axiom, FriCAS and OpenAxiom.

The paper, that I'm working on was published in 1994 and there is no information about which Axiom relase was used.
Also, there is no information about how to I apply the package.

Firstly, I wrote the package code (on the paper) in the terminal but Axiom didn't accept it.

Yesterday, I tried to LibreOffice and changed the extension but Axiom gives an error like this:

"Only AXIOM source file extensions .as, .ao, .al, or .spad can be compiled. "

 
 I am maintining
FriCAS and I encourage you to use it.  However, when
asking about FriCAS it is better to use FriCAS list.

 
Actually, I don't want to change the program.

Thanks for the information.

Best regards,

Esma.

Waldek Hebisch

unread,
Oct 20, 2015, 5:31:57 PM10/20/15
to aldor...@googlegroups.com
Esma Tayran wrote:
>
> I am using Ubuntu 14.10 on VirtualBox and currently using OpenAxiom. But I
> didn't install Aldor. I can only use Terminal interface and HyperDoc.
>
>
> > The paper is likely to be from time when Axiom was a commercial
> > product. Now Axiom is open-source, but it is split into
> > several project. Core Axiom forked twice, so there are
> > 3 different project: Axiom, FriCAS and OpenAxiom.
> >
>
> The paper, that I'm working on was published in 1994 and there is no
> information about which Axiom relase was used.
> Also, there is no information about how to I apply the package.

In 1994 there was only commercial Axiom.

> Firstly, I wrote the package code (on the paper) in the terminal but Axiom
> didn't accept it.
>
> Yesterday, I tried to LibreOffice and changed the extension but Axiom gives
> an error like this:
>
> "Only AXIOM source file extensions .as, .ao, .al, or .spad can be compiled.
> "

Either file is not found (for example is in wrong directory) or
you did not succeed changing file extension. IME adding file
extension in LibreOffice save file dialog does not work:
if you put 'file.as' there LibreOffice will happily create
'file.as.txt'. That is LibreOffice will still tack its file
extension. In Ubuntu probably the easiest way to create
file is to use 'nano': in terninal type 'nano name_and.ext',
enter content, press Ctrl-O (thet is press o while pressing
control key) and then Ctrl-X to end. You can use 'ls'
command in the terminal to see which files are in current
directpry. Or if you prefer GUI you can fire up file
namager and look at files there.

> > I am maintining
> > FriCAS and I encourage you to use it. However, when
> > asking about FriCAS it is better to use FriCAS list.
> >
> >
> Actually, I don't want to change the program.

If you need Aldor with Axiom, then AFAIK OpenAxiom will not
work (you may ask on OpenAxiom mailing list for definitive
answer). The question is do you need Aldor? If you see
a lot of braces (the '{' and '}' characters), then most
probably this is Aldor. If you do not see braces but
one of first things is '#pile', then this is Aldor.
Otherwise this is probably Axiom (Spad) code which you
can store in '.spad' file -- this has reasonable chance
of working in OpenAxiom.

--
Waldek Hebisch

Esma Tayran

unread,
Oct 21, 2015, 12:51:46 PM10/21/15
to aldor-devel

> >  I am maintining
> > FriCAS and I encourage you to use it.  However, when
> > asking about FriCAS it is better to use FriCAS list.
> >
> >  
> Actually, I don't want to change the program.

If you need Aldor with Axiom, then AFAIK OpenAxiom will not
work (you may ask on OpenAxiom mailing list for definitive
answer).  The question is do you need Aldor?  If you see
a lot of braces (the '{' and '}' characters), then most
probably this is Aldor.  If you do not see braces but
one of first things is '#pile', then this is Aldor.
Otherwise this is probably Axiom (Spad) code which you
can store in '.spad' file -- this has reasonable chance
of working in OpenAxiom.


It seems it written in .spad file. I will try again.

Thanks for info. 

Best regards,

Esma.
 
Reply all
Reply to author
Forward
0 new messages