Note that OutputForm is OK, display problems are in formatters.
I have already found a stupid bug in my formatters. I had set a precedence to MIN instead of p. :-(

Suppose we have the following:

f := operator 'f;
s1 := sum(f(i*j)+f(1), i=1..n1)
s2 := sum(s1+f(2), j=1..n2)

With my change I get the following as output.

\sum_{j=1}^{n2}
    {\left(
     \sum_{i=1}^{n1}
         {\left(
          f(i j)
          +
          f(1)
          \right)}
     +
     f(2)
     \right)}

If one adds the convention that "if \sum_{...}^{...} has a complex argument it is enclosed in parentheses", then one can read that expresssion without ambiguity. The convention basically says that "\sum_{...}^{...}" is considered a function symbol where one can avoid the parentheses around the argument if the argument is "simple". That is somehow actually the SPAD way of avoiding parenthesis for univariate functions.

Of course, without that convention, the expression might still look a bit ambiguous for an ordinary mathematician. Is the "+f(2)" also summed over in the inner sum?

However, adding too many parentheses looks generally ugly. And if I simply convince the formatter to move the second open parenthesis in front of the second sum sign, results in an unclear argument for the inner sum (would the f(1) be under the inner sum or not?).

I think that the above convention would be a good compromise.

What's the opinion of others?

Ralf

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/26780bcf-c6b5-0d00-cd15-05c79c664696%40hemmecke.org.

Reply via email to