axlit.as and axextend.as

View: New views
2 Messages — Rating Filter:   Alert me  

axlit.as and axextend.as

by Ralf Hemmecke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

To whoever knows about the history of the aldor-axiom connection,

Important in the build of the aldor-axiom connection are the files
axlit.as and axextend.as that can be found at

https://svn.origo.ethz.ch/algebraist/trunk/aldor/lib/libax0/

I roughly understand why they exist. What I don't understand is their
actual contents. It seems clear to me that Literal and Generator have to
be made available and that I should be able to use [...], i.e., the
function "bracket" to construct lists. But what I don't understand is,
for example, why

Bit ==> Boolean;
extend SingleInteger : with {
   ...
   =:  (%, %) -> Bit;
   <:  (%, %) -> Bit;
} == add {
   Rep ==> SInt;
   asBool(x) ==> x pretend Boolean;
   ...
   import {
     ...
     SIntEQ:        (SInt, SInt) -> Bool;
     SIntLT:        (SInt, SInt) -> Bool;
     ...
   } from Builtin;
   ...
   (a: %) =  (b: %): Bit == asBool(SIntEQ(rep a, rep b));
   (a: %) <  (b: %): Bit == asBool(SIntLT(rep a, rep b));
   ...
}

appears in axextend.as. Axiom's SingleInteger already exports
IntegerNumberSystem, which clearly should also contain = and <.

It would be very helpful if sombody could explain the content of those
two files (not only the example that I've given above. However, I
appreciate any helpful comment. Please come forward.

Thank you

Ralf

_______________________________________________
Aldor-l mailing list
Aldor-l@...
http://aldor.org/mailman/listinfo/aldor-l_aldor.org

Parent Message unknown representation of SingleInteger in Axiom

by Ralf Hemmecke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you, Peter,

that seems to help a bit. But in particular for SingleInteger... isn't
there a difference in the representation? Aldor uses 32 bit and Axiom's
SingleInteger has the same representation as ,uhmmm, Lisp. Is there a
different runtime system behind Builtin, then?

Ralf


On 06/23/2008 09:20 AM, Peter Broadbery wrote:

> On Sun, Jun 22, 2008 at 10:29 PM, Ralf Hemmecke <ralf@...> wrote:
>> To whoever knows about the history of the aldor-axiom connection,
>>
>> Important in the build of the aldor-axiom connection are the files
>> axlit.as and axextend.as that can be found at
>>
>> https://svn.origo.ethz.ch/algebraist/trunk/aldor/lib/libax0/
>>
>> I roughly understand why they exist. What I don't understand is their
>> actual contents. It seems clear to me that Literal and Generator have to
>> be made available and that I should be able to use [...], i.e., the
>> function "bracket" to construct lists. But what I don't understand is,
>> for example, why
>>
>> Bit     ==> Boolean;
>> extend SingleInteger : with {
>>   ...
>>   =:  (%, %) -> Bit;
>>   <:  (%, %) -> Bit;
>> } == add {
>>   Rep ==> SInt;
>>   asBool(x) ==> x pretend Boolean;
>>   ...
>>   import {
>>     ...
>>     SIntEQ:        (SInt, SInt) -> Bool;
>>     SIntLT:        (SInt, SInt) -> Bool;
>>     ...
>>   } from Builtin;
>>   ...
>>   (a: %) =  (b: %): Bit == asBool(SIntEQ(rep a, rep b));
>>   (a: %) <  (b: %): Bit == asBool(SIntLT(rep a, rep b));
>>   ...
>> }
>>
>> appears in axextend.as. Axiom's SingleInteger already exports
>> IntegerNumberSystem, which clearly should also contain = and <.
>>
>
> Quick answer - inlining - the definitions enable aldor to inline the
> functions when they are used.  If they were not available, the
> generated code would have to call out to the axiom definitions.
>
> Peter

_______________________________________________
Aldor-l mailing list
Aldor-l@...
http://aldor.org/mailman/listinfo/aldor-l_aldor.org
LightInTheBox - Buy quality products at wholesale price