On Wed, 16 Feb 2005 08:54:05 -0800 (PST), Robert Dodier
wrote:
> (%i4) (([a], asksign (a)), print (is (a > 0)), facts (initial));
> Is a positive, negative, or zero?
> p;
> true
> (%o4) [a > 0]
> At present the policy appears to be "keep assertions in db
> til we get back to the input prompt", but maybe it should be
> something like "keep assertions in db til they go out of
> scope" ??
Well, Maxima actually doesn't have the notion of scope for a
mathematical variable (as opposed to a programming variable). Of
course, it should, but it doesn't. Even the locality of dummy
variables in sum, product, etc. is special-cased in every routine
which walks the expression tree, and sure enough, Maxima is not
consistent in how it treats them. This has been discussed several
times on the mailing list, but I don't have time now to look up the
references....
Note that there are some non-trivial design issues here. For example,
what should be the value of
block([x],x)-block([x],x)?
Surely by the principle of arbitrariness of dummy variables, this
should give the same result as
block([x],x) - block([y],y)
namely something like
anonymous_variable_1 - anonymous_variable_2
and not 0. But what use is the anonymous-variable result?
-s
PS The syntax ([x],...) in Maxima has no special meaning. In
particular, it is *not* equivalent to block([x],...) or
lambda([x],...). But even if you'd used block or lambda, that
wouldn't have changed things.