axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] [#37 )co aldor file does not work] additional informat


From: anonymous
Subject: [Axiom-developer] [#37 )co aldor file does not work] additional information
Date: Wed, 19 Jan 2005 11:26:42 -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?
--
forwarded from http://page.axiom-developer.org/zope/mathaction/address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]