Dear all!

I would like to make another effort to promote and implement clear 
semantics for InputForm.  As you may know, my motivation and use case for 
this is the interoperability with sage.

As an aside, I am very happy to report that these efforts finally bear 
fruit:

* FriCAS was recently promoted "optional package", which means that changes 
to other parts of sage must make sure that they do not break functionality 
imported from FriCAS
* there is improved interest in the integration routines from FriCAS, 
resulting in bug reports and feature requests

I am working on exposing more functionality (in particular, the solver for 
differential equations, the manipulation of power series and the guessing 
package).

The main workhorse for this is FriCAS InputForm and dom$Any.  They proved 
to be very efficient for performing the translation between FriCAS and sage 
types.

However, I am now at the point where I am badly in need of clearer 
semantics for convert@InputForm.  Let me refer to an old email from Waldek:

> Well, apparently InputForm was done for specific purpose
> (creating functions for plotting) and most other parts
> were unimplemented.  So no deep reason for absence
> of convertion for PositiveInteger.  OTOH there is related
> issue: should convertion make effort to preserve types?
> If no than very simple fix should work.  If we want to
> preserve types, than several existing convertions would
> need changes.  The issue of types came, because
> preserving types is needed for equality 'x = interpret(x::INFORM)'.
> Currently I think that we should weaken this requirement
> and instead of 'x::INFORM' have 'atType(x::INFORM)' in
> the equality (otherwise all (or most) convertions need
> to perform equivalent of 'atType').

As it turns out, it would be much better to separate the type information 
from the rest in InputForm. Consider the following:

(5) -> l := [i for i in 1..20]@List PF 5

   (5)  [1,2,3,4,0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,0]
                                                    Type: 
List(PrimeField(5))
(6) -> l::INFORM

   (6)
   (construct  (($elt (PrimeField 5) index) 1)
    (($elt (PrimeField 5) index) 2)  (($elt (PrimeField 5) index) 3)
    (($elt (PrimeField 5) index) 4)  (($elt (PrimeField 5) index) 5)
    (($elt (PrimeField 5) index) 1)  (($elt (PrimeField 5) index) 2)
    (($elt (PrimeField 5) index) 3)  (($elt (PrimeField 5) index) 4)
    (($elt (PrimeField 5) index) 5)  (($elt (PrimeField 5) index) 1)
    (($elt (PrimeField 5) index) 2)  (($elt (PrimeField 5) index) 3)
    (($elt (PrimeField 5) index) 4)  (($elt (PrimeField 5) index) 5)
    (($elt (PrimeField 5) index) 1)  (($elt (PrimeField 5) index) 2)
    (($elt (PrimeField 5) index) 3)  (($elt (PrimeField 5) index) 4)
    (($elt (PrimeField 5) index) 5))
                                                              Type: 
InputForm

It would be much more efficient to have (WARNING: mockup)

-> l::INFORM

 (construct 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20)
                                                              Type: 
InputForm
-> dom(l::Any)

 (List (PrimeField(5)))
                                                            Type: 
SExpression

So I propose the following:

    convert@InputForm should return an object, such that, together with the 
type, the original object can be reconstructed unambiguously and 
automatically

Can you agree with this?

(Note that interpret(x)$INFORM1(type) does currently not quite (but almost) 
perform what I would like...)

Martin

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to