Re: [fricas-devel] Scope markers

2023-04-27 Thread Waldek Hebisch
On Thu, Apr 27, 2023 at 04:34:48PM +0200, Ralf Hemmecke wrote: > On 27.04.23 15:49, Waldek Hebisch wrote: > > > If that goes in, it will go together with test which can serve as > > example. Also, 'scope' is part of internal machinery which should be > > ignorable except for folks that implement

Re: [fricas-devel] Scope markers

2023-04-27 Thread Ralf Hemmecke
On 27.04.23 15:49, Waldek Hebisch wrote: This is part of public disscusion, so back to the list. I'm sorry. I must have hit the wrong botton on my mailer. The above is confusing because polynomial coercions are confusing (they "move" variables up and down). Hmmm... Let me say something gene

Re: [fricas-devel] Scope markers

2023-04-27 Thread Waldek Hebisch
This is part of public disscusion, so back to the list. On Sun, Apr 23, 2023 at 01:03:59AM +0200, Ralf Hemmecke wrote: > On 17.04.23 02:52, Waldek Hebisch wrote: > > Some time I wrote about scope markers. Now I have trial > > implementation (attached patch). > > > With the patch one can do: > >

[fricas-devel] Scope markers

2023-04-16 Thread Waldek Hebisch
Some time I wrote about scope markers. Now I have trial implementation (attached patch). With the patch one can do: P1 := SUP(INT) P2 := SUP(P1) p1 := monomial(monomial(1, 1)$P1, 0)$P2 p2 := monomial(1$P1, 1)$P2 rl := [message(a)$OutputForm for a in ["p", "q", "r", "s", "t"]] set_replacements(rl

Re: [fricas-devel] Scope markers

2022-07-08 Thread Ralf Hemmecke
I think it is better to explain more how SCOPE is supposed to work and what problem it solves. Main point is that coerce to OutputForm works in recursive way, so at any point coerce need to work with incomplete information. To avoid variable clashes we need semi-global approach, that is coordina

Re: [fricas-devel] Scope markers

2022-07-06 Thread Waldek Hebisch
On Tue, Jul 05, 2022 at 09:32:59AM +0200, Ralf Hemmecke wrote: > > >>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 > >>i

Re: [fricas-devel] Scope markers

2022-07-05 Thread Ralf Hemmecke
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 nor

Re: [fricas-devel] Scope markers

2022-06-30 Thread Qian Yun
On 7/1/22 05:29, Waldek Hebisch wrote: p1 and p2 are different, but OutputForm is identical. With scope markers we should get something like (SCOPE (SCOPE "?")) for p1 and (SCOPE "?") for p2. To make this useful we also need to change output. One possibility is to have list of variables

Re: [fricas-devel] Scope markers

2022-06-30 Thread Waldek Hebisch
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 effectivel

Re: [fricas-devel] Scope markers

2022-06-30 Thread Ralf Hemmecke
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

[fricas-devel] Scope markers

2022-06-30 Thread Waldek Hebisch
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 '?'. This means that in case of nested SparseUnivariatePolynomial-s it is hard or