how to use a subscripted variable in a "depends" statement



Robert,

I agree it would be nice to be able to declare properties of subscripted
variables.  I think we can solve the implementation issue once we figure out
what we want the semantics to be.  What semantics do you have in mind?  Not
sure there is a difficult problem here, but trying to think through the
possibilities....

           -s

Suppose I declare a[i] is P:

Is a[i] P for *all* i? (implicit universal quantifier) -- call this
Universal

Or only if the argument is identically the symbol "i"?  (similar to f[i]:
23) -- call this Syntactic

Or if Maxima can prove that the argument equals i?  is(expr=i) implies
P(a[expr]) -- call this Semantic


Conversely, if I declare a[1] to have property P:

Presumably a[1] is P.

Does a[i] also have property P when i=1 according to the assume DB?

In the Universal case, if I declare a[i] to be P, presumably declaring a[j]
to be NotP causes an error.

In the Universal case, does P( a[i,i] ) only apply when the two arguments
are equal?  Or is it universally quantified for each argument independently?

What about the Semantic case?  Presumably we take the usual Maxima "best
effort" approach, i.e. if Maxima knows x=i, then it will treat a[x] as being
P, otherwise not.  If I declare a[i] to be P and a[j] to be NotP, what
happens if I later assume(equal(i,j))?  (Perhaps declare enters the
assumption not equal(i,j)?)




On Sat, Oct 29, 2011 at 15:45, Robert Dodier <robert.dodier at gmail.com>wrote:

> On 10/29/11, Ether Jones <maxima at etherjones.us> wrote:
>
> > Is there a way to use a subscripted variable in a "depends" statement?
>
> No, to the best of my knowledge.
>
> depends(foo, x) puts its data (the dependency on x) on the property list of
> foo.
> (You can see that with :lisp (symbol-plist '$foo) after depends(foo, x).)
> That doesn't work for subscripted variables, because they are not symbols
> and therefore don't have a property list.
>
> There are various declarations which make use of the symbol property
> list, which therefore don't work for subscripted variables.
> I think it would be a good idea to generalize all of those declarations
> in some way, so that they work equally well for subscripted and
> unsubscripted variables.
>
> best
>
> Robert Dodier
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>