Wolfram ResearchPRODUCTSPURCHASEFOR USERSCOMPANYOUR SITES
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Previous section-----Next section

2.9.15 Operators without Built-in Meanings

When you enter a piece of input such as 2 + 2, Mathematica first recognizes the + as an operator and constructs the expression Plus[2, 2], then uses the built-in rules for Plus to evaluate the expression and get the result 4.

But not all operators recognized by Mathematica are associated with functions that have built-in meanings. Mathematica also supports several hundred additional operators that can be used in constructing expressions, but for which no evaluation rules are initially defined.

You can use these operators as a way to build up your own notation within the Mathematica language.

The  is recognized as an infix operator, but has no predefined value.

In[1]:=  2CirclePlus3//FullForm

Out[1]//FullForm=

In StandardForm,  prints as an infix operator.

In[2]:=  2CirclePlus3

Out[2]=

You can define a value for  .

In[3]:=  x_ CirclePlus y_ := Mod[x + y, 2]

Now  is not only recognized as an operator, but can also be evaluated.

In[4]:=  2 CirclePlus 3

Out[4]=

x  y CirclePlus[x, y]
x  y TildeTilde[x, y]
x  y Therefore[x, y]
x  y LeftRightArrow[x, y]
 x Del[x]
 x Square[x]
 x,y, ...  AngleBracket[x, y, ... ]

A few Mathematica operators corresponding to functions without predefined values.

Mathematica follows the general convention that the function associated with a particular operator should have the same name as the special character that represents that operator.

\[Congruent] is displayed as  .

In[5]:=  x \[Congruent] y

Out[5]=

It corresponds to the function Congruent.

In[6]:=  FullForm[%]

Out[6]//FullForm=

x \[name] y name[x, y]
\[name] x name[x]
\[Leftname] x, y, ... \[Rightname] name[x, y, ... ]

The conventional correspondence in Mathematica between operator names and function names.

You should realize that even though the functions CirclePlus and CircleTimes do not have built-in evaluation rules, the operators  and  do have built-in precedences. Section A.2.7 lists all the operators recognized by Mathematica, in order of their precedence.

The operators  and  have definite precedences--with  higher than  .

In[7]:=  x CircleTimes y CirclePlus z // FullForm

Out[7]//FullForm=

 Subscript[x, y]
 SubPlus[x]
 SubMinus[x]
 SubStar[x]
 SuperPlus[x]
 SuperMinus[x]
 SuperStar[x]
 SuperDagger[x]
 Overscript[x, y]
 Underscript[x, y]
 OverBar[x]
 OverVector[x]
 OverTilde[x]
 OverHat[x]
 OverDot[x]
 UnderBar[x]

Some two-dimensional forms without built-in meanings.
Subscripts have no built-in meaning in Mathematica.

In[8]:=  {x} . XMLElement[sub, {}, {2}]+{y} . XMLElement[sub, {}, {2}]//InputForm

Out[8]//InputForm=

Most superscripts are however interpreted as powers by default.

In[9]:=  x2+y2//InputForm

Out[9]//InputForm=

A few special superscripts are not interpreted as powers.

In[10]:=  x+y+//InputForm

Out[10]//InputForm=

Bar and hat are interpreted as OverBar and OverHat.

In[11]:=  x_+y^//InputForm

Out[11]//InputForm=


Any questions about topics on this page? Click here to get an individual response.Buy NowFree TrialMore Information



 © 2009 Wolfram Research, Inc.  Terms of Use  Privacy Policy |
Sign up for our newsletter: