Martin Rubey wrote:
> 
> Dear Waldek,
> 
> I do not really understand your patch to isExpt.
> 
>          isExpt:(%,OP) -> Union(Record(var:K,exponent:Z),"failed")
>            ++ isExpt(p,op) returns \spad{[x, n]} if \spad{p = x**n}
>            ++ and \spad{n <> 0} and \spad{x = op(a)}.
>          isExpt:(%,SY) -> Union(Record(var:K,exponent:Z),"failed")
>            ++ isExpt(p,f) returns \spad{[x, n]} if \spad{p = x**n}
>            ++ and \spad{n <> 0} and \spad{x = f(a)}.
> 

IMHO op(a) is short way of saying that op has exactly one argument
(we can put longer version in documantation comment).  AFAICS
existing code assumes that after isExpt(p, op) x has correct
number of arguments.  However, it is possible to create kernels
with different number of arguments (as the testcase shows).
 
> >From the documentation I'd think that 
> 
> (1) -> p := sum(1/i, i=0..n)
> 
>          n
>         --+   1
>    (1)  >     -
>         --+   i
>         i= 0
>                                          Type: Union(Expression(Integer),...)
> 
> (2) -> isExpt(p^2, operator first kernels p)
> 
>                n
>               --+   1
>    (2)  [var= >     -,exponent= 2]
>               --+   i
>               i= 0
>   Type: Union(Record(var: Kernel(Expression(Integer)),exponent: Integer),...)
> 
> But it seems that after the patch, this is not the case anymore.
> 

first kernels p has 5 arguments, so fails the test.  In all places
where isExpt is used for operators which have different number of
arguments than 1 we need to insert explicit tests for operator and
number of arguments.

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