Nounforms and semantic free-of WAS: Improving the function 'at'



Dieter,

This looks great, thanks!

One big question not really specifically about 'at' -- if an expression is
syntactically free of a variable, should we assume it is semantically free
of it?

For example, you have 'at(x,[y=1]) => x.

Maxima does not appear to be consistent about this.  For diff, it does
*not*assume this:

    'diff(y,x) => dy/dx            nounform does not assume semantic free-of
    diff(y,x) => 0                   verb does

In fact, 'diff would be pretty much useless if this were not the case.

However, other noun/verb pairs do assume this:

    'integrate(x,y) = integrate(x,y) => x*y

    'limit(x,y,0) = limit(x,y,0) = x

The 'diff' behavior makes sense because it allows, for example,
subst(sin(x),y,'diff(y,x)).

I'm not sure what the correct answer is....

                -s


On Mon, May 17, 2010 at 14:56, Dieter Kaiser <drdieterkaiser at web.de> wrote:

> We have the following bug reports:
>
> ID: 1184718 - AT needs some basic simplifications
> ID: 2014941 - composition of 'at'
> ID: 2556133 - "at" should do parallel substitutions
> ID: 2998227 - spurious at(0,A=0)
> ID: 2996106 - at(diff(f(x,y),x,1,y,1),[x=a,y=b]) is wrong
>
> I have tried an implementation to overcome these reported bugs. The main
> extension is a simplifying function simp-%at.
>
> 1. Basic simplifications:
>
> (%i1) 'at(2,x=a);
> (%o1) 2
>
> (%i2) 'at(%pi,x=a);
> (%o2) %pi
>
> 2. Compositon of 'at':
>
> (%i3) at(diff(f(x),x),[x=b]);
> (%o3) 'at('diff(f(x),x,1),[x = b])
> (%i4) at(%,b=y);
> (%o4) 'at('diff(f(x),x,1),[x = y])
>
> 3. More simplifications:
>
> (%i5) diff(f(z),z);
> (%o5) 'diff(f(z),z,1)
> (%i6) at(%,x=1);
> (%o6) 'diff(f(z),z,1)
>
> 4. Equations are sorted and are eliminated:
>
> (%i7) diff(f(x,y),x,1,y,1);
> (%o7) 'diff(f(x,y),x,1,y,1)
> (%i8) at(%,[x=a,y=b]) - at(%,[y=b,x=a]);
> (%o8) 0
>
> (%i9) 'at(x*y,[y=b,x=a,z=c]);
> (%o9) 'at(x*y,[x = a,y = b])
>
> 5. Parallel substitution:
>
> (%i11) at(atan2(y^2+1,x),[y=%i,x=0]);
> atan2: atan2(0,0) is undefined.
>  -- an error. To debug this try: debugmode(true);
>
> (%i12) at(atan2(y^2+1,x),[x=0,y=%i]);
> atan2: atan2(0,0) is undefined.
>  -- an error. To debug this try: debugmode(true);
>
> The code can be further improved. The first implementation solves the
> known problems. We have no problems with the testsuite and one new
> correct result for the share_testsuite.
>
> Any comments? Is the parallel substitution the desired behavior of at?
> Is it of interest to have the reported types of simplifications?
>
> Dieter Kaiser
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>