## #185 Bad display of unsimplified expr

closed
nobody
5
2011-07-18
2002-11-08
No

f(n):=IF n = 0 THEN 1 ELSE 91919*gg(x^n+f(EV(n-
1,SIMP)))

simp:false;

Now calculate and display f(6)*f(6) (with the display
window fairly narrow, say 60 columns wide).

displa generates lines that are wider than the window,
which wrap around and make the display illegible
(especially the exponents).

I realize that unsimplified expressions are an unusual
case.... I ran across this problem during a debugging
session where I turned of SIMP to check something.

## Discussion

• Robert Dodier - 2006-07-01
• labels: --> Lisp Core

• Robert Dodier - 2006-07-01

Logged In: YES
user_id=501686

Another bit of simp / display strangeness:

simp : false;
matrix ([a, b], [c, d]);

Result is displayed as "matrix([a, b], [c, d])" (i.e.
without the ascii art). I wonder why unsimplified matrices
aren't displayed the same as simplified ones.

• Dieter Kaiser - 2010-02-02
• summary: Bad display of unsimplified expr --> Bad 2d-display of a long denominator

• Dieter Kaiser - 2010-02-02

I think this problem is not restricted to unsimplified expressions. It is a general problem of the 2d-display.

This is the most simple example I have found to see the general problem.

We take a long numerator and a long denominator.

(%i1) num:a1+a2+a3+a4+a5+a6+a7+a8+a9;
(%o1) a9 + a8 + a7 + a6 + a5 + a4 + a3 + a2 + a1
(%i2) denom:b1+b2+b3+b4+b5+b6+b7+b8+b9;
(%o2) b9 + b8 + b7 + b6 + b5 + b4 + b3 + b2 + b1

We set linel to a small value 10.

(%i4) linel:10;
(%o4) 10

We display num/denom. This is a correct display.

(%i5) num/denom;
(%o5) (a9
+ a8 + a7
+ a6 + a5
+ a4 + a3
+ a2
+ a1)
/(b9 + b8
+ b7 + b6
+ b5 + b4
+ b3 + b2
+ b1)

We get the error when we multiply the denominator with a further constant. The last line is no longer broken up correctly:

(%i6) num/(x*denom);
(%o6) (a9
+ a8 + a7
+ a6 + a5
+ a4 + a3
+ a2
+ a1)
/((b9 + b8 + b7 + b6 + b5 + b4 + b3 + b2 + b1) x)

I had a look into the display routines. The additional constant x causes a nested expression which seems to confuse the highly recursive algorithm and the counting of space available for the expression. But I have not seen a way to correct this behaviour.

Remark: The display of unsimplified matrices is easy to correct. The 2d-display routines have a check for unsimplified matrices. This can be removed without problems.

Changing the title to reflect the issue.

Dieter Kaiser

• Dieter Kaiser - 2010-02-03

Sorry, but I have mixed up this problem with the problem of bug report ID: 1954693. Since Maxima 5.15 we have two problems with the 2d-display. I have recognised this today, because I had a look at all Maxima versions from 5.9 to 5.20 to find the differences in 2d-display.

The problem of this bug report is present since Maxima 5.9, it is not a problem of a long denominator but of a long unsimplified expression. The problem is still present in Maxima 5.20post.

Reverting the change of the title.

Dieter Kaiser

• Dieter Kaiser - 2010-02-03
• summary: Bad 2d-display of a long denominator --> Bad display of unsimplified expr

• Dieter Kaiser - 2011-07-18
• status: open --> closed

• Dieter Kaiser - 2011-07-18

Fixed in the function dimnary in the file displa.lisp with revision 18 Jul 2011.
Closing this bug report as fixed.
Dieter Kaiser