RE: Re: Outputting S-expressions

"Page, Bill" <[email protected]>
Newsgroups gmane.comp.mathematics.axiom.user
Message-ID <CAE9B164E720CE4D8727792DF8F28AE39D9A97@corporateex02.Corporate.drdc-rddc.gc.ca>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.