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

Submitted by : (unknown) at: 2007-11-17T22:35:08-08:00 (9 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

Peter Broadbery writes:
 > On Tue, 2005-01-11 at 14:30 +0100, Martin Rubey wrote:
 > > Dear Peter,
 > > 
 > > this is just great stuff -- nearly... I had to try it out right away, but I
 > > experienced two problems.
 > > 
 > > the minor one is, that )co inside axiom still does not work:
 > > 
 > > (1) -> 
 > > (1) -> )co test.as
 > >    Compiling AXIOM source code from file 
 > >       /home/rubey/martin/Axiom/test.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.
 > >  
 > >    >> System error:
 > >    NIL is not of type STRING.
 > 
 > 
 > ln -s $ALDORROOT $AXIOM/compiler may help here.  fixing i-syscmd.boot to
 > produce a nice error would be nice, I guess.

I tried that, but it won't work. Tim, is there a way to trace what's happening?

Note that both $ALDORROOT and $AXIOM were set correctly. In other words, the
link above produced a directory "compiler" in "axiom/mnt/linux", containing the
following directories of Aldor: bin/ doc/ include/ lib/ src/ tests/

 > The .as file isn't in CVS (the file is compiled - don't be fooled by the
 > readable coding style)

Sorry, my mistake. Only lsp files. By the way, there i *lots* of stuff in the
directories under /lsp/ccl/src, some look like they could be really useful...

Tim: could you rename them to .pamphlet and correct the \usepackage line in
each one of them? Thanks!

 > > (1) -> fact(5)$Test
 > > 
 > >    (1)  120
 > >                                                         Type: 
 > > PositiveInteger
 > > (2) -> fact(4)$Test
 > >  
 > >    >> System error:
 > >    #<vector 08cf4150> is not of type LIST.
 > > 
 > 
 > Fixed by the patch I send earlier (I hope)...

Yes indeed! (I found that there was only one line you had to comment out?)

 > The significant bit is removing an unbound variable from as.boot, the
 > rest is to fix the )co command (obviously not bullet proof), and the .ap
 > file generation.  
 > 
 > In terms of aldor internal knowledge, you don't need that much, the hard
 > work is on the axiom side. The trick is to load all the aldor runtime
 > env interpreted and see what breaks (this includes daase.lisp, as.clisp
 > & interop.clisp, plus the aldor .lsp files).  This stuff used to vaguely
 > work, so putting it back in shape can't be too bad.  

In another mail, you wrote:

 > As long as you don't use the sig. from the interpreter, you will be ok
 > (which misses the point,, I know).  As far as fixing the error, not really,
 > I don't know the axiom interpreter that well. Finding how & where the type
 > is substituted would be a good start [There must be someone who does...]

Who could this be? It would be just wonderful to get this working!

Thanks a million times,



------------------------------------------------------------


property change --billpage, Wed, 19 Jan 2005 09:55:23 -0600

Category: Axiom User Interface => Axiom Compiler 




property change --billpage, Wed, 19 Jan 2005 09:55:35 -0600





additional info --Wed, 19 Jan 2005 11:23:18 -0600

On Tue, 2005-01-11 at 14:30 +0100, Martin Rubey wrote:
> Dear Peter,
> 
> this is just great stuff -- nearly... I had to try it out right away, but I
> experienced two problems.
> 
> the minor one is, that )co inside axiom still does not work:
> 
> (1) -> 
> (1) -> )co test.as
>    Compiling AXIOM source code from file 
>       /home/rubey/martin/Axiom/test.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.
>  
>    >> System error:
>    NIL is not of type STRING.


ln -s $ALDORROOT $AXIOM/compiler may help here.  fixing i-syscmd.boot to
produce a nice error would be nice, I guess.


> (1) -> 
> 
> Never mind.
> 
> Unfortunately, there is a more severe issue. I put the following simple domain
> in a file "test.as" and compiled it using 
> 
> aldor -O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom test.as
> 
> without any problem. There is only the warning
> 
> #1 (Warning) Deprecated message prefix: use `ALDOR_' instead of `_AXL'
> 
> but I suspect that this is of no importance.

Yep.



> 
> 
> -------------------------------------------------------------------------------
> #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 } }
> -------------------------------------------------------------------------------
> 
> After this I start axiom and load runtime and axextend. By the way axextend
> *is* in the distribution, it's only a little hidden... There is even more
> obscure stuff in theis directory, maybe it's of use to you!
> 

The .as file isn't in CVS (the file is compiled - don't be fooled by the
readable coding style)

> (1) -> )sh Test
>  Test  is a domain constructor
>  Abbreviation for Test is TEST 
>  This constructor is exposed in this frame.
>  Issue )edit test.as to see algebra source code for TEST 
> 
> ------------------------------- Operations --------------------------------
>  fact : PositiveInteger -> PositiveInteger
> 
> (1) -> fact(5)$Test
> 
>    (1)  120
>                                                         Type: PositiveInteger
> (2) -> fact(4)$Test
>  
>    >> System error:
>    #<vector 08cf4150> is not of type LIST.
> 

Fixed by the patch I send earlier (I hope)...


> By the way, could you explain what your patches are doing? It's just a mystery
> to me! I suspect that one needs some knowledge of Aldor internals?

The significant bit is removing an unbound variable from as.boot, the
rest is to fix the )co command (obviously not bullet proof), and the .ap
file generation.  

In terms of aldor internal knowledge, you don't need that much, the hard
work is on the axiom side. The trick is to load all the aldor runtime
env interpreted and see what breaks (this includes daase.lisp, as.clisp
& interop.clisp, plus the aldor .lsp files).  This stuff used to vaguely
work, so putting it back in shape can't be too bad.  



additional information --Wed, 19 Jan 2005 11:26:40 -0600

I just tried another example, which is in fact the reason why I would love to
have Aldor working. I did not expect it to work, and it does not, but it works
*almost*. The code is as follows:

#include "axiom"

Test: with { f: (n: PositiveInteger) -> PrimeField(n) } 
   == add { f(n: PositiveInteger): PrimeField(n) == 
              10::Integer::PrimeField(n) }

Note that such a construction -- the resulting domain depending on the function
parameter -- is currently illegal in Axiom. In Aldor it is fine.

I compiled it with Aldor as usual, and then loaded it into Axiom. As signature
I got the slightly unusual

(1) -> )di op f

There is one unexposed function called f :
   [1] PositiveInteger -> PrimeField n from Test

and trying it out I obtained

(1) -> f(5)$Test
   Loading /home/rubey/axiom/mnt/linux/algebra/PF.o for domain 
      PrimeField 
   Loading /home/rubey/axiom/mnt/linux/algebra/IPF.o for domain 
      InnerPrimeField 
   Loading /home/rubey/axiom/mnt/linux/algebra/TABLE.o for domain Table
      
   Loading /home/rubey/axiom/mnt/linux/algebra/HASHTBL.o for domain 
      HashTable 
   Loading /home/rubey/axiom/mnt/linux/algebra/INTABL.o for domain 
      InnerTable 
   Loading /home/rubey/axiom/mnt/linux/algebra/ZMOD.o for domain 
      IntegerMod 

 
   >> System error:
   |n| is not of type NUMBER.

protected-symbol-warn called with (NIL)

which is roughly what I expected. However, to my great surprise, if you turn on
the debugger (beforehand. You always have to start a fresh axiom because of the
error I told you about in my previous message) with

)lisp (setq |$monitorNewWorld| t)

and thus trace

(1) -> f(1783)$Test

the final bit reads

protected-symbol-warn called with (NIL)..IntegerMod 1783 wants
   positiveRemainder : (%,%) -> % from  Integer
---->Integer----> searching op table for:
   positiveRemainder : (%,%) -> % from  Integer
<----#<compiled-function |INT;positiveRemainder;3$;28|> Integer
goget stuffing slot 47 of IntegerMod 1783
<------#<compiled-function |INT;positiveRemainder;3$;28|> Integer

PrimeField n activating lazy slot 8: Integer
PrimeField n activating lazy slot 9: IntegerPrimesPackage Integer

..PrimeField n wants
   prime? : Integer -> Boolean from  IntegerPrimesPackage Integer
---->IntegerPrimesPackage Integer----> searching op table for:
   prime? : Integer -> Boolean from  IntegerPrimesPackage Integer
<----#<compiled-function |PRIMES;prime?;IB;4|>(IntegerPrimesPackage,Integer)
goget stuffing slot 10 of PrimeField n
<------#<compiled-function |PRIMES;prime?;IB;4|>(IntegerPrimesPackage,Integer)
 

which clearly tells you, that the calculation is done alright, only the
signature interferes with success.

Any ideas?



additional info --Wed, 19 Jan 2005 11:29:10 -0600

this is just great stuff -- nearly... I had to try it out right away, but I
experienced two problems.

the minor one is, that )co inside axiom still does not work:

                        AXIOM Computer Algebra System 
                   Version: Axiom 3.0 Beta (February 2005)
              Timestamp: Tuesday January 11, 2005 at 14:02:04 
-----------------------------------------------------------------------------
   Issue )copyright to view copyright notices.
   Issue )summary for a summary of useful system commands.
   Issue )quit to leave AXIOM and return to shell.
-----------------------------------------------------------------------------
 
   Re-reading compress.daase   Re-reading interp.daase
   Re-reading operation.daase
   Re-reading category.daase
   Re-reading browse.daase
(1) -> 
(1) -> )co test.as
   Compiling AXIOM source code from file 
      /home/rubey/martin/Axiom/test.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.
 
   >> System error:
   NIL is not of type STRING.

protected-symbol-warn called with (NIL)
(1) -> )co test
   Compiling AXIOM source code from file 
      /home/rubey/martin/Axiom/test.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.
 
   >> System error:
   NIL is not of type STRING.

protected-symbol-warn called with (NIL)
(1) -> 

Never mind.

Unfortunately, there is a more severe issue. I put the following simple domain
in a file "test.as" and compiled it using 

aldor -O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom test.as

without any problem. There is only the warning

#1 (Warning) Deprecated message prefix: use `ALDOR_' instead of `_AXL'

but I suspect that this is of no importance.


-------------------------------------------------------------------------------
#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 } }
-------------------------------------------------------------------------------

After this I start axiom and load runtime and axextend. By the way axextend
*is* in the distribution, it's only a little hidden... There is even more
obscure stuff in theis directory, maybe it's of use to you!

                        AXIOM Computer Algebra System 
                   Version: Axiom 3.0 Beta (February 2005)
              Timestamp: Tuesday January 11, 2005 at 14:02:04 
-----------------------------------------------------------------------------
   Issue )copyright to view copyright notices.
   Issue )summary for a summary of useful system commands.
   Issue )quit to leave AXIOM and return to shell.
-----------------------------------------------------------------------------
 
   Re-reading compress.daase   Re-reading interp.daase
   Re-reading operation.daase
   Re-reading category.daase
   Re-reading browse.daase
(1) -> 
(1) -> )lisp (load "/home/rubey/aldor/linux/1.0.2/lib/runtime.lsp")

Value = T
(1) -> )lisp (load 
"/home/rubey/axiom--main--1--patch-24/lsp/ccl/src/axbase/compiler/lib/axextend.lsp")

Value = T
(1) -> )lib test
   Reading /home/rubey/martin/Axiom/test.asy
   Loading /home/rubey/axiom/mnt/linux/autoload/bc-matrix.
   Loading /home/rubey/axiom/mnt/linux/autoload/bc-misc.
   Loading /home/rubey/axiom/mnt/linux/autoload/bc-solve.
   Loading /home/rubey/axiom/mnt/linux/autoload/bc-util.
   Loading /home/rubey/axiom/mnt/linux/autoload/ht-util.
   Loading /home/rubey/axiom/mnt/linux/autoload/htsetvar.
   Loading /home/rubey/axiom/mnt/linux/autoload/ht-root.
   Loading /home/rubey/axiom/mnt/linux/autoload/br-con.
   Loading /home/rubey/axiom/mnt/linux/autoload/br-data.
   Loading /home/rubey/axiom/mnt/linux/autoload/showimp.
   Loading /home/rubey/axiom/mnt/linux/autoload/br-op1.
   Loading /home/rubey/axiom/mnt/linux/autoload/br-op2.
   Loading /home/rubey/axiom/mnt/linux/autoload/br-search.
   Loading /home/rubey/axiom/mnt/linux/autoload/br-util.
   Loading /home/rubey/axiom/mnt/linux/autoload/topics.
   Loading /home/rubey/axiom/mnt/linux/autoload/br-prof.
   Loading /home/rubey/axiom/mnt/linux/autoload/br-saturn.
   Test is now explicitly exposed in frame frame0 
   Test will be automatically loaded when needed from 
      /home/rubey/martin/Axiom/test
(1) -> )sh Test
 Test  is a domain constructor
 Abbreviation for Test is TEST 
 This constructor is exposed in this frame.
 Issue )edit test.as to see algebra source code for TEST 

------------------------------- Operations --------------------------------
 fact : PositiveInteger -> PositiveInteger

(1) -> fact(5)$Test

   (1)  120
                                                        Type: PositiveInteger
(2) -> fact(4)$Test
 
   >> System error:
   #<vector 08cf4150> is not of type LIST.

protected-symbol-warn called with (NIL)


:-(

I am already very very happy, but another patch and/or explanation would
greatly improve this...

By the way, could you explain what your patches are doing? It's just a mystery
to me! I suspect that one needs some knowledge of Aldor internals?





additional info --Wed, 19 Jan 2005 11:30:49 -0600

I've been playing with the aldor/axiom stuff a little, and the following
patch may help get things going(I used to work on it, and thought it'd
be fun to get it going again).

There are further problems:
- aldor "extend" does not work - it ought to, I think
- The algebra defined in libaxiom.al is not current, and for it to be
rebuilt various .as files need to be available to the build process
(axextend.as and friends) - any reason why they're left out of the
distribution?
- exported attributes from aldor domains are explicitly killed off by
this patch (it's probably easy to fix, just no time atm).
- Only tested the most trivial domains I could find.  

Peter.





the patch document --Wed, 19 Jan 2005 11:32:09 -0600

? Makefile
? Makefile.dvi
Index: as.boot.pamphlet
===================================================================
RCS file: /cvsroot/axiom/axiom/src/interp/as.boot.pamphlet,v
retrieving revision 1.3
diff -u -r1.3 as.boot.pamphlet
--- as.boot.pamphlet	24 May 2004 22:53:49 -0000	1.3
+++ as.boot.pamphlet	8 Jan 2005 19:01:23 -0000
@@ -389,7 +389,8 @@
     HPUT(ht,id,[entry,:HGET(ht,id)])
   opalist := [[op,:REMDUP HGET(ht,op)] for op in HKEYS ht]
   --HPUT($opHash,con,[ancestorAlist,attributeAlist,:opalist])
-  HPUT($opHash,con,[ancestorAlist,attributeAlist,:opalist])
+  --HPUT($opHash,con,[ancestorAlist,attributeAlist,:opalist])
+  HPUT($opHash,con,[ancestorAlist,nil,:opalist])
 
 hackToRemoveAnd p ==
 ---remove this as soon as .asy files do not contain forms (And pred) forms
Index: ax.boot.pamphlet
===================================================================
RCS file: /cvsroot/axiom/axiom/src/interp/ax.boot.pamphlet,v
retrieving revision 1.3
diff -u -r1.3 ax.boot.pamphlet
--- ax.boot.pamphlet	24 May 2004 22:53:49 -0000	1.3
+++ ax.boot.pamphlet	8 Jan 2005 19:01:26 -0000
@@ -80,11 +80,29 @@
      axForms :=
         [['Foreign, ['Declare, 'dummyDefault, 'Exit], 'Lisp], :axForms]
   axForms := APPEND(axDoLiterals(), axForms)
-  axForm := ['Sequence, ['Import, [], 'AxiomLib], :axForms]
+  axForm := ['Sequence, ['Import, [], 'AxiomLib], ['Import, [], 'Boolean], :axForms]
   st := MAKE_-OUTSTREAM(filename)
   PPRINT(axForm,st)
   CLOSE st
 
+makeAxExportForm(filename, constructors) ==
+  $defaultFlag : local := false
+  $literals := []
+  axForms :=
+     [modemapToAx(modemap) for cname in constructors |
+            (modemap:=GETDATABASE(cname,'CONSTRUCTORMODEMAP)) and
+              (not cname in '(Tuple Exit Type)) and
+                not isDefaultPackageName cname]
+  if $baseForms then
+     axForms := [:$baseForms, :axForms]
+  if $defaultFlag then
+     axForms :=
+        [['Foreign, ['Declare, 'dummyDefault, 'Exit], 'Lisp], :axForms]
+  axForms := APPEND(axDoLiterals(), axForms)
+  axForm := ['Sequence, ['Import, [], 'AxiomLib], ['Import, [], 'Boolean], :axForms]
+  axForm
+
+
 stripType type ==
   $stripTypes =>
      categoryForm? type => 'Type
Index: i-syscmd.boot.pamphlet
===================================================================
RCS file: /cvsroot/axiom/axiom/src/interp/i-syscmd.boot.pamphlet,v
retrieving revision 1.4
diff -u -r1.4 i-syscmd.boot.pamphlet
--- i-syscmd.boot.pamphlet	28 Dec 2004 07:42:45 -0000	1.4
+++ i-syscmd.boot.pamphlet	8 Jan 2005 19:01:36 -0000
@@ -642,7 +642,7 @@
     if ^beQuiet then sayKeyedMsg("S2IZ0038A",[namestring args, asharpArgs])
 
     command :=
-     STRCONC(TRUENAME(STRCONC(GETENV('"AXIOM"),'"/compiler/bin/")),"axiomxl ", asharpArgs, '" ", namestring args)
+     STRCONC(STRCONC(GETENV('"AXIOM"),'"/compiler/bin/"),"axiomxl ", asharpArgs, '" ", namestring args)
     rc := OBEY command
 
     if (rc = 0) and doCompileLisp then




Final bits and pieces --kratt6, Thu, 10 Feb 2005 06:12:04 -0600

Dear Tim! 

I saw that you integrated Peters patches for Aldor support from within
Axiom. However, some issues remain:

* You forgot to integrate his patch for foam_l.lisp.pamphlet which Peter sent
  to axiom-developer. Hence, calling a function compiled with Aldor twice in
  Axiom fails.

* You did not rename the files in
  axiom--main--1--patch-30/lsp/ccl/src/axbase/compiler/lib/ 
  to have the pamphlet extension. Also, they say 

  \usepackage{../../../../../src/scripts/tex/axiom}

  but should say

  \usepackage{../../../../../../src/scripts/tex/axiom}

  (it would be even better to say just \usepackage{axiom} and let configure set
  the TEXINPUTS variable correspondingly, I guess.)

  among these files, runtime.lsp and axextend.lsp should be compiled and

* when axiom is installed, be copied into the directory

  ~/axiom/mnt/linux/compiler/lib

  Also, 

  ~/axiom/mnt/linux/compiler/bin

  should contain a link to the aldor compiler. The best thing is probably to
  include the file axiomxl as follows:

#!/bin/sh
#
# A script to ease the pain of migration.
echo "           ************************************************"
echo "           *** axiomxl is obsolete: use 'aldor' instead ***"
echo "           ************************************************"
echo ""
aldor $*

  Finally, the axiom.as file is missing from the distribution and should be
  copied to an appropriate place when Axiom gets installed. Don't know where
  this would be, however. It seems that aldor expects it in its include
  directory...

Martin





property change --kratt6, Tue, 21 Jun 2005 05:56:52 -0500

Status: open => fix proposed 




Aldor Interface patches by Peter Broadbery --Bill Page, Fri, 02 Sep 2005 21:59:23 -0500

Status: fix proposed => testing 




aldor works with recent versions of axiom --Bill Page, Wed, 21 Jun 2006 06:07:15 -0500

Status: testing => closed 




  Subject:   Be Bold !!
  ( 13 subscribers )  
Please rate this page: