Neven Sajko wrote:
> 
> Here's an example:
> 
> (13) -> guess[0,1,0,2,0,3,0,4,0,5,0,6]
> 
>                   s   - 1     s   - 1
>           n - 1    12          11      - p   - 3
>            --+      --+        ++-++      10
>    (13)  [ >        >      - 2  | |    --------- + 1]
>            --+      --+         | |     p   + 2
>           s  = 0  s  = 0      p  = 0     10
>            12      11          10
>                                               Type: 
> List(Expression(Integer))
> 

Here the innermost expression is a product with respect
to p_{10} from 0 to s_{12} - 1.  The function under product
is a rational function.   The there is a sum of this product
multipiled by '-2' and the top expression is again a sum
with the argument beeing inner sum + 1.  There is unfortunate
ambiguity: printing code considers summation and '+' as
having the same priority.  This ambiguity is not present
in TeX output:

(4) -> )set output tex on
(4) -> res

                 s   - 1     s   - 1
         n - 1    12          11      - p   - 3
          --+      --+        ++-++      10
   (4)  [ >        >      - 2  | |    --------- + 1]
          --+      --+         | |     p   + 2
         s  = 0  s  = 0      p  = 0     10
          12      11          10
$$
\left[
{\sum \sb{\displaystyle {{s \sb {{12}}}=0}} \sp{\displaystyle {n -1}} {\left( 
{\sum \sb{\displaystyle {{s \sb {{11}}}=0}} \sp{\displaystyle {{s \sb {{12}}} 
-1}} {\left( -{2 \  {\left( \prod \sb{\displaystyle {{p \sb {{10}}}=0}} 
\sp{\displaystyle {{s \sb {{11}}} -1}} {{-{p \sb {{10}}} -3} \over {{p \sb 
{{10}}}+2}} 
\right)}}
\right)}}+1
\right)}}
\right]
\leqno(4)
$$

                                              Type: List(Expression(Integer))


and TeX-ed result contains parentheses to disambiguate.  More ugly
but also unambiguous result may be obtained via 'unparse':

(3) -> unparse(res::InputForm)

   (3)
  "[%defsum(%defsum(-2*%defprod((-1*%B+-3)/(%B+2),%B,*01000p(10),0,%C+-1),%C,*0
  1000s(11),0,%D+-1)+1,%D,*01000s(12),0,n+-1)]"
                                                                 Type: String

-- 
                              Waldek Hebisch

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