此为 Mathematica 7 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.2)

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 LeftTriangle in the tables below.
Operators that construct two-dimensional boxes—all of which have names beginning with backslash—can only be used inside \(...\). The table below gives the interpretations of these operators within \!\(...\). "Input of Boxes" gives interpretations when no \! is included.
expr and expriany expression
symbany symbol
pattany pattern object
string and stringi"cccc" or a sequence of letters, letter-like forms and digits
filenamelike string, but can include additional characters described below
LeftTrianglebuilt-in meanings exist

Objects used in the tables of operator input forms.

Operator Precedence

operator formfull formgrouping
forms representing numbers (see Numbers)LeftTriangle
forms representing symbols (see Symbol Names and Contexts)LeftTriangle
forms representing character strings (see Character Strings)LeftTriangle
e11e12...
e21e22...
...
{{e11,e12,...},{e21,e22,...},...}LeftTriangle
Piecewise
e11e12
e21e22
...
Piecewise[{{e11,e12},{e21,e22},...}]LeftTriangle
expr::stringMessageName[expr,"string"]LeftTriangle
expr::string1::string2MessageName[expr,"string1","string2"]LeftTriangle
forms containing # (see additional input forms)LeftTriangle
forms containing % (see additional input forms)LeftTriangle
forms containing _ (see additional input forms)LeftTriangle
<<filenameGet["filename"]LeftTriangle
Overscript[expr1,expr2]
expr1\&expr2Overscript[expr1,expr2]e\&(e\&e)
Underscript[expr1,expr2]
expr1\+expr2Underscript[expr1,expr2]e\+(e\+e)
Underoverscript[expr1,expr2,expr3]
expr1\+expr2\%expr3Underoverscript[expr1,expr2,expr3]
expr1\&expr2\%expr3Underoverscript[expr1,expr3,expr2]
expr1expr2Subscript[expr1,expr2]e(ee)
expr1\_expr2Subscript[expr1,expr2]e\_(e\_e)
expr1\_expr2\%expr3Power[Subscript[expr1,expr2],expr3]LeftTriangle
\!boxes(interpreted version of boxes)
expr1?expr2PatternTest[expr1,expr2] LeftTriangle
expr1[expr2,...]expr1[expr2,...](e[e])[e]LeftTriangle
expr1[[expr2,...]]Part[expr1,expr2,...](e[[e]])[[e]]LeftTriangle
expr1LeftDoubleBracketexpr2,...RightDoubleBracketPart[expr1,expr2,...](eLeftDoubleBracketeRightDoubleBracket)LeftDoubleBracketeRightDoubleBracketLeftTriangle
expr1LeftDoubleBracketexpr2RightDoubleBracketPart[expr1,expr2,...](eLeftDoubleBracketeRightDoubleBracket)LeftDoubleBracketeRightDoubleBracketLeftTriangle
\*expr(boxes constructed from expr)
expr++Increment[expr]LeftTriangle
expr--Decrement[expr]LeftTriangle
++exprPreIncrement[expr]LeftTriangle
--exprPreDecrement[expr]LeftTriangle
expr1@expr2expr1[expr2]e@(e@e)LeftTriangle
expr1 expr2(invisible application, input as expr1 Esc @ Esc expr2)LeftTriangle
expr1[expr2]
expr1~expr2~expr3expr2[expr1,expr3](e~e~e)~e~eLeftTriangle
expr1/@expr2Map[expr1,expr2]e/@(e/@e)LeftTriangle
expr1//@expr2MapAll[expr1,expr2]e//@(e//@e)LeftTriangle
expr1@@expr2Apply[expr1,expr2]e@@(e@@e)LeftTriangle
expr1@@@expr2Apply[expr1,expr2,{1}]e@@@(e@@@e)LeftTriangle
expr!Factorial[expr]LeftTriangle
expr!!Factorial2[expr]LeftTriangle
expr*Conjugate[expr]LeftTriangle
exprTranspose[expr]LeftTriangle
exprConjugateTranspose[expr]LeftTriangle
exprConjugateTranspose[expr]LeftTriangle
expr'Derivative[1][expr]LeftTriangle
expr''...' (n times)Derivative[n][expr]LeftTriangle
expr1<>expr2<>expr3StringJoin[expr1,expr2,expr3]e<>e<>eLeftTriangle
expr1^expr2Power[expr1,expr2]e^(e^e)LeftTriangle
expr1expr2Power[expr1,expr2]e(ee)LeftTriangle
Power[Subscript[expr1,expr2],expr3]LeftTriangle
expr1\^expr2\%expr3Power[Subscript[expr1,expr3],expr2]LeftTriangle
vertical arrow and vector operators
Sqrt[expr]LeftTriangle
\@ exprSqrt[expr]\@(\@ e)LeftTriangle
\@ expr\%nPower[expr,1/n]LeftTriangle
Integral expr1DifferentialD expr2Integrate[expr1,expr2]Integral (Integral eDifferentialD e)DifferentialD eLeftTriangle
e3DifferentialDe4Integrate[e3,{e4,e1,e2}]Integral (Integral eDifferentialD e)DifferentialD eLeftTriangle
other integration operators
PartialDexpr1expr2D[expr2,expr1]PartialDe(PartialDee)LeftTriangle
Del exprDel[expr]Del(Dele)
DiscreteShiftexpr1expr2DiscreteShift[expr2,expr1]DiscreteShifte(DiscreteShiftee)LeftTriangle
DiscreteRatioexpr1expr2DiscreteRatio[expr2,expr1]DiscreteRatioe(DiscreteRatioee)LeftTriangle
DifferenceDeltaexpr1expr2DifferenceDelta[expr2,expr1]DifferenceDeltae(DifferenceDeltaee)LeftTriangle
Square exprSquare[expr]Square(Square e)
expr1SmallCircle expr2SmallCircle expr3SmallCircle[expr1,expr2,expr3]eSmallCircle eSmallCircle e
expr1CircleDot expr2CircleDot expr3CircleDot[expr1,expr2,expr3]e CircleDot e CircleDot e
expr1**expr2**expr3NonCommutativeMultiply[expr1,expr2,expr3]e**e**e
expr1Crossexpr2Crossexpr3Cross[expr1,expr2,expr3]eCrosseCrosseLeftTriangle
expr1.expr2.expr3Dot[expr1,expr2,expr3]e.e.eLeftTriangle
-exprTimes[-1,expr]LeftTriangle
+exprexprLeftTriangle
±exprPlusMinus[expr]
MinusPlusexprMinusPlus[expr]
expr1/expr2expr1(expr2)^-1(e/e)/eLeftTriangle
expr1÷expr2Divide[expr1,expr2](e÷eeLeftTriangle
expr1\/expr2Divide[expr1,expr2](e\/e)\/eLeftTriangle
expr1\expr2\expr3Backslash[expr1,expr2,expr3]e\e\e
expr1Diamondexpr2Diamondexpr3Diamond[expr1,expr2,expr3]eDiamondeDiamonde
expr1Wedgeexpr2Wedgeexpr3Wedge[expr1,expr2,expr3]eWedgeeWedgee
expr1Veeexpr2Veeexpr3Vee[expr1,expr2,expr3]eVeeeVeee
expr1CircleTimesexpr2CircleTimesexpr3CircleTimes[expr1,expr2,expr3]eCircleTimeseCircleTimese
expr1CenterDotexpr2CenterDotexpr3CenterDot[expr1,expr2,expr3]eCenterDoteCenterDote
expr1 expr2 expr3Times[expr1,expr2,expr3]e e eLeftTriangle
expr1*expr2*expr3Times[expr1,expr2,expr3]e*e*eLeftTriangle
expr1×expr2×expr3Times[expr1,expr2,expr3]e×e×eLeftTriangle
expr1Starexpr2Starexpr3Star[expr1,expr2,expr3]eStareStare
e4Product[e4,{e1,e2,e3}]Product(Product e)LeftTriangle
expr1VerticalTildeexpr2VerticalTildeexpr3VerticalTilde[expr1,expr2,expr3]eVerticalTildeeVerticalTildee
expr1Coproductexpr2Coproductexpr3Coproduct[expr1,expr2,expr3]eCoproducteCoproducte
expr1Capexpr2Capexpr3Cap[expr1,expr2,expr3]eCapeCape
expr1Cupexpr2Cupexpr3Cup[expr1,expr2,expr3]eCupeCupe
expr1CirclePlus expr2CirclePlus expr3CirclePlus[expr1,expr2,expr3]eCirclePluseCirclePluse
expr1CircleMinus expr2CircleMinus[expr1,expr2](e CircleMinus e)CircleMinus e
e4Sum[e4,{e1,e2,e3}]Sum(Sum e)LeftTriangle
expr1+expr2+expr3Plus[expr1,expr2,expr3]e+e+eLeftTriangle
expr1-expr2expr1+(-1expr2)(e-e)-eLeftTriangle
expr1±expr2PlusMinus[expr1,expr2](e±ee
expr1MinusPlusexpr2MinusPlus[expr1,expr2](eMinusPluse)MinusPluse
expr1Intersectionexpr2Intersection[expr1,expr2]eIntersectioneIntersectioneLeftTriangle
other intersection operators
expr1Unionexpr2Union[expr1,expr2]eUnioneUnioneLeftTriangle
other union operators
i;;j;;kSpan[i,j,k]e;;e;;eLeftTriangle
expr1Equalexpr2Equal[expr1,expr2]eEqualeEqualeLeftTriangle
expr1Equalexpr2Equal[expr1,expr2]eEqualeEqualeLeftTriangle
expr1LongEqualexpr2Equal[expr1,expr2]eLongEqualeLongEqualeLeftTriangle
expr1NotEqual expr2Unequal[expr1,expr2]eNotEqualeNotEqualeLeftTriangle
expr1NotEqualexpr2Unequal[expr1,expr2]eNotEqualeNotEqualeLeftTriangle
other equality and similarity operators
expr1>expr2Greater[expr1,expr2]e>e>eLeftTriangle
expr1>=expr2GreaterEqual[expr1,expr2]e>=e>=eLeftTriangle
expr1expr2GreaterEqual[expr1,expr2]eeeLeftTriangle
expr1GreaterSlantEqualexpr2GreaterEqual[expr1,expr2]eGreaterSlantEqualeGreaterSlantEqualeLeftTriangle
expr1<expr2Less[expr1,expr2]e<e<eLeftTriangle
expr1<=expr2LessEqual[expr1,expr2]e<=e<=eLeftTriangle
expr1expr2LessEqual[expr1,expr2]eeeLeftTriangle
expr1LessSlantEqualexpr2LessEqual[expr1,expr2]eLessSlantEqualeLessSlantEqualeLeftTriangle
other ordering operators
expr1|expr2VerticalBar[expr1,expr2]e|e|e
expr1NotVerticalBarexpr2NotVerticalBar[expr1,expr2]eNotVerticalBareNotVerticalBare
expr1DoubleVerticalBarexpr2DoubleVerticalBar[expr1,expr2]eDoubleVerticalBareDoubleVerticalBare
expr1NotDoubleVerticalBarexpr2NotDoubleVerticalBar[expr1,expr2]eNotDoubleVerticalBareNotDoubleVerticalBare
horizontal arrow and vector operators
diagonal arrow operators
expr1SameQexpr2SameQ[expr1,expr2]eSameQeSameQeLeftTriangle
expr1UnsameQexpr2UnsameQ[expr1,expr2]eUnsameQeUnsameQeLeftTriangle
expr1Elementexpr2Element[expr1,expr2]eElementeElementeLeftTriangle
expr1NotElementexpr2NotElement[expr1,expr2]eNotElementeNotElementeLeftTriangle
expr1Subsetexpr2Subset[expr1,expr2]eSubseteSubsete
expr1Supersetexpr2Superset[expr1,expr2]eSuperseteSupersete
other set relation operators
ForAllexpr1expr2ForAll[expr1,expr2]ForAlle(ForAllee)LeftTriangle
Existsexpr1expr2Exists[expr1,expr2]Existse(Existsee)LeftTriangle
NotExistsexpr1expr2NotExists[expr1,expr2]NotExistse(NotExistsee)
!exprNot[expr]!(!e)LeftTriangle
¬exprNot[expr]¬(¬e)LeftTriangle
expr1&&expr2&&expr3And[expr1,expr2,expr3]e&&e&&eLeftTriangle
expr1Andexpr2Andexpr3And[expr1,expr2,expr3]eAndeAndeLeftTriangle
expr1Nandexpr2Nandexpr3Nand[expr1,expr2,expr3]eNandeNandeLeftTriangle
expr1Xorexpr2Xorexpr3Xor[expr1,expr2,expr3]eXoreXoreLeftTriangle
expr1Xnorexpr2Xnorexpr3Xnor[expr1,expr2,expr3]eXnoreXnoreLeftTriangle
expr1||expr2||expr3Or[expr1,expr2,expr3]e||e||eLeftTriangle
expr1Orexpr2Orexpr3Or[expr1,expr2,expr3]eOreOreLeftTriangle
expr1Norexpr2Norexpr3Nor[expr1,expr2,expr3]eNoreNoreLeftTriangle
expr1Equivalentexpr2Equivalentexpr3Equivalent[expr1,expr2,expr3]eEquivalenteEquivalenteLeftTriangle
expr1Impliesexpr2Implies[expr1,expr2]eImplies(eImpliese)LeftTriangle
expr1RoundImpliesexpr2Implies[expr1,expr2]eRoundImplieseRoundImplieseLeftTriangle
expr1RightTeeexpr2RightTee[expr1,expr2]eRightTee(eRightTeee)
expr1DoubleRightTeeexpr2DoubleRightTee[expr1,expr2]eDoubleRightTee(eDoubleRightTeee)
expr1LeftTeeexpr2LeftTee[expr1,expr2](eLeftTeee)LeftTeee
expr1DoubleLeftTeeexpr2DoubleLeftTee[expr1,expr2](eDoubleLeftTeee)DoubleLeftTeee
expr1SuchThatexpr2SuchThat[expr1,expr2]eSuchThat(eSuchThate)
expr..Repeated[expr]LeftTriangle
expr...RepeatedNull[expr]LeftTriangle
expr1|expr2Alternatives[expr1,expr2]e|e|eLeftTriangle
symb:exprPattern[symb,expr]LeftTriangle
patt:exprOptional[patt,expr]LeftTriangle
expr1~~expr2~~expr3StringExpression[expr1,expr2,expr3]e~~e~~eLeftTriangle
expr1/;expr2Condition[expr1,expr2](e/;e)/;eLeftTriangle
expr1->expr2Rule[expr1,expr2]e->(e->e)LeftTriangle
expr1expr2Rule[expr1,expr2]e→(ee)LeftTriangle
expr1:>expr2RuleDelayed[expr1,expr2]e:>(e:>e)LeftTriangle
expr1RuleDelayed expr2RuleDelayed[expr1,expr2]eRuleDelayed(eRuleDelayede)LeftTriangle
expr1/.expr2ReplaceAll[expr1,expr2](e/.e)/.eLeftTriangle
expr1//.expr2ReplaceRepeated[expr1,expr2](e//.e)//.eLeftTriangle
expr1+=expr2AddTo[expr1,expr2]e+=(e+=e)LeftTriangle
expr1-=expr2SubtractFrom[expr1,expr2]e-=(e-=e)LeftTriangle
expr1*=expr2TimesBy[expr1,expr2]e*=(e*=e)LeftTriangle
expr1/=expr2DivideBy[expr1,expr2]e/=(e/=e)LeftTriangle
expr&Function[expr]LeftTriangle
expr1:expr2Colon[expr1:expr2]e:e:e
expr1//expr2expr2[expr1](e//e)//e
expr1VerticalSeparatorexpr2VerticalSeparator[expr1,expr2]eVerticalSeparatoreVerticalSeparatore
expr1Thereforeexpr2Therefore[expr1,expr2]eTherefore(eThereforee)
expr1Becauseexpr2Because[expr1,expr2](eBecausee)Becausee
expr1=expr2Set[expr1,expr2]e=(e=e)LeftTriangle
expr1:=expr2SetDelayed[expr1,expr2]e:=(e:=e)LeftTriangle
expr1^=expr2UpSet[expr1,expr2]e^=(e^=e)LeftTriangle
expr1^:=expr2UpSetDelayed[expr1,expr2]e^:=(e^:=e)LeftTriangle
symb/:expr1=expr2TagSet[symb,expr1,expr2]LeftTriangle
symb/:expr1:=expr2TagSetDelayed[symb,expr1,expr2]LeftTriangle
expr=.Unset[expr]LeftTriangle
symb/:expr=.TagUnset[symb,expr]LeftTriangle
expr1Functionexpr2Function[{expr1},expr2]eFunction(eFunctione)LeftTriangle
expr>>filenamePut[expr,"filename"]LeftTriangle
expr>>>filenamePutAppend[expr,"filename"]LeftTriangle
expr1;expr2;expr3CompoundExpression[expr1,expr2,expr3]LeftTriangle
expr1;expr2;CompoundExpression[expr1,expr2,Null]LeftTriangle
expr1\`expr2FormBox[expr2,expr1]e\`(e\`e)LeftTriangle

Operator input forms, in order of decreasing precedence.

special input formfull form
#Slot[1]
#nSlot[n]
##SlotSequence[1]
##nSlotSequence[n]
%Out[ ]
%%Out[-2]
%%...% (n times)Out[-n]
%nOut[n]
_Blank[ ]
_exprBlank[expr]
__BlankSequence[ ]
__exprBlankSequence[expr]
___BlankNullSequence[ ]
___exprBlankNullSequence[expr]
_.Optional[Blank[ ]]
symb_Pattern[symb,Blank[ ]]
symb_exprPattern[symb,Blank[expr]]
symb__Pattern[symb,BlankSequence[ ]]
symb__exprPattern[symb,BlankSequence[expr]]
symb___Pattern[symb,BlankNullSequence[ ]]
symb___exprPattern[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 CirclePlus has name \[CirclePlus] and yields the function CirclePlus. Exceptions are \[GreaterSlantEqual], \[LessSlantEqual] and \[RoundImplies].
The delimiters in matchfix operators have names \[LeftName] and \[RightName].
"Listing of Named Characters" gives a complete listing of special characters that appear in operators.
keyboard charactersspecial character
->\[Rule]
:>\[RuleDelayed] RuleDelayed
Equal\[Equal] =
NotEqual\[NotEqual]
keyboard charactersspecial character
>=\[GreaterEqual]
>=\[GreaterSlantEqual] GreaterSlantEqual
<=\[LessEqual]
<=\[LessSlantEqual] LessSlantEqual

Keyboard and special characters with the same interpretations.

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 "Special Ways to Input Expressions", precedence determines how Mathematica groups terms in input expressions. The general rule is that if CircleTimes has higher precedence than CirclePlus, then aCirclePlusbCircleTimesc is interpreted as aCirclePlus (bCircleTimesc), and aCircleTimesbCirclePlusc is interpreted as (aCircleTimesb)CirclePlusc.

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 Integral expr1 DifferentialD expr2 have an "outer" precedence just below Power, as indicated in the table above, but an "inner" precedence just above Sum. The outer precedence determines when expr2 needs to be parenthesized; the inner precedence determines when expr1 needs to be parenthesized.
See "Two-Dimensional Input Forms" 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 LongRightArrow x*y*z
• 2x LongRightArrow 2*x
• 2(x+1) LongRightArrow 2*(x+1)
• c(x+1) LongRightArrow c*(x+1)
• (x+1)(y+2) LongRightArrow (x+1)*(y+2)
• x! y LongRightArrow x!*y
• x!y LongRightArrow 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 >=. 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

Spacing characters equivalent to an ordinary keyboard space.

Relational Operators

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