MathGroup Archive 2002

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

Search the Archive

RE: RE: CirclePlus precedence and bigoplus

  • To: mathgroup at smc.vnet.net
  • Subject: [mg36259] RE: [mg36171] RE: [mg36138] CirclePlus precedence and bigoplus
  • From: "Wolf, Hartmut" <Hartmut.Wolf at t-systems.com>
  • Date: Thu, 29 Aug 2002 01:37:41 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

>-----Original Message-----
>From: David Park [mailto:djmp at earthlink.net]
To: mathgroup at smc.vnet.net
>Sent: Monday, August 26, 2002 10:16 AM
>Subject: [mg36259] [mg36171] RE: [mg36138] CirclePlus precedence and bigoplus
>
>
>Lucas,
>
>I hope that your question will provoke a number of replies 
>because I think
>it is an interesting topic.
>
>First, it would be nice if Mathematica had a ShowPrecedence 
>statement to
>quickly retrieve a precedence number for any command. It is a bit time
>consuming to search through the table in Section A.2.7.
>
>Next, it would be nice if the user could set the precedence 
>for operators
>that don't have built-in definitions.
>
>Since it appears that you can't do that, is it possible to switch the
>meanings of Plus and CirclePlus in your theory? Are you 
>depending on the
>numerical behavior of Plus? Go with the precedence that 
>Mathematica gives
>you. Or you could use something like VerticalBar or RightTee which have
>lower precedence than Plus, but perhaps don't have the look 
>that you want.
>
>You could try to use the Notation package for your CirclePlus 
>sum. But I
>always find the Notation package difficult to use and like to use
>StandardForm as much as possible. One possibility is...
>
>\!\(\((\[Sum]\+\(i = 1\)\%5 x[i])\) /. Plus -> CirclePlus\)
>
>These are weak answers to your question, but maybe they will 
>bring in more
>discussion.
>
>David Park
>djmp at earthlink.net
>http://home.earthlink.net/~djmp/
>
>
>
>From: Lucas [mailto:lscharen at d.umn.edu]
To: mathgroup at smc.vnet.net
>
>Hello,
>
>I'm attempting to implement an abstract mathematica package in
>mathematica that utilized the \[CirclePlus] operator in an unusual
>way.  Specifically, the \[CirclePlus] has a precidence lower than +
>and introduces barriers in the computation.  So, an expression such as
>
>a + b \[CirclePlus] c + d   --> (a+b) \[CirclePlus] (c+d)
>
>The mathematica ouput of
>
>a + d + (b \[CirclePlus] c) is incorrect.  I've tried playing with the
>PrecedenceForm[] function, but that does not seem able to produce the
>desired effect.
>
>Also, I would like to introduce a notation like
>
>        N
>\[BigCirclePlus] x[[i]] --> x[[1]] \[CirclePlus] x[[2]] \[CirclePlus]
>....
>       i=0
>
>analagous to summation, but mathematica does not appear to offer the
>CirclePlus in a large format.  to relate this to the case above, x[1]
>= (a + b) and
>x[2] = (c + d), so each indexed element is a subexpression.
>
>Finally, I would like to be able to set up the CirclePlus operator
>such that the following algebraic relations hold:
>
>
>\Sum \BigCirclePlus E    =  \BigCirclePlus \Sum E
>  i        j         ij            j         i   ij
>
>d                                        d
>-- \BigCirclePlus E    =  \BigCirclePlus -- E
>dx        j        j             j       dx  j
>
>
>Thanks in advance for any help on the above.
>
>-Lucas Scharenbroich
>-MLS Group / JPL
>
>
>

Lucas,

I'm certainly not competent to give you any answer, and me too, I'd be eager
to hear such -- hoped Wolfram's to react; anyway, here is my opinion.

PrecedenceForm is only for parenthesizing at output.

Although we have MakeExpressions to add semantic actions to the Mathematica
"compiler" (if we may call such the transformation from input string, i.e.
"language", to the internal representation as indicated by FullForm i.e.
"code"), we cannot influence the Mathematica syntax proper, i.e. parsing.
The operator precedence rules however are part of that (esp. needed for box
formation). So I can't see a way to reach your goal. 

Now, I don't know what your ordinary Plus shall designate. If it's only
abstract, i.e. you don't use it for numeric calculation, you possibly might
interchange the roles of Plus and CirclePlus

In[6]:= a \[CirclePlus] b + c \[CirclePlus] d
Out[6]= a\[CirclePlus]b + c\[CirclePlus]d

As for BigCirclePlus (if you still need it after the reassigned meanings)
I'd try to define a palette, but perhaps this is not possible to the extend
you desire. I never tried.

Another approach would be to use Union and Intersection for "low precedence"
plus and low "precedence times" (or \[Subset]; \[Superset] or \[And]; \[Or]
or \[Therefore];\[Because]  or ...).

The ultima ratio is to write a new front end.

But, if I were you, I'd ignore these kind of problems at first and set up
the package fully functioning (with 1D input), apply it to your problems and
investigations, and finally, when time comes to publishing, at output
formatting you have quite a lot of choices.

I'm sorry, just wanted to keep the discussion alive, since anyway, this is
of much interest.

--
Hartmut


  • Prev by Date: Re: SIR epidemic Model
  • Next by Date: Sub- and Superscripts in FrameLabel
  • Previous by thread: Re: CirclePlus precedence and bigoplus
  • Next by thread: Re: CirclePlus precedence and bigoplus