On Fri, Jul 01, 2022 at 12:20:35AM +0200, Ralf Hemmecke wrote:
> On 30.06.22 23:29, Waldek Hebisch wrote:
> >I mentioned that some time ago.  I would like to add indication of
> >scope to OutputForm.  Main reason is SparseUnivariatePolynomial. In
> >SparseUnivariatePolynomial variable is effectively anonymous and for
> >output uses '?'.
> 
> Is this the only reason?
> 
> In case it is, my first feeling is. No bug, don't fix it. If a user
> wants a proper variable name, he should use UnivariatePolynomial,
> because that explicitly requires a variable name for the output.

Sorry, this is _very_ wrong.  Any fixed name could clash with
user variable names, so library normally uses SUP.  In several
cases user has no choice because SUP is the only thing.

SUP is most prominent case because it is widely used.  But the
same problems appears with POLY/EXPR like domain nested one
in anothers.  Those are less significant as in such case user
has more control of variable names.  Also, interpreter forbids
several such combinations (but they are used by the library).

> My understanding is that SUP is for internal purposes where the name of
> the variable is irrelevant. And I do not see that in our algebra library
> the use of SUP causes any problem.

It causes trouble if you start looking at "internal" stuff.
And there were bug reports about this (nothing recent,
apparently our users treat this as "unsolvable problem").

> If you do not accept that position, then another simple idea is that
> for the variable name is only really a problem, if we have SUP(A) and SUP(B)
> with different coefficient rings A and B. That, however, leads to two
> instantiations of SUP, right? What about simply generating a new lisp symbol
> with every instance of SUP and store it as a domain variable/constant. That
> symbol would then be used for output. No need to change OutputForm.

That has many problems.  One is getting unpredictable variable names.
Another is that logically the same domain may be re-instantiated 
effectlevely getting different name.

Change to OutputForm is appropriate as only output is affected:
if nobody looks at output then new OutputForm will be unused...

-- 
                              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 view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/20220630225713.GA25488%40fricas.math.uni.wroc.pl.

Reply via email to