axiom-mail
[Top][All Lists]
Advanced

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

RE: [Axiom-mail] Re: Outputting S-expressions


From: Page, Bill
Subject: RE: [Axiom-mail] Re: Outputting S-expressions
Date: Wed, 8 Nov 2006 14:14:37 -0500

On Wednesday, November 08, 2006 12:53 PM Ludovic Courtès wrote:
> ... 
> However, what I'm interested in is removing the type and type 
> conversion information, i.e., the `::' and `primeFactor'.  IOW,
> I'd like to get exactly the same information as is available on
> the console (or other output styles), no more.  Is this feasible?
> ... 

On Wednesday, November 08, 2006 1:56 PM I wrote:
 
> If you know for certain that you are dealing with a Factored type
> then you can do something like this:
> 
> (1) -> 
> pureForm(f)==[[i.factor::InputForm,i.exponent::InputForm] for i in factors 
> f]::InputForm
> ... 

Maybe this is better since it includes the arithmetic operators:

(1) -> pureForm(p)==reduce(*,[(i.factor^i.exponent)::InputForm for i in 
factorsp])::InputForm
                                  Type: Void

(2) -> p:=factor((x+y)*(x^2))

         2
   (2)  x (y + x)
                                  Type: Factored Polynomial Integer

(3) -> pureForm p
   Compiling function pureForm with type Factored Polynomial Integer
       -> InputForm

   (3)  (* (** x 2) (+ y x))
                                   Type: InputForm


Regards,
Bill Page.




reply via email to

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