Bill Page wrote:
> 
> With the most recent revision of FriCAS (Rev: 393) plus the patch that
> I recently posted, FriCAS produces the following output:
> 
>     (1) -> sqrt(2)::InputForm + 1::InputForm
> 
>        (1)  (+ (:: (** 2 (/ 1 2)) (AlgebraicNumber)) 1)
>                                                     Type: InputForm
>     (2) -> unparse(%)
> 
>        (2)  "(2^(1/2))::AlgebraicNumber+1"
>                                                     Type: String
>     (3) -> parse(%)$InputForm
> 
>        (3)  (+ (:: (^ 2 (/ 1 2)) AlgebraicNumber) 1)
>                                                     Type: InputForm
>     (4) -> interpret(%)$InputForm
> 
>              +-+
>        (4)  \|2  + 1
>                                                     Type: AlgebraicNumber
>     (5) -> %::InputForm
> 
>        (5)  (:: (+ (** 2 (/ 1 2)) 1) (AlgebraicNumber))
>                                                     Type: InputForm
> 
> -----
> 
> I have a few questions about the InputForm values produced in different ways.
> 
> 1) Use of coercions and types in InputForm. As far as I know, besides
> it's use in
> 
>     (6) -> integrate(sin(exp x),x)::InputForm
> 
>        (6)  (integral (sin (exp x)) (:: x Symbol))
>                                                     Type: InputForm
>     (7) -> unparse %
> 
>        (7)  "integral(sin(exp(x)),x::Symbol)"
>                                                     Type: String
> 
> this change introduces the first use of :: for representing explicit
> type information in InputForm.
> 
> What do you think about this approach? Is there a better way?
> 
> One alternative would be to introduce a specific (non-overloaded)
> operation exported by AlgebraicNumber such as 'algebraicNumber' that
> does the same thing. That is how Float values are currently handled:
> 
>     (8) -> 3.141592::InputForm
> 
>        (8)  (float 231808574432053350722 - 66 2)
>                                                     Type: InputForm
>     (9) -> unparse %
> 
>        (9)  "float(231808574432053350722,-66,2)"
>                                                     Type: String
> 
> Would doing something like this:
> 
>    (algebraicNumber (** 2 (/ 1 2)))
> 
> be better?
> 

What is type of argument to this hypotethical function?  AFAICS
constructing floats works well because float can be reconstructed
from few integers.  But for algebraic numbers we need much more
complicated construction: in general we need to specify tower
of algebraic extensions.

> 2) Notice that the InputForm value representing the same expression
> occur with both ** and ^. Which one is currently the preferred form?
>

^ is the preferred form.  ** will be eliminated.
 

-- 
                              Waldek Hebisch
[EMAIL PROTECTED] 

--~--~---------~--~----~------------~-------~--~----~
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