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 13:56:23 -0500

On Wednesday, November 08, 2006 12:53 PM Ludovic Courtès wrote:
> > ... 
> > | Similarly, Axiom sometimes issues additional information 
> > | that is not relevant to me, for instance:
> > | 
> > |   (|primeFactor| (|::| |lambda| #0=(|Polynomial| (|Integer|))) 1)
> > | 
> > |   ...
> > | 
> > |   (|primeFactor| (|::| (+ |lambda| (* (+ R 1) |beta|)) #0#) 4)
> > | 
> > | Is there a way one could tweak it into removing those additional
> > | annotations?
> >
> ... 
> 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?
> 

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
                              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) 1))
                               Type: InputForm

> Maybe what I'm really looking for is an `sexp' output style?

These are not "output styles", they are Axiom domains. The
distinction is very important. If you want to know what methods
the domains InputForm and SExpression provides you can say:

  (1) -> )show InputForm

  (1) -> )show SExpression

I think you will see that in fact they are very similar.

Regards,
Bill Page.
 




reply via email to

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