This reminds me of some of the math teaching literature about the concept
of 'variable' in *elementary* mathematics, e.g. Randolph A. Philipp, "The
Many Uses of Algebraic Variables", *The Mathematics Teacher* *85*:7:557-561
(10/1992) http://www.jstor.org/stable/27967771 -- and that doesn't even go
into issues of scope, as in index variables in sums or variables of
integration. There is room for more thought / work around these very basic
and seemingly simple concepts. Certainly the notion of variable in Maxima
is fairly messy.
As for Maxima's 1/2 *vs. *1+%pi, I am not sure what you mean by
"consistency of behavior". There are at least *three* possible consistent
behaviors:
1. We treat explicit numbers as atomic.
2. We treat things whose external representation includes mathematical
operators (+,-,*,/, ^, sin, ...) as composite. This would mean that 1/2
and 1+%i are composite.
3. We treat things whose internal representation is a Lisp atom as
atomic.
4. We treat those things which we can perform arithmetic on without
invoking the simplifier as atomic.
5. We follow the lead of "part". But problems with that were precisely
why mapatom was introduced: you almost never want map(f,a[i]) to be
(f(a))[f(i)].
(1) is really begging the question: what is an "explicit number"? Clearly
integers, floats, and bigfloats, but how about 2/3, 1+%i and sqrt(2) or for
that matter 1+1/(1+2/3) (continued fraction -- but of course Maxima
simplifies that to a rational).
(2) seems like the simplest and clearest from the user's point of view
(when inflag=false) because you can tell if something is atomic by looking
at it. Thus 2*10^3 (if we allowed that as a simplified expression) would
be non-atomic, while 2.0e3 would be atomic.
(3) and (4) are the most convenient for the implementation, but their
definition depends on the particular implementation.
Under (3), neither rationals (2/3 == ((rat) 2 3) ) nor bigfloats
(0.5b0 == ((bigfloat
56) 36...68 0) would be atomic.
I am not sure which one of these you were advocating for under the rubric
"consistency of behavior"! -- I suspect (2).
-s
On Thu, Sep 27, 2012 at 4:32 AM, Christopher Sangwin <c.j.sangwin at bham.ac.uk
> wrote:
> Yes Stavros,****
>
> ** **
>
> It is an interesting philosophical question whether 1/2, 1+%i, 2^(1/2),
> etc are really atomic. David Tall calls operators like ?/? procepts to
> merge the process/concept, or in maxim parlance verb/noun.****
>
> ** **
>
> ?By using the notation ambiguously to represent either process or product,
> whichever is convenient at the time, the mathematician manages to encompass
> both --- neatly side-stepping a possible object/process dichotomy. E.~Gray
> & D.~Tall (1994)?****
>
> ** **
>
> I guess we all know this! We don?t have that luxury in code though.****
>
> ** **
>
> I was surprised about map, and the apparent inconsistency here. Whatever
> we think, 1/2 isn?t atomic in Maxima, just as 1+%pi isn?t. However they
> are just as ?real?. So, my vote would be for consistency of behaviour
> rather than dogma on the nature of 1/2 even though I have my views....****
>
> ** **
>
> Chris****
>
> ****
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> *From:* macrakis at gmail.com [mailto:macrakis at gmail.com] *On Behalf Of *Stavros
> Macrakis
> *Sent:* 26 September 2012 21:45
> *To:* Richard Fateman
> *Cc:* Christopher Sangwin; maxima at math.utexas.edu
>
> *Subject:* Re: [Maxima] Problems with map.****
>
> ** **
>
> On Wed, Sep 26, 2012 at 2:31 PM, Richard Fateman <
> fateman at eecs.berkeley.edu> wrote:****
>
> ...The internal operator in 1/2 is 'rat' which requires 2 integer
> operands. A special case****
>
> could be set to create f(1)/f(2) which is really f(1) * f(2)^(-1) in
> this example, but
> I'm not sure that map should do that.****
>
> ****
>
> Well, part/args/op treat 1/2 as "/"(1,2) already, even though ?caar(1/2) =
> RAT and ?caar(a/b) = MTIMES.****
>
> ** **
>
> One weird thing here is that mapatom treats 1/2 as atomic even though
> part/args/op are perfectly content to treat it as composite; understandable
> in the a[i] case, but why the 1/2 case?****
>
> ** **
>
> Actually, I think that 1/2 is "a number" and thus atom(1/2) should be
> true. But this atom
> concept is not very accurately portrayed. Atoms should be
> non-decomposable, except
> by nuclear fission..****
>
> ** **
>
> Sure, but you might also want to think of 1+%i, 2^(1/2), and 1+%pi as
> number literals... :-)****
>
> ** **
>
> -s****
>