|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Axiom compiling - newbie questionsHow do I get started modifying some of the spad code in axiom?
What I wanted to do is add exterior and inner products to the clifford code in Axiom. At this stage I just want to try things out and experiment with the minimum of fuss. I therefore cut and pasted the spad code from the clifford spad code in pamphlet 10.3 into a file I created called grassman.spad. I then renamed all occurrences of CliffordAlgebra to GrassmanAlgebra just so that the names did not clash with the existing code otherwise it is the existing working code. I then tried compiling it: (1) -> )compile axiom/grassman.spad This almost worked, it created a directory called GRAS.nrlib with some files in it, but there were some errors listed in it like this: finalizing nrlib GRAS Processing GrassmanAlgebra for Browser database: --------(e (% PI))--------- --->-->GrassmanAlgebra((e (% PI))): Unexpected HT command: \spad "\\spad{e(n)} produces the appropriate unit element." I think this comes from this part of the source code: T ==> Join(Ring, Algebra(K), VectorSpace(K)) with e: PI -> % ++ e(n) produces the appropriate unit element. I thought that this might be because I was using an old version of the compiler? So I renamed the file as: grassman.as Then I tried this: (1) -> )compile axiom/grassman.as Compiling AXIOM source code from file axiom/grassman.as using AXIOM-XL compiler and options -O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom -Y $AXIOM/algebra Use the system command )set compiler args to change these options. sh: NIL/bin/aldor: No such file or directory I assume the axiom that I downloaded does not contain aldor? So my questions are: Is this the best approach to take for a Axiom newbie? Is there an easier way? Do I need to use Aldor? Is there a binary version for opensuse? Where do I install it? Note: I am using the Axiom May 2009 code for openSUSE downloaded from: http://www.axiom-developer.org/axiom-website/download.html Martin _______________________________________________ Axiom-developer mailing list Axiom-developer@... http://lists.nongnu.org/mailman/listinfo/axiom-developer |
|
|
Re: Axiom compiling - newbie questionsMartin,
I think you are going about this the right way ... but you do have a lot to learn. Programming in Spad in Axiom has a steep learning curve but it does start to flatten out after a few years ... :-) No, it's not that bad but the output of the Spad compiler is simply atrocious. I don't think there ever was a compiler in my worst nightmare that produced such obscure and unhelpful output! The language though (if you can learn to love strongly typed languages) is, in my opinion, worth all the effort. The message "Unexpected HT command" is really just a warning that something in a comment (doc string) does not conform to requirements for HyperTex processing. If the compile completed successfully you will see a message about GrassmanAlgebra being "exposed" in your session. If you get this you should try something like )show GrassmanAlgebra to verify that it really is there. Then just proceed to use it as you would CliffordAlgebra. Aldor is a whole other story and I recommend you read up on it at http://axiom-wiki.newsynthesis.org and/or consult the email archives. To use it you definitely have to install additional software, specifically Aldor itself which is not included in Axiom for licensing reasons. There is also specific Aldor interface that needs to be compiled if you want to use Aldor from inside Axiom. Aldor itself can be run as a stand alone general purpose language in addition to serving as a potential replacement for Spad in Axiom. Good luck and keep asking ... Regards, Bill Page. On Fri, Nov 6, 2009 at 12:03 PM, Martin Baker <ax87438@...> wrote: > How do I get started modifying some of the spad code in axiom? > > What I wanted to do is add exterior and inner products to the clifford code in > Axiom. At this stage I just want to try things out and experiment with the > minimum of fuss. I therefore cut and pasted the spad code from the clifford > spad code in pamphlet 10.3 into a file I created called grassman.spad. I then > renamed all occurrences of CliffordAlgebra to GrassmanAlgebra just so that the > names did not clash with the existing code otherwise it is the existing > working code. > > I then tried compiling it: > > (1) -> )compile axiom/grassman.spad > > This almost worked, it created a directory called GRAS.nrlib with some files > in it, but there were some errors listed in it like this: > > finalizing nrlib GRAS > Processing GrassmanAlgebra for Browser database: > --------(e (% PI))--------- > --->-->GrassmanAlgebra((e (% PI))): Unexpected HT command: \spad > "\\spad{e(n)} produces the appropriate unit element." > > I think this comes from this part of the source code: > > T ==> Join(Ring, Algebra(K), VectorSpace(K)) with > e: PI -> % > ++ e(n) produces the appropriate unit element. > > I thought that this might be because I was using an old version of the > compiler? So I renamed the file as: grassman.as > > Then I tried this: > > (1) -> )compile axiom/grassman.as > Compiling AXIOM source code from file axiom/grassman.as using > AXIOM-XL compiler and options > -O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom -Y $AXIOM/algebra > Use the system command )set compiler args to change these > options. > sh: NIL/bin/aldor: No such file or directory > > I assume the axiom that I downloaded does not contain aldor? > > So my questions are: > Is this the best approach to take for a Axiom newbie? Is there an easier way? > Do I need to use Aldor? Is there a binary version for opensuse? Where do I > install it? > > Note: I am using the Axiom May 2009 code for openSUSE downloaded from: > http://www.axiom-developer.org/axiom-website/download.html > > Martin > > > > _______________________________________________ > Axiom-developer mailing list > Axiom-developer@... > http://lists.nongnu.org/mailman/listinfo/axiom-developer > _______________________________________________ Axiom-developer mailing list Axiom-developer@... http://lists.nongnu.org/mailman/listinfo/axiom-developer |
|
|
Re: Axiom compiling - newbie questionsBill,
Thanks very much for your reply, this gives me a clearer idea of the issues involved. In view of what you said and having looked at the Aldor site I think I will stay with the Spad compiler. I tried: )show GrassmanAlgebra and the output looked reasonable. I thought that the problems that I saw were related to the compiler error messages or to this message: "Compiling AXIOM source code from file axiom/grassman.spad using old system compiler." However, after more trial and error, I think the problems that I am seeing must be due to some kind of name clash? The problem I am seeing is this: (4) -> j: H2 := e(2) >> System error: Unknown bfd format Full sequence below. I am guessing that 'e' is exposed by both the existing CliffordAlgebra and by GrassmanAlgebra which I created. I tried: )set expose drop constructor CliffordAlgebra but that only hides the constructor, is there a way to hide the variables and functions also? Thanks, Martin ------------------------------------------------------------------ (1) -> )set mes auto off (1) -> K := Fraction Polynomial Integer (1) Fraction Polynomial Integer Type: Domain (2) -> m := matrix[[-1,0],[0,-1]] +- 1 0 + (2) | | + 0 - 1+ Type: Matrix Integer (3) -> )library GRAS GrassmanAlgebra is now explicitly exposed in frame frame0 GrassmanAlgebra will be automatically loaded when needed from /home/martin/GRAS.nrlib/code (3) -> )set expose drop constructor CliffordAlgebra CliffordAlgebra is now explicitly hidden in frame frame0 (3) -> H2 := GrassmanAlgebra(2, K, quadraticForm m) (3) GrassmanAlgebra(2,Fraction Polynomial Integer,MATRIX) Type: Domain (4) -> j: H2 := e(2) >> System error: Unknown bfd format (4) -> )set expose drop group CliffordAlgebra CliffordAlgebra is not a known exposure group name. (4) -> j: H2 := e(2)$GrassmanAlgebra(2,Fraction Polynomial Integer,MATRIX) Although Matrix is the name of a constructor, a full type must be specified in the context you have used it. Issue )show Matrix for more information. (4) ->j: H2 := e(2)$GrassmanAlgebra(2,Fraction Polynomial Integer,QuadraticForm(2,Fraction Polynomial Integer)) Cannot convert from type Domain to QuadraticForm(2,Fraction Polynomial Integer) for value QuadraticForm(2,Fraction(Polynomial(Integer()))) _______________________________________________ Axiom-developer mailing list Axiom-developer@... http://lists.nongnu.org/mailman/listinfo/axiom-developer |
|
|
Re: Axiom compiling - newbie questionsMartin Baker wrote:
> Bill, > > Thanks very much for your reply, this gives me a clearer idea of the issues > involved. > > In view of what you said and having looked at the Aldor site I think I will > stay with the Spad compiler. > > I tried: > )show GrassmanAlgebra > and the output looked reasonable. > > I thought that the problems that I saw were related to the compiler error > messages or to this message: > "Compiling AXIOM source code from file axiom/grassman.spad using old system > compiler." > > However, after more trial and error, I think the problems that I am seeing > must be due to some kind of name clash? > The problem I am seeing is this: > > (4) -> j: H2 := e(2) > > >> System error: > Unknown bfd format > The message means that Axiom binary you got is incompatible with your system. More precisely, Axiom tries to load (use) your freshly compiled code and failed. -- Waldek Hebisch hebisch@... _______________________________________________ Axiom-developer mailing list Axiom-developer@... http://lists.nongnu.org/mailman/listinfo/axiom-developer |
| Free embeddable forum powered by Nabble | Forum Help |