axiom-mail
[Top][All Lists]
Advanced

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

RE: [Axiom-mail] Data structure for object definition


From: Page, Bill
Subject: RE: [Axiom-mail] Data structure for object definition
Date: Wed, 27 Sep 2006 16:50:01 -0400

Gaby, 

On Wednesday, September 27, 2006 4:11 PM you wrote:
> 
>   Is there an accessible algebra in Axiom that holds the
> internal representation of Axiom object?
>

I suppose that depends on what you mean by "accessible" and
"algebra" :) Certainly everything in Axiom has a type but
many of these types are not "domains" so they do not really
have an "algebra" in the sense in which I think you mean it.
In many cases we do not even have a notion of equality.
 
> Assume, I have
> 
>      (x:% - %:y):% == reduc(x -$Rep y, commonk(x, y))
> 
> Who to I get hold on the internal representation of "-"?
> 
> (SEX an EXPR do not see, to give me  what I want).
> 

"-" is a function presumably of type ((Rep,Rep) -> Rep) from
the built-in Mapping domain constructor. Mapping does provide
some limited "algebraic" properties.

Is this something like what you want?

(1) ->  m:= _-$Integer

   There is more than one - in the domain or package Integer . The one
      being chosen has type ((Integer,Integer) -> Integer) .

   (1)  theMap(INT;-;3$;38,126)
        Type: ((Integer,Integer) -> Integer)

(2) -> m(1,2)

   (2)  - 1
        Type: Integer

(3) -> typeOf(m)

   (3)  ((Integer,Integer) -> Integer)
        Type: Domain

(4) ->  n:=(_-)$Integer
   There is more than one - in the domain or package Integer . The one
      being chosen has type ((Integer,Integer) -> Integer) .

   (4)  theMap(INT;-;3$;38,126)
   Type: ((Integer,Integer) -> Integer)

(5) -> (m=n)::Boolean

   Loading C:/Program Files/axiom/mnt/windows/algebra/EQ.o for domain
      Equation

   (9)  true
   Type: Boolean

(6) ->  p:=(_+)$Integer

   (6)  theMap(INT;+;3$;37,126)
   Type: ((Integer,Integer) -> Integer)

(7) -> (m=p)::Boolean

   (7)  false
   Type: Boolean

---------

Of course this is in the Axiom interpreter and your example
suggests you are talking about SPAD code. The reflection
'typeOf' is not available in SPAD as far as I know and is
not of much use in the interpreter. It's nice to see however
that at least Mapping provides an equality and this I am
sure you can exploit in SPAD and Aldor.

You might also be able to resort to some "tricks" at the
level of Lisp or would you prefer to avoid that?

Regards,
Bill Page.




reply via email to

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