"Bill Page" <[EMAIL PROTECTED]> writes:

> Martin,
> 
> I think 'unparse' in FriCAS is badly broken. See for example:
> 
> (1) -> unparse((sin(x+1))::InputForm)
> 
>    (1)  "sin x+1"
>                                                    Type: String
> 
> Besides it's use in Sage, do you agree that we should fix it anyway?

Yes, of course.

> At the same time we should also remove the Fortranish names and any other
> flaws we can find.

> The only other alternative for _sage_ in axiom.py that I can see would be to
> write something that interprets the S-expression output of InputForm
> directly.

This may be necessary anyway.  I think the plan should be as follows: as you
said already, we would like to have interpret(x::INFORM) equal to the result of
evaluating x (in a fresh environment).  I believe, to make this work properly,
x::INFORM should be fully type-decorated.  It seems that this is also the
current strategy, some examples below.

Then, we can implement a package SagePackage analogous to OutputPackage, that
exports a single function sage: INFORM -> String.  Actually, maybe it's better
to implement this in sage, because it should be possible to pass INFORM objects
as python nested lists of symbols, without going to strings?

Martin

(4) -> (factor(x^2-1))::INFORM

   (4)
   (*  (primeFactor (:: (+ x - 1) (Polynomial (Integer))) 1)
    (primeFactor (:: (+ x 1) (Polynomial (Integer))) 1))
                                                              Type: InputForm
(10) -> (1::COMPLEX INT)::INFORM

   (10)  (complex 1 0)
                                                              Type: InputForm

I think for aggregates we can have a general rule, but we need a way to specify
package calls

(15) -> construct([1,2,3])$PRIMARR INT::INFORM
   Internal Error
   The function convert with signature hashcode is missing from domain 
      PrimitiveArray(Integer) 

should be

(29) -> [(packageCall('construct)$INFORM1 PRIMARR INT)::SEX, 
f::SEX]::SEX::INFORM

   (32)  (($elt (PrimitiveArray (Integer)) construct) (construct 1 2 3))
                                                              Type: InputForm
(29) -> interpret %

   (33)  [1,2,3]
                                                 Type: PrimitiveArray Integer

the following looks fishy, because it forgets the type information:

(13) -> [x,y,z]::List OVAR([x,y,z,q])::INFORM

   (13)  (construct x y z)
                                                              Type: InputForm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to