MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How do you read Mathematica?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg118953] Re: How do you read Mathematica?
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Tue, 17 May 2011 07:48:14 -0400 (EDT)

I'd much rather that Mathematica read as follows:

   x = y         "x is set equal to y"
   x == y        "x equals y"
   x ===y        "x same as y"
   x /. y        "x where y"

Or something of the kind. It's a bit tricky, because the exact, 
syntactically correct, way to say it may depend on the context.

And, more significantly, to render meaningfully in speech implies 
"understanding" the meaning, that is, being able to parse the 
expression. This would seem to be a whole level of complexity beyond 
what the speech engine at present does.

On 5/16/2011 3:34 AM, Richard Fateman wrote:
> I was not proposing that a user should write a program using
> Mathematica's bletcherous Hold, HoldForm, TextForm, etc.
>
> I was suggesting that there is a simple solution available to the
> programmer of the Speak command, which is to take the expression that it
> is given and speak it in FullForm.
>
> Naturally one cannot utter   x/.x->y   as a command and expect it to
> remain unevaluated, so Hold[]  or perhaps HoldForm[x/.x->y] probably
> plays a role.
>
> The speak program in version 7.0 on Windows (which is the latest I have
> access to), does a really poor job on something like f[a,b,c].  It
> doesn't know how to pronounce "a" (as someone noted) or even "f" in this
> context. It doesn't know how to pronounce ReplaceAll, either.
>
> The idea that mathematics can be spoken out loud requires only a few
> tricks to implement, at least most of the way.  For example a teacher
> writing math on a blackboard will often speak while writing.
>
> This is the language of (some of) Mathematica's DATA.
>
> Infix Mathematica command notation, the language of Mathematica's many
> symbols, does not have a natural rendering as speech in any existing
> conventional form, except where it coincidentally overlaps with
> Mathematica DATA as conventional math expressions. Someone could come up
> with such additional conventions, but Speak doesn't do it.
>
> Consider Speak[Hold[...]]   of these expressions:
> x=y
> x==y
> x===y
>
> Would you rather have them rendered as
> x equals y
> x equals equals y
> x equals equals equals y
>
> or as
>
> Set x y
> Equal x y
> SameQ x y
>
> I think this latter set is better.  It is sort of what FullForm
> produces, which was my point, though it's actually
> Set[x,y]
> Equal[x,y]
> SameQ[x,y]
>
>    Now you must verbalize the brackets and commas, in general, or somehow
> operator precedences must be taken into account.  It is unlikely that
> the ordinary Mathematica user has an accurate internal model of the
> precedence of all the symbolic notation, so the brackets may be
> necessary anyway.
>     If you want to combine this with (say) ordinary rules of spoken
> mathematical formulas like eks plus why   for x+y,  instead of
> Plus[x,y], I think that can be done.
>
> By the way, a program to x+y out loud is (most likely) written by
> traversing the internal form Plus[x,y] to render eks plus why, mirroring
> the display program which, when traversing the internal form Plus[x,y]
> displays x+y.
>
> So the program I've suggested, which uses FullForm, is SIMPLER than the
> existing Speak program.  Though to do it right, would require
> substantial fixes, like using (<spell>  a)  to render "Ayh" instead of
> "ah". and figuring out f[a,b,c] as perhaps eff on 3 arguments ayh
> <pause?>  Bee<pause?>  and See.
> [not really satisfactory, but you get the idea]
>
> RJF
>
>
>
>
>    On 5/15/2011 4:06 AM, Murray Eisenberg wrote:
>> No, what you will get from
>>
>>      FullForm[x/. x->y]
>>
>> is _not_
>>
>>      ReplaceAll[x,Rule[x,y]]
>>
>> but rather just:
>>
>>      y
>>
>> To start getting FullForm, you need to use some Hold first.
>>
>> So suppose you evaluate
>>
>>      FullForm[Hold[x /. x ->   y ]]
>>
>> so as to obtain:
>>
>>      Hold[ReplaceAll[x,Rule[x,y]]]
>>
>> If you now try to Speak as input that last output, perhaps surprisingly
>> you'll get:
>>
>> "Hold of the quantity x slash dot x goes to y"
>>
>>
>> On 5/14/2011 3:08 AM, Richard Fateman wrote:
>>>
>>> ...As for reading Mathematica out loud, there is a simple solution that,
>>> however, exposes the cryptic nature of Mathematica's syntax.
>>> Simply read out loud the FullForm. That gives "words" for notation like /.
>>>
>>> Thus  x/. x->y  is
>>>
>>> ReplaceAll[x,Rule[x,y]].
>>>
>>> So all you need is a verbalization of [, ], and ",".
>>
>
>

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: NotebookGetExpression
  • Next by Date: Re: Plot image changes size during animation
  • Previous by thread: Re: How do you read Mathematica?
  • Next by thread: Re: How do you read Mathematica?