Fundamental simplification

Operators combine values to produce new values when their operands meet type and value criteria specified by the operator. The operation is performed numerically when operands are tangible and symbolically if otherwise possible.

Operator SymbolsOperator
+ - ⋅ ÷ // | ^arithmetic
∧ ∨ ⊕Boolean
∩ ∪ ∖set algebraic
⊆ ⊤ ⊄ ⊈set relational
= ≠ < ≤ > ≥relational
Left Type Operator Right Type Transformation
scalararithmeticscalarperform addition, subtraction, multiplication, division, quotient, modulus, exponentiation
collectionarithmeticscalardistribute operation and scalar across elements of collection
scalararithmeticcollectiondistribute operation and scalar across elements of tuple
vectorarithmeticscalarapply operation and scalar to each component of vector
realarithmeticvectorapply operation and scalar to each component of vector
vectorvectordot-product
compositecompositepromote operands to vectors; find angle between vectors
realrealcreate radial from left (magnitude) and right (angle))
realɓrealevaluate binomial-choose operation aɓb=a !÷(b !⋅(a-b) !)if operands are integer
realBooleanrealevaluate boolean and, or, exclusive or
setset relativesetevaluate set relation
set or tupleset relativeset or tuplepromote set to tuple and evaluate multiset relation
setset algebraicsetevaluate set operator
set or tupleset set algebraicset or tuplepromote set to tuple and evaluate multiset operation
any typerelationalany typepromote operand with lower type to type of operand with higher type and perform sequence comparison
setrelationalsetperform equality or inequality comparison
realrelationalrealperform numeric comparison
realradicalrealroot(a, b) evaluates root(a, b) if operands are integer and result is integer
variabletuplecreate function reference from variable and tuple
any typeany typeif either side is string, coerce operands to string and concatenate
if either side is matrix, coerce operands to matrix and concatenate
coerce operands to tuple and concatenate
any typeany typecoerce operands to matrix and concatenate vertically
matrix×matrixperform matrix multiplication
matrix×column vectorcoerce right operand to matrix, perform matrix multiplication and coerce result to column vector
row vector×matrixcoerce left operand to matrix, perform matrix multiplication and coerce result to row vector
row vector×row vectorperform 3-dimensional vector cross product and return a row vector
col vector×col vectorperform 3-dimensional vector cross product and return a column vector
col vector×row vectorperform 3-dimensional vector cross product and return a column matrix
row vector×col vectorperform matrix produce and return a the singleton-matrix result as a scalar
stringrealremove leading characters
matrixrealremove leading rows
matrixtupleif tuple has one real element, remove leading columns
matrixtupleif tuple has two real elements, remove leading rows and columns
matrixtupleif tuple has one set-of-real element, remove rows indexed by elements of set
matrixtupleif tuple has two set-of-real elements, remove rows and columns indexed by elements of set
tuplerealremove leading elements
vectorrealremove leading components
stringrealkeep leading characters
matrixrealkeep leading rows
matrixtupleif tuple has one real element, keep leading columns
matrixtupleif tuple has two real elements, keep leading rows and columns
tuplerealkeep leading elements
vectorrealkeep leading components
any typesettest for set containment
any typesettest for set exclusion
matrixmatrixKroenecker delta: every element of left matrix multiplied by a copy of the right matrix
Figure 10.1 Fundamental simplification of binary operations