axiom-developer
[Top][All Lists]

[Axiom-developer] [#8 (Savannah bug #9297) output misses some parenthesi

 From: Bill Page Subject: [Axiom-developer] [#8 (Savannah bug #9297) output misses some parenthesis] Date: Sun, 23 Jan 2005 13:48:06 -0600

??changed:
-Martin
Bill Page wrote:

Why is it that the LaTeX output for this example:
\begin{axiom}
)set output algebra off
product(summation(i*j, i=a..b),j=c..d)
\end{axiom}

gets the parenthesis right but the text output version does not?

Martin Rubey wrote:

Ok, I looked at it more closely. Consider the two example-pairs:

\begin{axiom}
product(summation(i*j, i=a..b),j=c..d)::OUTFORM::SEX
summation(i^2^(d-c+1),i=a..b)::OUTFORM::SEX
\end{axiom}

and

\begin{axiom}
sum(operator(f)(i)+1,i=1..n)::OUTFORM::SEX
(sum(operator(f)(i),i=1..n)+1)::OUTFORM::SEX
\end{axiom}

So in both cases, the OUTFORM internally is different. The domain
Tex works on OUTFORM, and in the case of exponentiation "^" it
seems to work well, in the case of "+" this is not the case. I don't
understand the algorithm.

I don't really understand how the interpreter converts OUTFORM to
something which is displayed on the screen. Very probably, this is
done in src/interp/i-output.boot, however, I find the code very

So I have to agree that OUTFORM is not simply broken.
However, I still think that my patch is better than none. I would
never release Axiom without fixing this somehow.

There is another issue. What would you like as output? It seems to
me, that the only exceptional case is, if nothing appears to the
right of sum or product. Only in this case, parenthesis might be
unnecessary.  On the other hand, how would you intuitively interpret
an output like::

n
--+
>     f(i) + 1 ?
--+
i= 1

Is it $(\sum_{i=1}^n f(i) ) + 1$ or $\sum_{i=1}^n (f(i) + 1)$ ?

Could we agree on adopting the quick fix for the first public
release, but leaving the issue open?

It's important to me, since my guessing program will very
often produce this ambigouus output.

--