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

A.2.7 Operator Input Forms

Characters that are not letters, letter-like forms or structural elements are treated by Mathematica as operators. Mathematica has built-in rules for interpreting all operators. The functions to which these operators correspond may or may not, however, have built-in evaluation or other rules. Cases in which built-in meanings are by default defined are indicated by  in the tables below.

Operators that construct two-dimensional boxes--all of which have names beginning with back-slash--can only be used inside \( ... \). The table below gives the interpretations of these operators within \!\( ... \). Section A.2.9 gives interpretations when no \! is included.

expr and  any expression
symb any symbol
patt any pattern object
string and  "cccc" or a sequence of letters, letter-like forms and digits
filename like string, but can include additional characters described below
 built-in meanings exist

Objects used in the tables of operator input forms.

operator form full form grouping
forms representing numbers (see Section A.2.5) LeftTriangle
forms representing symbols (see Section A.2.4) LeftTriangle
forms representing character strings (see Section A.2.3) LeftTriangle
 {{ ,  , ... }, { ,  , ... }, ... } LeftTriangle
 Piecewise[{{ ,  }, { ,  }, ... }] LeftTriangle
expr::string MessageName[expr, "string"] LeftTriangle
expr:: :: MessageName[expr, " ", " "] LeftTriangle
forms containing # (see Section A.2.7) LeftTriangle
forms containing % (see Section A.2.7) LeftTriangle
forms containing _ (see Section A.2.7) LeftTriangle
<< filename Get["filename"] LeftTriangle
 Overscript[ ,  ]
 \&  Overscript[ ,  ] e\&(e\&e)
 Underscript[ ,  ]
 \+  Underscript[ ,  ] e\+(e\+e)
 Underoverscript[ ,  ,  ]
 \+  \%  Underoverscript[ ,  ,  ]
 \&  \%  Underoverscript[ ,  ,  ]
 Subscript[ ,  ]
 \_  Subscript[ ,  ] e\_(e\_e)
 \_  \%  Power[Subscript[ ,  ],  ] LeftTriangle
\!boxes (interpreted version of boxes)
 ? PatternTest[ ,  ] LeftTriangle
 [ , ... ]  [ , ... ] (e[e])[e] LeftTriangle
 [[ , ... ]] Part[ ,  , ... ] (e[[e]])[[e]] LeftTriangle
   , ...  Part[ ,  , ... ] (e e ) e LeftTriangle
 Part[ ,  , ... ]  LeftTriangle

Operator input forms, in order of decreasing precedence, part one.

operator form full form grouping
\*expr (boxes constructed from expr)
expr++ Increment[expr] LeftTriangle
expr-- Decrement[expr] LeftTriangle
++expr PreIncrement[expr] LeftTriangle
--expr PreDecrement[expr] LeftTriangle
 @   [ ] e @ (e @ e) LeftTriangle
  (invisible application, input as  AliasIndicator@AliasIndicator  ) LeftTriangle
 [ ]
 ~  ~   [ ,  ] (e ~ e ~ e) ~ e ~ e LeftTriangle
 /@  Map[ ,  ] e /@ (e /@ e) LeftTriangle
 //@  MapAll[ ,  ] e //@ (e //@ e) LeftTriangle
 @@  Apply[ ,  ] e @@ (e @@ e) LeftTriangle
 @@@  Apply[ ,  , {1}] e @@@ (e @@@ e) LeftTriangle
expr! Factorial[expr] LeftTriangle
expr!! Factorial2[expr] LeftTriangle
 Conjugate[expr] LeftTriangle
 Transpose[expr] LeftTriangle
 ConjugateTranspose[expr] LeftTriangle
 ConjugateTranspose[expr] LeftTriangle
expr' Derivative[1][expr] LeftTriangle
expr'' ... ' (n times) Derivative[n][expr] LeftTriangle
 <>  <>  StringJoin[ ,  ,  ] e <> e <> e LeftTriangle
 ^  Power[ ,  ] e^(e^e) LeftTriangle
 Power[ ,  ]  LeftTriangle
 Power[Subscript[ ,  ],  ] LeftTriangle
 \^  \%  Power[Subscript[ ,  ],  ] LeftTriangle
vertical arrow and vector operators
 expr Sqrt[expr]  ( e) LeftTriangle
\@ expr Sqrt[expr] \@(\@e) LeftTriangle
\@ expr \% n Power[expr, 1/n] LeftTriangle
    Integrate[ ,  ]  ( e  e)  e LeftTriangle
 Integrate[ , { ,  ,  }]  ( e  e)  e LeftTriangle
other integration operators: see Section A.2.7
 D[ ,  ]  LeftTriangle
 expr Del[expr]  ( e)
 expr Square[expr]  ( e)
     SmallCircle[ ,  ,  ] e  e  e

Operator input forms, in order of decreasing precedence, part two.

operator form full form grouping
     CircleDot[ ,  ,  ] e  e  e
 **  **  NonCommutativeMultiply[ ,  ,  ] e ** e ** e
     Cross[ ,  ,  ] e  e  e LeftTriangle
 .  .  Dot[ ,  ,  ] e . e . e LeftTriangle
-expr Times[-1, expr] LeftTriangle
+expr expr LeftTriangle
 expr PlusMinus[expr]
 expr MinusPlus[expr]
 /   ( )^-1 (e / e) / e LeftTriangle
   Divide[ ,  ] (e  e)  e LeftTriangle
 \/  Divide[ ,  ] (e\/e)\/e LeftTriangle
     Backslash[ ,  ,  ] e  e  e
     Diamond[ ,  ,  ] e  e  e
     Wedge[ ,  ,  ] e  e  e
     Vee[ ,  ,  ] e  e  e
     CircleTimes[ ,  ,  ] e  e  e
     CenterDot[ ,  ,  ] e  e  e
   Times[ ,  ,  ] e e e LeftTriangle
 *  *  Times[ ,  ,  ] e * e * e LeftTriangle
     Times[ ,  ,  ] e  e  e LeftTriangle
     Star[ ,  ,  ] e  e  e
 Product[ , { ,  ,  }]  ( e) LeftTriangle
     VerticalTilde[ ,  ,  ] e  e  e
     Coproduct[ ,  ,  ] e  e  e
     Cap[ ,  ,  ] e  e  e
     Cup[ ,  ,  ] e  e  e
     CirclePlus[ ,  ,  ] e  e  e
   CircleMinus[ ,  ] (e  e)  e

Operator input forms, in order of decreasing precedence, part three.

operator form full form grouping
 Sum[ , { ,  ,  }]  ( e) LeftTriangle
 +  +  Plus[ ,  ,  ] e + e + e LeftTriangle
 -   + (-1  ) (e - e) - e LeftTriangle
   PlusMinus[ ,  ] (e  e)  e
   MinusPlus[ ,  ] (e  e)  e
   Intersection[ ,  ] e  e  e LeftTriangle
other intersection operators
   Union[ ,  ] e  e  e LeftTriangle
other union operators
 Equal  Equal[ ,  ] e Equal e Equal e LeftTriangle
   Equal[ ,  ] e  e  e LeftTriangle
   Equal[ ,  ] e  e  e LeftTriangle
 NotEqual  Unequal[ ,  ] e NotEqual e NotEqual e LeftTriangle
   Unequal[ ,  ] e  e  e LeftTriangle
other equality and similarity operators
 >  Greater[ ,  ] e > e > e LeftTriangle
 GreaterEqual  GreaterEqual[ ,  ] e GreaterEqual e GreaterEqual e LeftTriangle
   GreaterEqual[ ,  ] e  e  e LeftTriangle
   GreaterEqual[ ,  ] e  e  e LeftTriangle
 <  Less[ ,  ] e < e < e LeftTriangle
 LessEqual  LessEqual[ ,  ] e LessEqual e LessEqual e LeftTriangle
   LessEqual[ ,  ] e  e  e LeftTriangle
   LessEqual[ ,  ] e  e  e LeftTriangle
other ordering operators
   VerticalBar[ ,  ] e  e  e
   NotVerticalBar[ ,  ] e  e  e
   DoubleVerticalBar[ ,  ] e  e  e
   NotDoubleVerticalBar[ ,  ] e  e  e
horizontal arrow and vector operators
diagonal arrow operators
 Equal=  SameQ[ ,  ] e Equal= e Equal= e LeftTriangle
 =NotEqual  UnsameQ[ ,  ] e =NotEqual e =NotEqual e LeftTriangle

Operator input forms, in order of decreasing precedence, part four.

operator form full form grouping
   Element[ ,  ] e  e  e LeftTriangle
   NotElement[ ,  ] e  e  e LeftTriangle
   Subset[ ,  ] e  e  e
   Superset[ ,  ] e  e  e
other set relation operators
 ForAll[ ,  ]  LeftTriangle
 Exists[ ,  ]  LeftTriangle
 NotExists[ ,  ]
!expr Not[expr] !(!e) LeftTriangle
 expr Not[expr]  ( e) LeftTriangle
 &&  &&  And[ ,  ,  ] e && e && e LeftTriangle
     And[ ,  ,  ] e  e  e LeftTriangle
     Nand[ ,  ,  ] e  e  e LeftTriangle
     Xor[ ,  ,  ] e  e  e LeftTriangle
 ||  ||  Or[ ,  ,  ] e || e || e LeftTriangle
     Or[ ,  ,  ] e  e  e LeftTriangle
     Nor[ ,  ,  ] e  e  e LeftTriangle
   Implies[ ,  ] e (e e) LeftTriangle
   Implies[ ,  ] e (e e) LeftTriangle
   RightTee[ ,  ] e  (e  e)
   DoubleRightTee[ ,  ] e  (e  e)
   LeftTee[ ,  ] (e  e)  e
   DoubleLeftTee[ ,  ] (e  e)  e
   SuchThat[ ,  ] e  (e  e)
expr.. Repeated[expr] LeftTriangle
expr... RepeatedNull[expr] LeftTriangle
 |  Alternatives[ ,  ] e | e | e LeftTriangle
symb:expr Pattern[symb, expr] LeftTriangle
patt:expr Optional[patt, expr] LeftTriangle

Operator input forms, in order of decreasing precedence, part five.

operator form full form grouping
 ~~  ~~  StringExpression[ ,  ,  ] e ~~ e ~~ e LeftTriangle
 /;  Condition[ ,  ] (e/;e)/;e LeftTriangle
 ->  Rule[ ,  ] e -> (e -> e) LeftTriangle
   Rule[ ,  ] e  (e  e) LeftTriangle
 :>  RuleDelayed[ ,  ] e :> (e :> e) LeftTriangle
   RuleDelayed[ ,  ] e  (e  e) LeftTriangle
 /.  ReplaceAll[ ,  ] (e /. e) /. e LeftTriangle
 //.  ReplaceRepeated[ ,  ] (e //. e) //. e LeftTriangle
 +=  AddTo[ ,  ] e += (e += e) LeftTriangle
 -=  SubtractFrom[ ,  ] e -= (e -= e) LeftTriangle
 *=  TimesBy[ ,  ] e *= (e *= e) LeftTriangle
 /=  DivideBy[ ,  ] e /= (e /= e) LeftTriangle
expr & Function[expr] LeftTriangle
   Colon[ ,  ] e  e  e
 //   [ ] (e // e) // e
   VerticalSeparator[ ,  ] e  e  e
   Therefore[ ,  ] e  (e  e)
   Because[ ,  ] (e  e)  e
 =  Set[ ,  ] e = (e = e) LeftTriangle
 :=  SetDelayed[ ,  ] e := (e := e) LeftTriangle
 ^=  UpSet[ ,  ] e ^= (e ^= e) LeftTriangle
 ^:=  UpSetDelayed[ ,  ] e ^:= (e ^:= e) LeftTriangle
symb/:  =  TagSet[symb,  ,  ] LeftTriangle
symb/:  :=  TagSetDelayed[symb,  ,  ] LeftTriangle
expr =. Unset[expr] LeftTriangle
symb/: expr =. TagUnset[symb, expr] LeftTriangle
expr >> filename Put[expr, "filename"] LeftTriangle
expr >>> filename PutAppend[expr, "filename"] LeftTriangle
 ; ; CompoundExpression[ ,  ,  ] LeftTriangle
 ; ; CompoundExpression[ ,  , Null] LeftTriangle
 \`  FormBox[ ,  ] e \` (e \` e) LeftTriangle

Operator input forms, in order of decreasing precedence, part six.

special input form full form
# Slot[1]
#n Slot[n]
## SlotSequence[1]
##n SlotSequence[n]
% Out[ ]
%% Out[-2]
%% ... % (n times) Out[-n]
%n Out[n]
_ Blank[ ]
_expr Blank[expr]
__ BlankSequence[ ]
__expr BlankSequence[expr]
___ BlankNullSequence[ ]
___expr BlankNullSequence[expr]
_. Optional[Blank[ ]]
symb_ Pattern[symb, Blank[ ]]
symb_expr Pattern[symb, Blank[expr]]
symb__ Pattern[symb, BlankSequence[ ]]
symb__expr Pattern[symb, BlankSequence[expr]]
symb___ Pattern[symb, BlankNullSequence[ ]]
symb___expr Pattern[symb, BlankNullSequence[expr]]
symb_. Optional[Pattern[symb, Blank[ ]]]

Additional input forms, in order of decreasing precedence.

Special Characters

Special characters that appear in operators usually have names that correspond to the names of the functions they represent. Thus the character  has name \[CirclePlus] and yields the function CirclePlus. Exceptions are \[GreaterSlantEqual], \[LessSlantEqual] and \[RoundImplies].

The delimiters in matchfix operators have names \[LeftName] and \[RightName].

Section A.12.1 gives a complete listing of special characters that appear in operators.

keyboard characters special character
-> \[Rule]
:> \[RuleDelayed]
Equal \[Equal]
NotEqual \[NotEqual]
keyboard characters special character
GreaterEqual \[GreaterEqual]
GreaterEqual \[GreaterSlantEqual]
LessEqual \[LessEqual]
LessEqual \[LessSlantEqual]

Keyboard and special characters with the same interpretations.

keyboard character special character
\[RawColon] : \[Colon]
\[RawTilde] ~ \[Tilde]
\[RawWedge] ^ \[Wedge]
\[RawWedge] ^ \[And]
\[RawStar] * \[Star]
\[RawBackslash] \ \[Backslash]
keyboard character special character
\[RawDot] . \[CenterDot]
\[RawVerticalBar] | \[VerticalBar]
\[RawVerticalBar] | \[VerticalSeparator]
\[RawVerticalBar] | \[LeftBracketingBar]
\[RawDash] - \[Dash]
... \[Ellipsis]

Some keyboard and special characters with different interpretations.

Precedence and the Ordering of Input Forms

The tables of input forms are arranged in decreasing order of precedence. Input forms in the same box have the same precedence. Each page in the table begins a new box. As discussed in Section 2.1.3, precedence determines how Mathematica groups terms in input expressions. The general rule is that if  has higher precedence than  , then  is interpreted as  , and  is interpreted as  .

Grouping of Input Forms

The third columns in the tables show how multiple occurrences of a single input form, or of several input forms with the same precedence, are grouped. For example, a/b/c is grouped as (a/b)/c ("left associative"), while a^b^c is grouped as a^(b^c) ("right associative"). No grouping is needed in an expression like a + b + c, since Plus is fully associative, as represented by the attribute Flat.

Precedence of Integration Operators

Forms such as     have an "outer" precedence just below Power, as indicated in the table above, but an "inner" precedence just above  . The outer precedence determines when  needs to be parenthesized; the inner precedence determines when  needs to be parenthesized.

\[ContourIntegral], \[ClockwiseContourIntegral] and \[DoubleContourIntegral] work the same as \[Integral].

See Section A.2.8 for two-dimensional input forms associated with integration operators.

Spaces and Multiplication

Spaces in Mathematica denote multiplication, just as they do in standard mathematical notation. In addition, Mathematica takes complete expressions that are adjacent, not necessarily separated by spaces, to be multiplied together.

x y z  x*y*z
2x  2*x
2(x+1)  2*(x+1)
c(x+1)  c*(x+1)
(x+1)(y+2)  (x+1)*(y+2)
x! y  x!*y
x!y  x!*y

Alternative forms for multiplication.

An expression like x!y could potentially mean either (x!)*y or x*(!y). The first interpretation is chosen because Factorial has higher precedence than Not.

Spaces within single input forms are ignored. Thus, for example, a + b is equivalent to a+b. You will often want to insert spaces around lower precedence operators to improve readability.

You can give a "coefficient" for a symbol by preceding it with any sequence of digits. When you use numbers in bases larger than 10, the digits can include letters. (In bases other than 10, there must be a space between the end of the coefficient, and the beginning of the symbol name.)

x^2y, like x^2 y, means (x^2) y
x/2y, like x/2 y, means (x/2) y
xy is a single symbol, not x*y

Some cases to be careful about.

Spaces to Avoid

You should avoid inserting any spaces between the different characters in composite operators such as /., =. and GreaterEqual. Although in some cases such spaces are allowed, they are liable to lead to confusion.

Another case where spaces must be avoided is between the characters of the pattern object x_. If you type x _, Mathematica will interpret this as x*_, rather than the single named pattern object x_.

Similarly, you should not insert any spaces inside pattern objects like x_:value.

Spacing Characters

• Ordinary keyboard space (\[RawSpace])
• \[VeryThinSpace], \[ThinSpace], ..., \[ThickSpace]
• \[NegativeVeryThinSpace], \[NegativeThinSpace], ..., \[NegativeThickSpace]
 (\[SpaceIndicator])

Spacing characters equivalent to an ordinary keyboard space.

Relational Operators

Relational operators can be mixed. An expression like a > b GreaterEqual c is converted to Inequality[a, Greater, b, GreaterEqual, c], which effectively evaluates as (a > b) && (b GreaterEqual c). (The reason for the intermediate Inequality form is that it prevents objects from being evaluated twice when input like a > b GreaterEqual c is processed.)

File Names

Any file name can be given in quotes after <<, >> and >>>. File names can also be given without quotes if they contain only alphanumeric characters, special characters and the characters `, /, ., \, !, -, _, :, $, *, ~ and ?, together with matched pairs of square brackets enclosing any characters other than spaces, tabs and newlines. Note that file names given without quotes can be followed only by spaces, tabs or newlines, or by the characters ), ],  as well as semicolon and comma.


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: