# Language Reference

## Formulative Formula Language Reference

### Notation

#### Characters

Language Characters
Source Description / Comment
space, tab, carriage return, form feed Whitespace characters
0-9 Arabic numerals, used in number Literals, Date Literals, and Identifiers
a-z, A-Z Latin alphabet, used in Identifiers (and exceptionally, operators)
any character[1] allowed in string literals only
\ Escape character
!, $, %, ', @ Style selector before Identifiers and Literals (bold, roman, double-struck, sans-serif, sans-serif italic) -- any characters up to end of line Line comment[2] /* any text spanning multiple lines */ Block comment " String delimiter #, *, +, ,, -, /, :, ;, <, =, >, ^, _, |, ~ Operator characters[3] Notes  [1] Except the following characters, which cannot occur literally (must be escaped): (U+0022 ” QUOTATION MARK), (U+005C REVERSE SOLIDUS), (U+0085 NEXT LINE), (U+00A0 NO-BREAK SPACE), (U+2028 LINE SEPARATOR), (U+2029 PARAGRAPH SEPARATOR)  [2] The two HYPHEN-MINUS characters must be followed by a space or a tab before the actual comment  [3] Some operators are composed of multiple characters, e.g. ##, **, /\, -->, etc. Source Escapes Source Description / Comment \alpha, \beta, \gamma, …[5] Greek lowercase letters α, β, γ, etc. \Alpha, \Beta, \Gamma, … Greek uppercase letters Α, Β, Γ, etc.[4] \epsilon, \varepsilon Alternative forms of the letter epsilon: ε, ϵ[6] \theta, \vartheta Alternative forms of the letter theta: θ, ϑ \kappa, \varkappa Alternative forms of the letter kappa: κ, ϰ \rho, \varrho Alternative forms of the letter rho: ρ, ϱ \phi, \varphi Alternative forms of the letter phi: φ, ϕ \\ Set minus operator \/~ Root operator Notes  [4] Some Greek capital letters are visually indistinguishable from Latin letters (as in the example, Greek capital Alpha looks the same as Latin capital A). These are supported but not recommended (because of the visual ambiguity created by using them)  [5] The escapes listed in this table can be used anywhere in the source except string literals  [6] These variant forms are treated as entirely different characters, so e.g. $\mathit{\epsilon }$ and $\mathit{ϵ}$ are two different Variables. #### Identifiers Identifiers are grouped by font style, which have semantic meaning in mathematical text. The default style is serif, italic, light. Other styles are noted. “normal” style is used for non-letter characters, which cannot be styled. Variable Identifiers Source Display Description / Comment a, b, C, D $\mathit{a},\mathit{b},\mathit{C},\mathit{D}$ Single letter, italic lower or uppercase myVariable $\mathit{myVariable}$ Multiple letters also possible, but not recommended !u, !v, !W $\mathbit{u},\mathbit{v},\mathbit{W}$ Bold italic as an alternative[7] x___ x^* $\underset{_}{\mathit{x}},{\mathit{x}}^{\ast }$ Underline and Asterisk (“star”) embellishments[8] x', x'' ${\mathit{x}}^{\prime },{\mathit{x}}^{″}$ Primes[8], up to 4 primes supported x^^->, x^^^, x^^~ $\stackrel{\to }{\mathit{x}},\stackrel{^}{\mathit{x}},\stackrel{~}{\mathit{x}}$ Arrow, circumflex (“hat”), and tilde embellishments[8] x_'min, x_'max ${\mathit{x}}_{\mathsf{min}},{\mathit{x}}_{\mathsf{max}}$ Subscript keyword embellishment[8] x^'last, x^'next ${\mathit{x}}^{\mathsf{last}},{\mathit{x}}^{\mathsf{next}}$ Superscript keyword embellishment[8] !x___^^^_'sub^'sup ${\underset{_}{\overset{^}{\mathbit{x}}}}_{\mathsf{sub}}^{\mathsf{sup}}$ Formatting and embellishments can be combined x_1, x_2, x_n ${\mathit{x}}_{\mathrm{1}},{\mathit{x}}_{\mathrm{2}},{\mathit{x}}_{\mathit{n}}$ Numeric index is not an embellishment, but an index[9] Notes  [7] bold variables are distinct from the light version, so $\mathit{x}$ and $\mathbit{x}$ are two distinct Variables  [8] (1, 2, 3, 4, 5) embellishments are “decorations” and create a distinct new Variable, so $\mathit{x}$ and ${\mathit{x}}^{\ast }$ are two distinct Variables  [9] indexed access targets a Slot of a “group” Variable, informally denoted by ${\mathit{x}}_{\mathrm{⬚}}$. Each such Slot acts as a container on its own. Built-in Mathematical Identifiers Source Display Description / Comment %Z, %N, %R, %C $\mathbb{Z},\mathbb{N},\mathbb{R},\mathbb{C}$ Double-struck (blackboard bold): Primitive Domains ~|~ $\mathrm{\top }$ Logical true _|_ $\mathrm{\perp }$ Logical false 00 $\mathrm{\infty }$ Infinity /0 $\mathrm{\varnothing }$ Empty set Standard Library Identifiers Source Display Description / Comment $e, $i,$\pi
$\mathrm{e},\mathrm{i},\mathrm{\pi }$
(Roman) constants: Euler’s number, imaginary unit, π
$I_n ${\mathrm{I}}_{\mathit{n}}$ indexed constant: $\mathit{n}$ × $\mathit{n}$ identity matrix $!0_n, $!0_{n,m} ${\mathbf{0}}_{\mathit{n}},{\mathbf{0}}_{\mathit{n},\mathit{m}}$ (Roman, bold) indexed constant: zero vector in $\mathit{n}$ dimensions, zero $\mathit{n}$ by $\mathit{m}$ Matrix $kg, $mm,$s
$\mathrm{kg},\mathrm{mm},\mathrm{s}$
(Roman) Unit identifiers
$!L,$!M, $!T $\mathbf{L},\mathbf{M},\mathbf{T}$ (Roman, bold) Dimension identifiers $!year, $!h,$!d
$\mathbf{year},\mathbf{h},\mathbf{d}$
(Roman, bold) Base Calendar duration identifiers
$abs,$sgn, $sin $\mathrm{abs},\mathrm{sgn},\mathrm{sin}$ (Roman, bold) Library Functions $log_n, $round_k ${\mathrm{log}}_{\mathit{n}},{\mathrm{round}}_{\mathit{k}}$ (Roman, bold) “Parametrized” Functions[10] Notes  [10] the “parameter” is part of the definition of the function. When invoking the function, the argument of the function must be supplied separately, e.g. $\mathit{y}={\mathrm{log}}_{\mathit{a}}\left(\mathit{x}\right)$ Other Identifiers Source Display Description / Comment 'key1, 'myKey $\mathsf{key1},\mathsf{myKey}$ Sans-serif: Keyword identifier @A, @B, @C $\mathsfit{A},\mathsfit{B},\mathsfit{C}$ Sans-serif italic: Resource identifier ### Primitives #### Numbers Number Literals Source Display Description / Comment 123 $\mathrm{123}$ Integer literal 123.456 $\mathrm{123.456}$ Decimal literal 1.23 * 10^45 $\mathrm{1.23}\cdot {\mathrm{10}}^{\mathrm{45}}$ Scientific notation 00 $\mathrm{\infty }$ Positive infinity on the extended real number line 1/2 $\frac{\mathrm{1}}{\mathrm{2}}$ Fraction 1.23 + 4.56$i
$\mathrm{1.23}+\mathrm{4.56}\mathrm{i}$
Complex
-123
$-\mathrm{123}$
Negative sign, may require parentheses in expressions, e.g. ${\left(-\mathrm{1}\right)}^{\mathit{k}}$
-1.23 * 10^{-45}
$-\mathrm{1.23}\cdot {\mathrm{10}}^{-\mathrm{45}}$
Negative exponent, requires { } grouping fences around value
-00
$-\mathrm{\infty }$
Negative infinity on the extended real number line
-1 / 2
$-\frac{\mathrm{1}}{\mathrm{2}}$
Negative fraction
-1.23 - 4.56 $i $-\mathrm{1.23}-\mathrm{4.56}\mathrm{i}$ Negative real / imaginary part in a complex number Number Arithmetic Source Display Description / Comment a + b $\mathit{a}+\mathit{b}$ Addition a - b $\mathit{a}-\mathit{b}$ Subtraction a b $\mathit{a}\mathit{b}$ Multiplication a * b $\mathit{a}\cdot \mathit{b}$ Multiplication, (alternative form, with operator visible) a / b $\frac{\mathit{a}}{\mathit{b}}$ Division, normally denoted by a fraction bar; either numerator or denominator may require { } grouping fences around expression a // b $\mathit{a}∕\mathit{b}$ Inline division, an alternative form {+}__{i=1}^^n a_i $\sum _{\mathit{i}=\mathrm{1}}^{\mathit{n}}{\mathit{a}}_{\mathit{i}}$ Sum with lower & upper bound; binds local variable $\mathit{i}$ {+}__{x (- S} x $\sum _{\mathit{x}\in \mathit{S}}\mathit{x}$ Sum with a collection (set $\mathit{S}$) binding a local variable $\mathit{x}$ {+} {{a_1, ..., a_n}} $\sum \left\{{\mathit{a}}_{\mathrm{1}},\mathrm{\dots },{\mathit{a}}_{\mathit{n}}\right\}$ Sum with no limits, sums elements of a set {*}__{i=1}^^n a_i $\prod _{\mathit{i}=\mathrm{1}}^{\mathit{n}}{\mathit{a}}_{\mathit{i}}$ Product with lower & upper bound, binds local variable $\mathit{i}$ {*}__{x (- S} x $\prod _{\mathit{x}\in \mathit{S}}\mathit{x}$ Product with a collection (set $\mathit{S}$) binding a local variable $\mathit{x}$ {*} {{a_1, ..., a_n}} $\prod \left\{{\mathit{a}}_{\mathrm{1}},\mathrm{\dots },{\mathit{a}}_{\mathit{n}}\right\}$ Product with no limits, multiplies elements of a set a ^ p, b ^ {n+1} ${\mathit{a}}^{\mathit{p}},{\mathit{b}}^{\mathit{n}+\mathrm{1}}$ Exponentiation, exponent may require { } grouping fences around an expression \/~ a, \/~ {x + y} $\sqrt{\mathit{a}},\sqrt{\mathit{x}+\mathit{y}}$ Square root. Radicand may require { } grouping fences around an expression n \/~ a, n\/~ {x + y} $\sqrt[\mathit{n}]{\mathit{a}},\sqrt[\mathit{n}]{\mathit{x}+\mathit{y}}$ _n_th root. Index & Radicand may require { } grouping fences around an expression $sgn a
$\mathrm{sgn}\mathit{a}$
Signum (sign) of a real number, $\mathrm{sgn}\mathit{a}=\left\{\begin{array}{ll}\mathrm{1}& \mathit{a}>\mathrm{0}\\ \mathrm{0}& \mathit{a}=\mathrm{0}\\ -\mathrm{1}& \mathit{a}<\mathrm{0}\end{array}\right\$
$inf S $\mathrm{inf}\mathit{S}$ Infimum of a set of real numbers $\mathit{S}$: greatest lower bound (or $-\mathrm{\infty }$) of the set $sup S
$\mathrm{sup}\mathit{S}$
Supremum of a set of real numbers $\mathit{S}$: smallest upper bound (or $+\mathrm{\infty }$) of the set
$min S $\mathrm{min}\mathit{S}$ Minimum of a set of real numbers $\mathit{S}$ $min (a_1, ..., a_n)
$\mathrm{min}\left({\mathit{a}}_{\mathrm{1}},\mathrm{\dots },{\mathit{a}}_{\mathit{n}}\right)$
Minimum of real numbers
$max S $\mathrm{max}\mathit{S}$ Maximum of a set of real numbers $\mathit{S}$ $max (a_1, ..., a_n)
$\mathrm{max}\left({\mathit{a}}_{\mathrm{1}},\mathrm{\dots },{\mathit{a}}_{\mathit{n}}\right)$
Maximum of real numbers
$sum S $\mathrm{sum}\mathit{S}$ Sum of a set of real numbers $\mathit{S}$ $sum (a_1, ..., a_n)
$\mathrm{sum}\left({\mathit{a}}_{\mathrm{1}},\mathrm{\dots },{\mathit{a}}_{\mathit{n}}\right)$
Sum of real numbers
$prod S $\mathrm{prod}\mathit{S}$ Product of a set of real numbers $\mathit{S}$ $prod (a_1, ..., a_n)
$\mathrm{prod}\left({\mathit{a}}_{\mathrm{1}},\mathrm{\dots },{\mathit{a}}_{\mathit{n}}\right)$
Product of real numbers
{| a |}, $abs a $\left|\mathit{a}\right|,\mathrm{abs}\mathit{a}$ Absolute value of a number: $\left|\mathit{a}\right|=\mathrm{abs}\mathit{a}=\left\{\begin{array}{ll}\mathit{a}& \mathit{a}\geqq \mathrm{0}\\ -\mathit{a}& \mathit{a}<\mathrm{0}\end{array}\right\$ |_ a _| $⌊\mathit{a}⌋$ Floor of a real number: the greatest integer smaller than or equal to $\mathit{a}$ |~ a ~| $⌈\mathit{a}⌉$ Ceiling of a real number: the smallest integer greater than or equal to $\mathit{a}$ $int a
$\mathrm{int}\mathit{a}$
Integer part of a real number: the closest integer to $\mathit{a}$ towards zero.
$frac a $\mathrm{frac}\mathit{a}$ Fractional part of a real number: $\mathrm{frac}\mathit{a}=\mathit{a}-\mathrm{int}\mathit{a}$ $round a
$\mathrm{round}\mathit{a}$
Rounding of a real number: the closest integer to $\mathit{a}$
$round_k a ${\mathrm{round}}_{\mathit{k}}\mathit{a}$ Rounding of a real number to $\mathit{k}$ number of decimal digits ($\mathrm{0}\leqq \mathit{k}\leqq \mathrm{15}$) Numeric Relational Operators Source Display Description / Comment a = b /= c $\mathit{a}=\mathit{b}\ne \mathit{c}$ Equals / Does not equal[11] a <> b >< c $\mathit{a}\lessgtr \mathit{b}\gtrless \mathit{c}$ Less than or greater than / Greater than or less than. Note that this is different (more strict) than non-equality. a < b <= c <_ d $\mathit{a}<\mathit{b}\leqq \mathit{c}\le \mathit{d}$ Less than / Less than or equal to (two different forms with identical meaning) a > b >= c >_ d $\mathit{a}>\mathit{b}\geqq \mathit{c}\ge \mathit{d}$ Greater than / Greater than or equal to (two different forms with identical meaning) a </= b </_ c $\mathit{a}\lneqq \mathit{b}⪇\mathit{c}$ Less than and not equal to (two different forms with identical meaning) a >/= b >/_ c $\mathit{a}\gneqq \mathit{b}⪈\mathit{c}$ Greater than and not equal to (two different forms with identical meaning) a /< b /<_ c $\mathit{a}\nless \mathit{b}\nleqq \mathit{c}$ Not less than / Neither less than nor equal to a /> b />_ c $\mathit{a}\ngtr \mathit{b}\ngeqq \mathit{c}$ Not greater than / Neither greater than nor equal to a ~~ b /~~ c $\mathit{a}\approx \mathit{b}\not\approx \mathit{c}$ Approximately equal to / Not approximately equal to[12] a ~/= b /~= c $\mathit{a}≆\mathit{b}\ncong \mathit{c}$ Approximately but not actually equal to / Neither approximately, nor actually equal to. a <~~ b </~~ c $\mathit{a}⪅\mathit{b}⪉\mathit{c}$ Less than or approximately equal to / Less than but not approximately equal to a >~~ b >/~~ c $\mathit{a}⪆\mathit{b}⪊\mathit{c}$ Greater than or approximately equal to / Greater than but not approximately equal to a || b /|| c $\mathit{a}\mid \mathit{b}\nmid \mathit{c}$ Divides / Does not divide Notes  [11] All relational operators may be “chained” (example: $\mathit{a}=\mathit{b}=\mathit{c}$). Such notation is shorthand for $\mathit{a}=\mathit{b}\wedge \mathit{b}=\mathit{c}$. The table uses such chains to demonstrate more than one relational operator in one row.  [12] Maximum tolerance of approximate equality is a run-time option, defaulted to ${\mathrm{10}}^{-\mathrm{14}}$. #### Keywords Keyword Literals Source Display Description / Comment 'key $\mathsf{key}$ Keyword literal #### Strings String Literals Source Display Description / Comment "a string" Simple literal "" $""$ Empty string "\0" $"\0"$ Escape: null (U+0000 <control> NULL) "\b" $"\b"$ Escape: backspace (U+0008 <control> BACKSPACE) "\t" $"\t"$ Escape: tabulator (U+0009 <control> CHARACTER TABULATION) "\n" $"\n"$ Escape: newline (U+000A <control> LINE FEED) "\v" $"\v"$ Escape: vertical tab (U+000B <control> LINE TABULATION) "\f" $"\f"$ Escape: form feed (U+000C <control> FORM FEED) "\r" $"\r"$ Escape: return (U+000D <control> CARRIAGE RETURN) "\"" $"\""$ Escape: quote (U+0022 ” QUOTATION MARK) "\\" $"\\"$ Escape: backslash (U+005C \ REVERSE SOLIDUS) "\u{0}" $"\u\left\{0\right\}"$ Escape: unicode (Any hexadecimal character allowed) "\u{00}" $"\u\left\{00\right\}"$ Escape: unicode (Any hexadecimal characters allowed) "\u{000}" $"\u\left\{000\right\}"$ Escape: unicode (Any hexadecimal characters allowed) "\u{0000}" $"\u\left\{0000\right\}"$ Escape: unicode (Any hexadecimal characters allowed) "\u{00000}" $"\u\left\{00000\right\}"$ Escape: unicode (Any hexadecimal characters allowed) String Operations Source Display Description / Comment $len s
$\mathrm{len}\mathit{s}$
Length of a string
(s)_k
${\left(\mathit{s}\right)}_{\mathit{k}}$
Part of a string: get character @ position $\mathit{k}$
(s)_{k_1, k_2, k_3}
${\left(\mathit{s}\right)}_{{\mathit{k}}_{\mathrm{1}},{\mathit{k}}_{\mathrm{2}},{\mathit{k}}_{\mathrm{3}}}$
Part of a string: get multiple characters @ positions ${\mathit{k}}_{\mathrm{1}},{\mathit{k}}_{\mathrm{2}},{\mathit{k}}_{\mathrm{3}}$ and concatenate
(s)_{k_1,...,k_2}
${\left(\mathit{s}\right)}_{\mathit{k},\mathrm{\dots },\mathit{m}}$
Part of a string: get substring from position $\mathit{k}$ to $\mathit{m}$ (inclusive)
s_1 *** s_2 *** s_3
${\mathit{s}}_{\mathrm{1}}\ast {\mathit{s}}_{\mathrm{2}}\ast {\mathit{s}}_{\mathrm{3}}$
Concatenation of strings

#### Logical Values

Logical Literals
Source Display Description / Comment
~|~
$\mathrm{\top }$
Logical true
_|_
$\mathrm{\perp }$
Logical false
Logical Operations
Source Display Description / Comment
/\
$\wedge$
Conjunction (logical AND)
\/
$\vee$
Disjunction (logical OR)
->
$\to$
Implication (logical IMPLIES)
~
$¬$
Negation (logical NOT)

#### Date / Time & Durations

Date / Time & Duration Literals
Source Display Description / Comment
'2018-05-20
$\mathsf{2018-05-20}$
Date literal (ISO YYYY-MM-DD)
'2018-05-20T01:02:03
$\mathsf{2018-05-20 01:02:03}$
Date-Time literal (ISO YYYY-MM-DD HH:MM:SS)
'2018-05-20T01:02:03.456
$\mathsf{2018-05-20 01:02:03.456}$
Date-Time literal (ISO YYYY-MM-DD HH:MM:SS.ms)
2 $!year + 3$!month
$\mathrm{2}\mathbf{year}+\mathrm{3}\mathbf{month}$
Calendar Duration literals
Date / Time Arithmetic and Manipulation
Source Display Description / Comment
$today $\mathrm{today}$ Current date (@ start of calculation) $now
$\mathrm{now}$
Current time (@ start of calculation)
$date (Y, M, D) $\mathrm{date}\left(\mathit{Y},\mathit{M},\mathit{D}\right)$ Construct Date value from integers ($\mathit{Y}$: year, $\mathit{M}$: month, $\mathit{D}$: day $date (!t)
$\mathrm{date}\left(\mathbit{t}\right)$
Extract Date value from a Date-Time value $\mathbit{t}$
$time (Y, M, D, h, m, s) $\mathrm{time}\left(\mathit{Y},\mathit{M},\mathit{D},\mathit{h},\mathit{m},\mathit{s}\right)$ Construct Date-Time value from integers ($\mathit{Y}$: year, $\mathit{M}$: month, $\mathit{D}$: day, $\mathit{h}$: hour, $\mathit{m}$: minute, $\mathit{s}$: second) $time (Y, M, D, h, m, s, ms)
$\mathrm{time}\left(\mathit{Y},\mathit{M},\mathit{D},\mathit{h},\mathit{m},\mathit{s},\mathit{ms}\right)$
Construct Date-Time value from integers (sam as above plus $\mathit{ms}$: milliseconds)
$time (!d) $\mathrm{time}\left(\mathbit{d}\right)$ Construct Date-Time value from a Date value $\mathbit{d}$ (expand with 00:00:00 time) !d + t, !t + t $\mathbit{d}+\mathit{t},\mathbit{t}+\mathit{t}$ Addition of a time quantity $\mathit{t}$ to a Date $\mathbit{d}$ or Date-Time $\mathbit{t}$ !d + d $\mathbit{d}+\mathit{d}$ Addition of a Calendar Duration $\mathit{d}$ to a Date $\mathbit{d}$ !d - t, !t + t $\mathbit{d}-\mathit{t},\mathbit{t}-\mathit{t}$ Subtraction of a time quantity $\mathit{t}$ from a Date $\mathbit{d}$ or Date-Time $\mathbit{t}$ !d - d $\mathbit{d}-\mathit{d}$ Subtraction of a duration $\mathit{d}$ from a Date $\mathbit{d}$ !d_2 - !d_1 ${\mathbit{d}}_{\mathrm{2}}-{\mathbit{d}}_{\mathrm{1}}$ Subtraction of two Dates (yields time quantity in days) !t_2 - !t_1 ${\mathbit{t}}_{\mathrm{2}}-{\mathbit{t}}_{\mathrm{1}}$ Subtraction of two Dates (yields time quantity in seconds) $dur (d_2, d_1)
$\mathrm{dur}\left({\mathit{d}}_{\mathrm{2}},{\mathit{d}}_{\mathrm{1}}\right)$
Compute Calendar Duration between two Dates
$dur (t_2, t_1) $\mathrm{dur}\left({\mathit{t}}_{\mathrm{2}},{\mathit{t}}_{\mathrm{1}}\right)$ Compute Calendar Duration between two Date-Times (!d)_'year, (!d)_'month, (!d)_'d ${\left(\mathbit{d}\right)}_{\mathsf{year}},{\left(\mathbit{d}\right)}_{\mathsf{month}},{\left(\mathbit{d}\right)}_{\mathsf{d}}$ Extract year / month / day component from a Date or Date-Time object $\mathbit{d}$ (!t)_'h, (!t)_'minute, (!t)_'s, (!t)_'ms ${\left(\mathbit{t}\right)}_{\mathsf{h}},{\left(\mathbit{t}\right)}_{\mathsf{minute}},{\left(\mathbit{t}\right)}_{\mathsf{s}},{\left(\mathbit{t}\right)}_{\mathsf{ms}}$ Extract hour / minute / second / millisecond component from a Date-Time object $\mathbit{t}$ (d)_'year, (d)_'minute, (d)_'s ${\left(\mathit{d}\right)}_{\mathsf{year}},{\left(\mathit{d}\right)}_{\mathsf{minute}},{\left(\mathit{d}\right)}_{\mathsf{s}}$ Extract year / month / day / hour / minute / second / millisecond component from a CalendarDuration object $\mathit{d}$ #### Units, Quantities & Dimensions Unit, Quantity & Dimension Literals Source Display Description / Comment $m, $kg,$s
$\mathrm{m},\mathrm{kg},\mathrm{s}$
SI base Unit literal (meter, kilogram, second)
$A,$K, $mol,$cd
$\mathrm{A},\mathrm{K},\mathrm{mol},\mathrm{cd}$
SI base Unit literal (ampere, kelvin, mole, candela)
$year,$month, $week $\mathrm{year},\mathrm{month},\mathrm{week}$ non-SI but common time Unit literals (year, month, week) $h, $d,$minute
$\mathrm{h},\mathrm{d},\mathrm{minute}$
non-SI but common time Unit literals (hour, day, minute)
$b,$B
$\mathrm{b},\mathrm{B}$
non-SI but common amount of information Unit literals (bit, byte)
$cm,$\mug, $ms,$kA
$\mathrm{cm},\mathrm{\mu g},\mathrm{ms},\mathrm{kA}$
SI decimal prefixed Unit literals (centimeter, microgram, millisecond, kiloampere)
$kb,$MB, $Kib,$MiB
$\mathrm{kb},\mathrm{MB},\mathrm{Kib},\mathrm{MiB}$
SI decimal / IEC binary prefixed Unit literals (kilobit, megabyte, kibibit, mebibyte)
$m^2$kg $s^{-3} ${\mathrm{m}}^{\mathrm{2}}\mathrm{kg}{\mathrm{s}}^{-\mathrm{3}}$ SI derived Unit literal (unit of power, a.k.a watt) $m $kg$s^{-2}
$\mathrm{m}\mathrm{kg}{\mathrm{s}}^{-\mathrm{2}}$
SI derived Unit literal (unit of force, a.k.a newton)
$Hz,$N, $Pa,$J
$\mathrm{Hz},\mathrm{N},\mathrm{Pa},\mathrm{J}$
SI derived Unit literals with special names (hertz, newton, pascal, joule)
$N$m, $W$m^{-2}
$\mathrm{N}\mathrm{m},\mathrm{W}{\mathrm{m}}^{-\mathrm{2}}$
SI derived Unit literals combining base units and units with special names
$!L,$!M, $!T,$!I
$\mathbf{L},\mathbf{M},\mathbf{T},\mathbf{I}$
SI Dimension symbol literals (length, mass, time/duration, electric current)
$!\Theta,$!N, $!J $\mathbf{\Theta },\mathbf{N},\mathbf{J}$ SI Dimension symbol literals (temperature, amount of substance, luminous intensity) $!a, $!i $\mathbf{a},\mathbf{i}$ non-SI (extension) Dimension symbol literals (angle, amount of information) $!L^2 $!M$!T^{-3}
${\mathbf{L}}^{\mathrm{2}}\mathbf{M}{\mathbf{T}}^{-\mathrm{3}}$
derived SI Dimension symbol literal (dimension of power quantities)
$!force,$!energy
$\mathbf{force},\mathbf{energy}$
derived shorthand Dimension symbol literals with special names
$!1 $\mathbf{1}$ Dimension literal for dimensionless quantities 1$cm, 0.53 $W$h
$\mathrm{1}\mathrm{cm},\mathrm{0.53}\mathrm{W}\mathrm{h}$
Quantity literals
Unit, Quantity & Dimension Operations
Source Display Description / Comment
u_1 u_2, u_1 * u_2
${\mathit{u}}_{\mathrm{1}}{\mathit{u}}_{\mathrm{2}},{\mathit{u}}_{\mathrm{1}}\cdot {\mathit{u}}_{\mathrm{2}}$
Multiplication of units (e.g. $\mathrm{N}\mathrm{m}$)
u_1 / u_2, u_1 // u_2
$\frac{{\mathit{u}}_{\mathrm{1}}}{{\mathit{u}}_{\mathrm{2}}},{\mathit{u}}_{\mathrm{1}}∕{\mathit{u}}_{\mathrm{2}}$
Division of units (e.g. $\mathrm{m}∕\mathrm{s}$)
u^x
${\mathit{u}}^{\mathit{x}}$
Exponentiation of unit $\mathit{u}$, exponent $\mathit{x}$, where $\mathit{x}\in \mathbb{R}$ (e.g. ${\mathit{m}}^{\mathrm{2}},{\mathit{s}}^{-\mathrm{1}}$)
D_1 D_2, D_1 * D_2
${\mathit{D}}_{\mathrm{1}}{\mathit{D}}_{\mathrm{2}},{\mathit{D}}_{\mathrm{1}}\cdot {\mathit{D}}_{\mathrm{2}}$
Multiplication of dimensions (e.g. $\mathbf{force}\mathbf{M}$ i.e. “torque”)
D_1 / D_2, D_1 // D_2
$\frac{{\mathit{D}}_{\mathrm{1}}}{{\mathit{D}}_{\mathrm{2}}},{\mathit{D}}_{\mathrm{1}}∕{\mathit{D}}_{\mathrm{2}}$
Division of dimensions (e.g. $\mathbf{L}∕\mathbf{T}$, i.e. “velocity”)
D ^ x
${\mathit{D}}^{\mathit{x}}$
Exponentiation of dimension $\mathit{D}$, exponent $\mathit{x}$, where $\mathit{x}\in \mathbb{R}$ (e.g. ${\mathbf{L}}^{\mathrm{2}}$, i.e. “area”)
q_1 + q_2, q_1 - q_2
${\mathit{q}}_{\mathrm{1}}+{\mathit{q}}_{\mathrm{2}},{\mathit{q}}_{\mathrm{1}}-{\mathit{q}}_{\mathrm{2}}$
Addition / Subtraction of quantities of equal dimensions (e.g. $\mathrm{2}\mathrm{kg}+\mathrm{3}\mathrm{g}$)
q_1 q_2, q_1 * q_2
${\mathit{q}}_{\mathrm{1}}{\mathit{q}}_{\mathrm{2}},{\mathit{q}}_{\mathrm{1}}\cdot {\mathit{q}}_{\mathrm{2}}$
Multiplication of quantities (e.g. $\left(\mathrm{2}\mathrm{m}\right)\cdot \left(\mathrm{3}\mathrm{N}\right)$)
c q, c * q
$\mathit{c}\mathit{q},\mathit{c}\cdot \mathit{q}$
Multiplication of a quantities with a scalar (e.g. $\mathrm{5}\cdot \left(\mathrm{3}\mathrm{m}\right)$)
q_1 / q_2
$\frac{{\mathit{u}}_{\mathrm{1}}}{{\mathit{u}}_{\mathrm{2}}}$
Division of quantities (e.g. $\mathrm{2}\mathrm{m}∕\mathrm{3}\mathrm{s}$)
q ^ x
${\mathit{q}}^{\mathit{x}}$
Exponentiation of quantity $\mathit{q}$, exponent $\mathit{x}$, where $\mathit{x}\in \mathbb{R}$ (e.g. ${\left(\mathrm{3}\mathrm{m}\right)}^{\mathrm{2}}$)
$dim u,$dim q
$\mathrm{dim}\mathit{u},\mathrm{dim}\mathit{q}$
Dimension of unit / quantity

#### Statistical Distributions

Distribution Construction
Source Display Description / Comment
$!D_type(parameters) ${\mathbf{D}}_{\mathit{type}}\left(\mathit{parameters}\right)$ Create Distribution object of $\mathit{type}\in \mathbb{K}$, with $\mathit{parameters}$ specific to the given $\mathit{type}$ $!D_'U(a, b)
${\mathbf{D}}_{\mathsf{U}}\left(\mathit{a},\mathit{b}\right)$
Uniform Distribution (continuous) on ${\mathbb{R}}_{\left[\mathit{a},\mathit{b}\right)}$, with $\mathit{a}\in \mathbb{R}$, $\mathit{b}\in \mathbb{R}$, $\mathit{a}<\mathit{b}$
$!D_'N(\mu, \sigma) ${\mathbf{D}}_{\mathsf{N}}\left(\mathit{\mu },\mathit{\sigma }\right)$ Normal Distribution with mean: $\mathit{\mu }\in \mathbb{R}$, standard deviation $\mathit{\sigma }\in {\mathbb{R}}_{+}$ $!D_'Beta(\alpha, \beta)
${\mathbf{D}}_{\mathsf{Beta}}\left(\mathit{\alpha },\mathit{\beta }\right)$
Beta Distribution with alpha: $\mathit{\alpha }\in {\mathbb{R}}_{+}$, beta $\mathit{\beta }\in {\mathbb{R}}_{+}$
$!D_'B(n, p) ${\mathbf{D}}_{\mathsf{B}}\left(\mathit{n},\mathit{p}\right)$ Binomial Distribution with n (number of trials): $\mathit{n}\in {\mathbb{Z}}_{+}$, p (success probability) $\mathit{p}\in {\mathbb{R}}_{\left[\mathrm{0},\mathrm{1}\right]}$ $!D_'Cauchy(x_0, \gamma)
${\mathbf{D}}_{\mathsf{Cauchy}}\left({\mathit{x}}_{\mathrm{0}},\mathit{\gamma }\right)$
Cauchy Distribution with parameters ${\mathit{x}}_{\mathrm{0}}\in \mathbb{R}$ and $\mathit{\gamma }\in {\mathbb{R}}_{+}$
$!D_'Chisq(k) ${\mathbf{D}}_{\mathsf{Chisq}}\left(\mathit{k}\right)$ Chi-Squared Distribution with k (degrees of freedom): $\mathit{k}\in {\mathbb{N}}^{\ast }$ $!D_'Exp(\lambda)
${\mathbf{D}}_{\mathsf{Exp}}\left(\mathit{\lambda }\right)$
Exponential Distribution with lambda (rate): $\mathit{\lambda }\in {\mathbb{R}}^{\ast }$
$!D_'F(d_1, d_2) ${\mathbf{D}}_{\mathsf{F}}\left({\mathit{d}}_{\mathrm{1}},{\mathit{d}}_{\mathrm{2}}\right)$ Fisher–Snedecor Distribution with d_1 and d_2 (degrees of freedom): ${\mathit{d}}_{\mathrm{1}}\in {\mathbb{R}}^{\ast }$ and ${\mathit{d}}_{\mathrm{2}}\in {\mathbb{R}}^{\ast }$ $!D_'Gamma(\alpha, \beta)
${\mathbf{D}}_{\mathsf{Gamma}}\left(\mathit{\alpha },\mathit{\beta }\right)$
Gamma Distribution with alpha: $\mathit{\alpha }\in {\mathbb{R}}_{+}$, beta $\mathit{\beta }\in {\mathbb{R}}_{+}$
$!D_'Geom(p) ${\mathbf{D}}_{\mathsf{Geom}}\left(\mathit{p}\right)$ Geometric Distribution with p (success probability) $\mathit{p}\in {\mathbb{R}}_{\left[\mathrm{0},\mathrm{1}\right]}$ $!D_'Hyper(N, K, n)
${\mathbf{D}}_{\mathsf{Hyper}}\left(\mathit{N},\mathit{K},\mathit{n}\right)$
Hyper geometric Distribution with population size: $\mathit{N}\in {\mathbb{Z}}_{+}$, number of success states: $\mathit{K}\in \left\{\mathrm{0},\mathrm{1},\mathrm{2},\mathrm{\dots },\mathit{N}\right\}$ and number of draws: $\mathit{n}\in \left\{\mathrm{0},\mathrm{1},\mathrm{2},\mathrm{\dots },\mathit{N}\right\}$
$!D_'Lnorm(\mu, \sigma) ${\mathbf{D}}_{\mathsf{Lnorm}}\left(\mathit{\mu },\mathit{\sigma }\right)$ Log-normal Distribution with mean: $\mathit{\mu }\in \mathbb{R}$, standard deviation $\mathit{\sigma }\in {\mathbb{R}}_{+}$ $!D_'Logis(\mu, \sigma)
${\mathbf{D}}_{\mathsf{Logis}}\left(\mathit{\mu },\mathit{s}\right)$
Logistic Distribution with mean: $\mathit{\mu }\in \mathbb{R}$, scale $\mathit{s}\in {\mathbb{R}}_{+}$
$!D_'NB(r, p) ${\mathbf{D}}_{\mathsf{NB}}\left(\mathit{r},\mathit{p}\right)$ Negative binomial Distribution with r (number of trials until experiment stopped): $\mathit{r}\in {\mathbb{R}}_{+}$, p (success probability) $\mathit{p}\in {\mathbb{R}}_{\left[\mathrm{0},\mathrm{1}\right]}$ $!D_'Pois(\lambda)
${\mathbf{D}}_{\mathsf{Pois}}\left(\mathit{\lambda }\right)$
Poisson Distribution with lambda (rate): $\mathit{\lambda }\in {\mathbb{R}}^{\ast }$
$!D_'t(v) ${\mathbf{D}}_{\mathsf{t}}\left(\mathit{v}\right)$ Student’s t Distribution with v (degreees of freedom): $\mathit{v}\in {\mathbb{R}}^{\ast }$ ##### Distribution functions Distribution Functions Distribution CDF[13] PDF / PMF[14] Quantile[15] ${\mathbf{D}}_{\mathsf{U}}\left(\mathit{a},\mathit{b}\right)$ ${\mathbf{D}}_{\mathsf{N}}\left(\mathit{\mu },\mathit{\sigma }\right)$ ${\mathbf{D}}_{\mathsf{Beta}}\left(\mathit{\alpha },\mathit{\beta }\right)$ ${\mathbf{D}}_{\mathsf{Cauchy}}\left({\mathit{x}}_{\mathrm{0}},\mathit{\gamma }\right)$ ${\mathbf{D}}_{\mathsf{Chisq}}\left(\mathit{k}\right)$ ${\mathbf{D}}_{\mathsf{Exp}}\left(\mathit{\lambda }\right)$ ${\mathbf{D}}_{\mathsf{F}}\left({\mathit{d}}_{\mathrm{1}},{\mathit{d}}_{\mathrm{2}}\right)$ ${\mathbf{D}}_{\mathsf{Gamma}}\left(\mathit{\alpha },\mathit{\beta }\right)$ ${\mathbf{D}}_{\mathsf{Geom}}\left(\mathit{p}\right)$ ${\mathbf{D}}_{\mathsf{Hyper}}\left(\mathit{N},\mathit{K},\mathit{n}\right)$ ${\mathbf{D}}_{\mathsf{Lnorm}}\left(\mathit{\mu },\mathit{\sigma }\right)$ ${\mathbf{D}}_{\mathsf{Logis}}\left(\mathit{\mu },\mathit{s}\right)$ ${\mathbf{D}}_{\mathsf{NB}}\left(\mathit{r},\mathit{p}\right)$ ${\mathbf{D}}_{\mathsf{Pois}}\left(\mathit{\lambda }\right)$ ${\mathbf{D}}_{\mathsf{t}}\left(\mathit{v}\right)$ Notes  [13] CDF function call example (with the distribution as the first parameter): $CDF($!D_'N( 0.0, 1.0), 2.0)  [14] PDF function call example (with the distribution as the first parameter): $PDF($!D_'N( 0.0, 1.0), 2.0), PMF function call example (with the distribution as the first parameter): $PMF($!D_'Geom( 0.3), 4.0)  [15] Quantile function call example (with the distribution as the first parameter): $Quantile($!D_'N( 0.0, 1.0), 0.5) ##### Functions calculating distribution properties Distribution Functions Distribution Mean Median Mode Variance Skewness Kurtosis ${\mathbf{D}}_{\mathsf{U}}\left(\mathit{a},\mathit{b}\right)$ ${\mathbf{D}}_{\mathsf{N}}\left(\mathit{\mu },\mathit{\sigma }\right)$ ${\mathbf{D}}_{\mathsf{Beta}}\left(\mathit{\alpha },\mathit{\beta }\right)$ ${\mathbf{D}}_{\mathsf{Cauchy}}\left({\mathit{x}}_{\mathrm{0}},\mathit{\gamma }\right)$ ${\mathbf{D}}_{\mathsf{Chisq}}\left(\mathit{k}\right)$ ${\mathbf{D}}_{\mathsf{Exp}}\left(\mathit{\lambda }\right)$ ${\mathbf{D}}_{\mathsf{F}}\left({\mathit{d}}_{\mathrm{1}},{\mathit{d}}_{\mathrm{2}}\right)$ ${\mathbf{D}}_{\mathsf{Gamma}}\left(\mathit{\alpha },\mathit{\beta }\right)$ ${\mathbf{D}}_{\mathsf{Geom}}\left(\mathit{p}\right)$ ${\mathbf{D}}_{\mathsf{Hyper}}\left(\mathit{N},\mathit{K},\mathit{n}\right)$ ${\mathbf{D}}_{\mathsf{Lnorm}}\left(\mathit{\mu },\mathit{\sigma }\right)$ ${\mathbf{D}}_{\mathsf{Logis}}\left(\mathit{\mu },\mathit{s}\right)$ ${\mathbf{D}}_{\mathsf{NB}}\left(\mathit{r},\mathit{p}\right)$ ${\mathbf{D}}_{\mathsf{Pois}}\left(\mathit{\lambda }\right)$ ${\mathbf{D}}_{\mathsf{t}}\left(\mathit{v}\right)$ #### Null value Null value means “no value”. It can also be regarded an “empty list”. Some expressions may produce no result and return a null value: empty sums / products, set comprehensions like x (- S if S is the empty set, or filtered comprehensions if all values fail the filter expression, like x = 1,…,1000 : x < 0. The null value is not an actual mathematical value, it • cannot be constructed directly, • cannot be assigned to a variable, • cannot be passed to / returned by a function, • cannot be the element of a collection (FiniteSet, Tuple, Sequence, etc.), • cannot be compared to another value However, null values may exist temporarily during expression evaluation as some operators process the null value and return a meaningful result. Operations on Null values Source Display Description / Comment {{ NULL }}[16] $\left\{\mathit{NULL}\right\}$ Empty set () {< NULL >} $⟨\mathit{NULL}⟩$ Empty Sequence NULL ?? D $\mathit{NULL}⁇\mathit{D}$ Null-coalescing operator, $\mathit{D}$ is default value Notes  [16] In this table $\mathit{NULL}$ denotes any expression that yields “nothing” (“null”) ### Collections #### Lists Lists can be constructed by enumerating elements or by using a range or repeat construct. List Construction Source Display Description / Comment a, b, c $\mathit{a},\mathit{b},\mathit{c}$ Enumeration of list items Ranges & Repeats Source Display Description / Comment 1, ..., n $\mathrm{1},\mathrm{\dots },\mathit{n}$ Integer Range {k, ...} _} m $\underset{\mathit{m}}{\underset{⏟}{\mathit{k},\mathrm{\dots }}}$ Repeat element $\mathit{m}$ times ($\mathit{m}\geqq \mathrm{0}$) {k, ... ,k} _} m $\underset{\mathit{m}}{\underset{⏟}{\mathit{k},\mathrm{\dots },\mathit{k}}}$ Repeat element (alternative notation) {k, ...} ^} m $\stackrel{\mathit{m}}{\stackrel{⏞}{\mathit{k},\mathrm{\dots }}}$ Repeat element (with overbrace)[17] {k, ... ,k} ^} m $\stackrel{\mathit{m}}{\stackrel{⏞}{\mathit{k},\mathrm{\dots },\mathit{k}}}$ Repeat element (alternative, with overbrace)[17] {f, s, ..., l} $\mathit{f},\mathit{s},\mathrm{\dots },\mathit{l}$ Arbitrary Range ($\mathit{f}$: first, $\mathit{s}$: second, $\mathit{l}$:last item)[17] {f, s, ...} _} m $\underset{\mathit{m}}{\underset{⏟}{\mathit{f},\mathit{s},\mathrm{\dots }}}$ Arbitrary Range ($\mathit{f}$: first, $\mathit{s}$: second item, $\mathit{m}$: number of items)[17] {f, ..., l} _} m $\underset{\mathit{m}}{\underset{⏟}{\mathit{f},\mathrm{\dots },\mathit{l}}}$ Arbitrary Range ($\mathit{f}$: first, $\mathit{l}$: last item, $\mathit{m}$: number of items)[17] {1,...,k}_}, {n,...,m}_} $\underset{⏟}{\mathrm{1},\mathrm{\dots },\mathit{k}},\underset{⏟}{\mathit{n},\mathrm{\dots },\mathit{m}}$ List operator with grouping underbrace[18][17] Notes  [17] (1, 2, 3, 4, 5, 6) Underbraces and overbraces are provided as typographical alternatives with the same meaning. Hint: use underbraces unless the layout is better with overbraces (e.g. above a fraction bar) Underbraces and overbraces can be used interchangably in all examples, even if not listed.  [18] When two or more lists are operands of the list operator, the sub-lists are concatenated (instead of “nesting”). If using a range as an operand, an underbrace (or overbrace) must be used for grouping the ranges construct. List Comprehension Source Display Description / Comment E(x) | x = k, ... ,n $\mathit{E}\left(\mathit{x}\right)|\mathit{x}=\mathit{k},\mathrm{\dots },\mathit{n}$ Map expression $\mathit{E}\left(\mathit{x}\right)$ to local variable binding $\mathit{x}=\mathit{k},\mathrm{\dots },\mathit{n}$. x = a, b, c | f(x) = 0 $\mathit{x}=\mathit{a},\mathit{b},\mathit{c}|\mathit{f}\left(\mathit{x}\right)=\mathrm{0}$ Select using local variable binding $\mathit{x}=\mathit{a},\mathit{b},\mathit{c}$, filter elements that satisfy condition $\mathit{f}\left(\mathit{x}\right)=\mathrm{0}$ E(x) | x = 1,...,m /\ f(x) = 0 $\mathit{E}\left(\mathit{x}\right)|\mathit{x}=\mathrm{1},\mathrm{\dots },\mathit{m}\wedge \mathit{f}\left(\mathit{x}\right)=\mathrm{0}$ Map & select combined E(x) | x = 1,...,m : f(x) = 0 $\mathit{E}\left(\mathit{x}\right)|\mathit{x}=\mathrm{1},\mathrm{\dots },\mathit{m}:\mathit{f}\left(\mathit{x}\right)=\mathrm{0}$ Map & select (alternative notation) expression | binding Generic form of List comprehension (see below) #### Bindings Bindings Source Display Description / Comment x = 1, ... ,n $\mathit{x}=\mathrm{1},\mathrm{\dots },\mathit{n}$ Binding a single variable by iterating from a List (Range) x (- S $\mathit{x}\in \mathit{S}$ Binding a single variable by iterating from a Finite Set x = a $\mathit{x}=\mathit{a}$ Singleton Binding (x, y, z) (- S $\left(\mathit{x},\mathit{y},\mathit{z}\right)\in \mathit{S}$ Destructuring (Tuple) with Binding {{x}} = S, T, U $\left\{\mathit{x}\right\}=\mathit{S},\mathit{T},\mathit{U}$ Destructuring (singleton set) with Binding {<x, y, z>} (- S $⟨\mathit{x},\mathit{y},\mathit{z}⟩\in \mathit{S}$ Destructuring (Sequence) with Binding x = 1, ... ,n /\ f(x)=0 $\mathit{x}=\mathrm{1},\mathrm{\dots },\mathit{n}\wedge \mathit{f}\left(\mathit{x}\right)=\mathrm{0}$ Binding with Filter x = 1, ... ,n : f(x)=0 $\mathit{x}=\mathrm{1},\mathrm{\dots },\mathit{n}:\mathit{f}\left(\mathit{x}\right)=\mathrm{0}$ Binding with Filter (alternative notation) i = 1,...,n; y (- S_i $\mathit{i}=\mathrm{1},\mathrm{\dots },\mathit{n};\mathit{y}\in {\mathit{S}}_{\mathit{i}}$ Joined Binding of two distinct Variables $\mathit{i}$ and $\mathit{y}$ x(-S /\ x < 3; y (- S(x) /\ y > 0 $\mathit{x}\in \mathit{S}\wedge \mathit{x}>\mathrm{0};\mathit{y}\in \mathit{S}\left(\mathit{x}\right)\wedge \mathit{y}<\mathit{x}$ Joined Binding with filters #### Tuples Tuple Construction Source Display Description / Comment (a, b) $\left(\mathit{a},\mathit{b}\right)$ 2-tuple, i.e. ordered pair k |-> v $\mathit{k}↦\mathit{v}$ Maplet operator.[19] (a, b, c), (a, b, c, d) $\left(\mathit{a},\mathit{b},\mathit{c}\right),\left(\mathit{a},\mathit{b},\mathit{c},\mathit{d}\right)$ 3-tuple, i.e. triple, 4-tuple, i.e. quadruple etc. (listComprehension) Tuple constructed by List comprehension Notes  [19] Maplets are mainly syntactic sugar for ordered pairs used as “key-value” pairs, so $\mathit{x}↦\mathit{y}=\left(\mathit{x},\mathit{y}\right)$. However, Association literals treat maplets differently from ordinary ordered pairs (see below). Tuple Operations Source Display Description / Comment $len T
$\mathrm{len}\mathit{T}$
Length of a tuple $\mathit{T}$
( T )_i
${\left(\mathit{T}\right)}_{\mathit{i}}$
Member access (get $\mathit{i}$‘th member of Tuple)

#### Finite Sets

Finite Set Construction
Source Display Description / Comment
{{a, b, c}}
$\left\{\mathrm{1},\mathrm{2},\mathrm{3}\right\}$
Enumeration of elements
{{}}, /0
$\left\{\right\},\mathrm{\varnothing }$
Empty set (literal / identifier form)
{{ listComprehension }}   Finite Set constructed by List comprehension (“Set Builder”)
Finite Set Operations
Source Display Description / Comment
$card S, {|S|} $\mathrm{card}\mathit{S},\left|\mathit{S}\right|$ Cardinality of (number of elements in) $\mathit{S}$ S (_) T $\mathit{S}\cup \mathit{T}$ Union, set of elements in either $\mathit{S}$ or $\mathit{T}$ S (~) T $\mathit{S}\cap \mathit{T}$ Intersection, set of element in both $\mathit{S}$ and $\mathit{T}$ S \\ T $\mathit{S}\setminus \mathit{T}$ Set difference, set of element in $\mathit{S}$ but not in $\mathit{T}$ S ** T $\mathit{S}×\mathit{T}$ Cartesian product, set of ordered pairs $\left(\mathit{x},\mathit{y}\right)$ such that $\mathit{x}\in \mathit{S}$, $\mathit{y}\in \mathit{T}$ S ** T ** U $\mathit{S}×\mathit{T}×\mathit{U}$ Cartesian product, ternary: set of ordered triplets, etc. S ^ n ${\mathit{S}}^{\mathit{n}}$ Cartesian power, set of $\mathit{n}$-tuples $\left({\mathit{x}}_{\mathrm{1}},\mathrm{\dots },{\mathit{x}}_{\mathit{n}}\right)$ such that ${\mathit{x}}_{\mathit{i}}\in \mathit{S}$, for all $\mathit{i}$ $P(S)
$\mathrm{P}\left(\mathit{S}\right)$
Powerset, set of sets consisting of elements of $\mathit{S}$
Finite Set Relational Operators
Source Display Description / Comment
x (- S -) y
$\mathit{x}\in \mathit{S}\ni \mathit{y}$
Element of / Contains as member
x /(- S /-) y
$\mathit{x}\notin \mathit{S}\not\ni \mathit{y}$
Not an element of / Does not contain as member
S = T /= U
$\mathit{S}=\mathit{T}\ne \mathit{U}$
Equals / Does not equal, sets are equal if both contain the same elements
S (: T (:= U (:_ V
$\mathit{S}\subset \mathit{T}⫅\mathit{U}\subseteq \mathit{V}$
Subset (Alternative forms have identical meaning)
S :) T :)= U :)_ V
$\mathit{S}\supset \mathit{T}⫆\mathit{U}\supseteq \mathit{V}$
Superset (Alternative forms have identical meaning)
S (:/= T (:/_ U
$\mathit{S}⫋\mathit{T}⊊\mathit{U}$
Proper subset (Alternative forms have identical meaning)
S :)/= T :)/_ U
$\mathit{S}⫌\mathit{T}⊋\mathit{U}$
Proper superset (Alternative forms have identical meaning)
S /(: T /(:_ U
$\mathit{S}\not\subset \mathit{T}⊈\mathit{U}$
Not subset (Alternative forms have identical meaning)
S /:) T /:)_ U
$\mathit{S}\not\supset \mathit{T}⊉\mathit{U}$
Not superset (Alternative forms have identical meaning)
##### Associations (Maps) & Sets of Associations (Relational Tables)
Association & Relational Table Construction
Source Display Description / Comment
{{'a |-> 1, 'b |-> 2}}
$\left\{\mathsf{a}↦\mathrm{1},\mathsf{b}↦\mathrm{2}\right\}$
Association literal; checks uniqueness of “keys”
{{ ('a,1), ('b,2) }}
$\left\{\left(\mathsf{a},\mathrm{1}\right),\left(\mathsf{b},\mathrm{2}\right)\right\}$
Association constructed as a set of ordered pairs; constructs same object but does not check uniqueness of “keys”
{{ m_1, m_2, ... , m_n }}
$\left\{{\mathit{m}}_{\mathrm{1}},{\mathit{m}}_{\mathrm{2}},\mathrm{\dots },{\mathit{m}}_{\mathit{n}}\right\}$
“Relational Table” constructed from Associations ${\mathit{m}}_{\mathit{i}}|\mathit{i}=\mathrm{1},\mathrm{\dots },\mathit{n}$
Association & Relational Table Operations
Source Display Description / Comment
A(k)
$\mathit{A}\left(\mathit{k}\right)$
Function invocation: get “value” of Association $\mathit{A}$ @ argument $\mathit{k}$ as “key”
(A)_k
${\left(\mathit{A}\right)}_{\mathit{k}}$
Part: get “value” of Association $\mathit{A}$ corresponding to “key” $\mathit{k}$
(A)_{k_1,k_2,k_3}
${\left(\mathit{A}\right)}_{{\mathit{k}}_{\mathrm{1}},{\mathit{k}}_{\mathrm{2}},{\mathit{k}}_{\mathrm{3}}}$
Nested Part: same as ${\left({\left({\left(\mathit{A}\right)}_{{\mathit{k}}_{\mathrm{1}}}\right)}_{{\mathit{k}}_{\mathrm{2}}}\right)}_{{\mathit{k}}_{\mathrm{3}}}$ (any number of levels allowed).
$dom A $\mathrm{dom}\mathit{A}$ Domain of Association $\mathit{A}$: set of “keys”. $ran A
$\mathrm{ran}\mathit{A}$
Range of Association $\mathit{A}$: set of “values”.
$cod A $\mathrm{cod}\mathit{A}$ Codomain of Association $\mathit{A}$: target set of mapping. For maps constructed with a map literal, the codomain is the same as the range. A (_)<- B $\mathit{A}⊌\mathit{B}$ Overriding union: add / modify “values” @ “keys” of $\mathit{A}$, based on keys/values of $\mathit{B}$. A |\ K $\mathit{A}↾\mathit{K}$ Restriction of Association $\mathit{A}$ to the “key” set $\mathit{K}$. Drops keys _not_ in $\mathit{K}$. A |/ K $\mathit{A}⇂\mathit{K}$ Anti-restriction of Association $\mathit{A}$. Drop keys in $\mathit{K}$. A .. B $\mathit{A}\circ \mathit{B}$ Functional composition of Associations $\mathit{A}$ and $\mathit{B}$. $\sigma_{'a|->1, 'b|->2} T
${\mathrm{\sigma }}_{\mathsf{a}↦\mathrm{1},\mathsf{b}↦\mathrm{2}}\mathit{T}$
Select “rows” from a Relational Table $\mathit{T}$. Selection criteria is specified as subscript.
{{(r)_'b | r (- T /\ (r)_'a = 1}}
$\left\{{\left(\mathit{r}\right)}_{\mathsf{b}}|\mathit{r}\in \mathit{T}\wedge {\left(\mathit{r}\right)}_{\mathsf{a}}=\mathrm{1}\right\}$
Query a Relational Table $\mathit{T}$.
$head T $\mathrm{head}\mathit{T}$ Header of a Relational Table (union of domain of $\mathit{T}$ ‘s elements, or “rows”) Association are sets, therefore set operators can also be used. #### Sequences Sequence Construction Source Display Description / Comment {< a, b, c >} $⟨\mathit{a},\mathit{b},\mathit{c}⟩$ Sequence literal {{ 1|->a, 2|->b, 3|->c }} $\left\{\mathrm{1}↦\mathit{a},\mathrm{2}↦\mathit{b},\mathrm{3}↦\mathit{c}\right\}$ Sequence constructed as an Association (equal to sequence above) {< >} $⟨⟩$ Empty Sequence. Same as the empty set $\mathrm{\varnothing }$[20] {< listComprehension >} Sequence constructed by List comprehension Notes  [20] Sequences are functions from $\left\{\mathrm{1},\mathrm{\dots },\mathit{n}\right\}$ to any set. Therefore the empty Sequence is the empty Association, which is the empty set. Sequence Operations Source Display Description / Comment $len S
$\mathrm{len}\mathit{S}$
Length of a sequence $\mathit{S}$
( S )_i
${\left(\mathit{S}\right)}_{\mathit{i}}$
Member acces (get $\mathit{i}$‘th member of Sequence)
( S )_{< i_1, i_2, i_3>}
${\left(\mathit{S}\right)}_{⟨{\mathit{i}}_{\mathrm{1}},{\mathit{i}}_{\mathrm{2}},{\mathit{i}}_{\mathrm{3}}⟩}$
Subsequence ($\mathit{s}$: base Sequence, ${\mathit{i}}_{\mathrm{1}},{\mathit{i}}_{\mathrm{2}},{\mathit{i}}_{\mathrm{3}}$ indexes into $\mathit{s}$)
( S )_{< n,...,m >}
${\left(\mathit{S}\right)}_{⟨\mathit{n},\mathrm{\dots },\mathit{m}⟩}$
Subsequence defined by a range ($\mathit{n}$: first index, $\mathit{m}$: last index
$rndseq_I(D,l) ${\mathrm{rndseq}}_{\mathit{I}}\left(\mathit{D},\mathit{l}\right)$ Random sequence generated with distribution $\mathit{D}$, length $\mathit{l}\in {\mathbb{N}}^{\ast }$, index $\mathit{I}$[21] $sort_f( S )
${\mathrm{sort}}_{\mathit{f}}\left(\mathit{S}\right)$
Sort a Sequence $\mathit{S}\in \mathrm{Seq}\left(\mathit{X}\right)$ using a comparator function $\mathit{f}\in {\mathit{X}}^{\mathrm{2}}⟶\mathbb{R}$
$order_f( S ) ${\mathrm{order}}_{\mathit{f}}\left(\mathit{S}\right)$ Order a Set $\mathit{S}\in \mathrm{P}\left(\mathit{X}\right)$ using a comparator function $\mathit{f}\in {\mathit{X}}^{\mathrm{2}}⟶\mathbb{R}$ $reduce_f( S )
${\mathrm{reduce}}_{\mathit{f}}\left(\mathit{S}\right)$
Reduce a sequence using a function representing a binary operation.
$reduce_{f, id}( S ) ${\mathrm{reduce}}_{\mathit{f},\mathit{id}}\left(\mathit{S}\right)$ Reduce with optional identity member $\mathit{id}$, which is returned if $\mathit{S}$ is empty $fold_{f, init}( S )
${\mathrm{fold}}_{\mathit{f},\mathit{init}}\left(\mathit{S}\right)$
Fold with processing function $\mathit{f}$

Notes

 [21] Index is a user-defined value of any type (any primitive or compound object) that differentiates random sequences used in the same project. Internally, the index is used to generate a (pseudo) random, deterministic seed for the random generator that produces the values in the sequence.

Sequences are Associations (Maps), therefore Association and set operators can also be used. Some of the more useful operations are listed below.

Association and Set Operators on Sequences
Source Display Description / Comment
$card S, {|S|} $\mathrm{card}\mathit{S},\left|\mathit{S}\right|$ Cardinality of a Sequence $\mathit{S}$, same as length. S( i ) $\mathit{S}\left(\mathit{i}\right)$ Function invocation on a Sequence, gets member @ position $\mathit{i}$ $dom S
$\mathrm{dom}\mathit{S}$
Domain of Sequence, returns set of indices $\left\{\mathrm{1},\mathrm{\dots },\mathrm{len}\mathit{S}\right\}$
$ran S $\mathrm{ran}\mathit{S}$ Range of a Sequence, returns members of $\mathit{S}$ as a FiniteSet. i |-> e (- S $\mathit{i}↦\mathit{e}\in \mathit{S}$ Test: member @ index $\mathit{i}$ is $\mathit{e}$ ? (true iff ${\left(\mathit{S}\right)}_{\mathit{i}}=\mathit{e}$) T (: S $\mathit{T}\subset \mathit{S}$ Initial Subsequence: if $\mathit{T}$ is a sequence, then $\mathit{T}\subset \mathit{S}$ iff $\mathit{T}$ is an initial subsequence of $\mathit{S}$[22] Notes  [22] However, if $\mathit{T}$ is not a sequence, then it can be a subset of $\mathit{S}$ without being an initial subsequence. For example, $\left\{\mathrm{2}↦\mathsf{b}\right\}\subset ⟨\mathsf{a},\mathsf{b},\mathsf{c}⟩$ but it is clearly not an initial subsequence (not even a Sequence). ##### Operations on Numeric Sequences Sequences containing numbers support some specific operations. Note: most of the operations below also work on Finite Sets and Tuples containing numbers. Operations on Numeric Sequences Source Display Description / Comment $min( S )
$\mathrm{min}\left(\mathit{S}\right)$
Minimum of a Sequence $\mathit{S}$ of real numbers.
$max( S ) $\mathrm{max}\left(\mathit{S}\right)$ Maximum of a Sequence $\mathit{S}$ of real numbers. $sum( S )
$\mathrm{sum}\left(\mathit{S}\right)$
Sum of a Sequence $\mathit{S}$ of real numbers.
$prod( S ) $\mathrm{prod}\left(\mathit{S}\right)$ Product of a Sequence $\mathit{S}$ of real numbers. $mean( S )
$\mathrm{mean}\left(\mathit{S}\right)$
Mean (arithmetic) of a Sequence $\mathit{S}$ of real numbers.
$mean_'a( S ) ${\mathrm{mean}}_{\mathsf{a}}\left(\mathit{S}\right)$ Arithmetic Mean of a Sequence $\mathit{S}$ of real numbers. $mean_'g( S )
${\mathrm{mean}}_{\mathsf{g}}\left(\mathit{S}\right)$
Geometricic Mean of a Sequence $\mathit{S}$ of positive real numbers.
$mean_'h( S ) ${\mathrm{mean}}_{\mathsf{h}}\left(\mathit{S}\right)$ Harmonic Mean of a Sequence $\mathit{S}$ of positive real numbers. $mean_'q( S )
${\mathrm{mean}}_{\mathsf{q}}\left(\mathit{S}\right)$
Quadratic Mean (root-mean-square) of a Sequence $\mathit{S}$ of positive real numbers.
$mean_p( S ) ${\mathrm{mean}}_{\mathit{p}}\left(\mathit{S}\right)$ Power Mean of a Sequence $\mathit{S}$ of positive real numbers, for any $\mathit{p}\in \stackrel{‾}{\mathbb{R}}$. $median( S )
$\mathrm{median}\left(\mathit{S}\right)$
Median of a Sequence $\mathit{S}$ of real numbers.
$var( S ) $\mathrm{var}\left(\mathit{S}\right)$ Variance of a Sequence $\mathit{S}$ of real numbers. $std( S )
$\mathrm{std}\left(\mathit{S}\right)$
Standard deviation of a Sequence $\mathit{S}$ of real numbers.

#### Domains

Built-in Base Domains
Source Display Description / Comment
%P
$\mathbb{P}$
Prime numbers
%N
$\mathbb{N}$
Natural numbers
%Z
$\mathbb{Z}$
Integer numbers
%Q
$\mathbb{Q}$
Rational numbers
%R
$\mathbb{R}$
Real numbers
%C
$\mathbb{C}$
Complex numbers
%K
$\mathbb{K}$
Keyword values
%S
$\mathbb{S}$
String values
%D
$\mathbb{D}$
Date values
%T
$\mathbb{T}$
Date-Time values
Modified Base Domains
Source Display Description / Comment
%N^*, %Z^*, %Q^*, %R^*, %C^*
${\mathbb{N}}^{\ast },{\mathbb{Z}}^{\ast },{\mathbb{Q}}^{\ast },{\mathbb{R}}^{\ast },{\mathbb{C}}^{\ast }$
Zero exclusion, same as $\mathbb{N}\setminus \left\{\mathrm{0}\right\}$ , $\mathbb{Z}\setminus \left\{\mathrm{0}\right\}$ , etc.
%S^*
${\mathbb{S}}^{\ast }$
Non-empty strings
%N^^_, %Z^^_, %Q^^_, %R^^_
$\stackrel{‾}{\mathbb{N}},\stackrel{‾}{\mathbb{Z}},\stackrel{‾}{\mathbb{Q}},\stackrel{‾}{\mathbb{R}}$
Infinity extension, same as $\mathbb{N}\cup \left\{+\mathrm{\infty }\right\}$ , $\mathbb{Z}\cup \left\{-\mathrm{\infty },+\mathrm{\infty }\right\}$ , etc.
%Z_+, %Q_+, %R_+
${\mathbb{Z}}_{+},{\mathbb{Q}}_{+},{\mathbb{R}}_{+}$
Non-negative half, same as $\left\{\mathit{n}\in \mathbb{Z}:\mathit{n}\geqq \mathrm{0}\right\}$ , etc.
%Z_-, %Q_-, %R_-
${\mathbb{Z}}_{-},{\mathbb{Q}}_{-},{\mathbb{R}}_{-}$
Non-positive half, same as $\left\{\mathit{n}\in \mathbb{Z}:\mathit{n}\leqq \mathrm{0}\right\}$ , etc.
%R^^__+^*
${\stackrel{‾}{\mathbb{R}}}_{+}^{\ast }$
All 3 types of modifier combined
Constrained Base Domains
Source Display Description / Comment
%R_{<3}, %Z_{>5}, %N_{>=10}
${\mathbb{R}}_{<\mathrm{3}},{\mathbb{Z}}_{>\mathrm{5}},{\mathbb{N}}_{\geqq \mathrm{10}}$
Relational constraints[23], same as $\left\{\mathit{x}\in \mathbb{R}:\mathit{x}<\mathrm{3}\right\}$, etc.
%R_(a,b)
${\mathbb{R}}_{\left(\mathit{a},\mathit{b}\right)}$
Interval (open)
%R_[a,b]
${\mathbb{R}}_{\left[\mathit{a},\mathit{b}\right]}$
Interval (closed)
%R_(a,b]
${\mathbb{R}}_{\left(\mathit{a},\mathit{b}\right]}$
Interval (left half-open)
%R_[a,b)
${\mathbb{R}}_{\left[\mathit{a},\mathit{b}\right)}$
Interval (right half-open)
%R^^_^*_[a,b]
${\stackrel{‾}{\mathbb{R}}}_{\left[\mathit{a},\mathit{b}\right]}^{\ast }$
Constraint combined with modifiers

Notes

 [23] All ordered numeric base domains may be used in all examples, i.e. $\mathbb{P},\mathbb{N},\mathbb{Z},\mathbb{Q},\mathbb{R}$ are all valid.
Domain operations
Source Display Description / Comment
D_1 (_) D_2
${\mathit{D}}_{\mathrm{1}}\cup {\mathit{D}}_{\mathrm{2}}$
Union of Domains
D_1 (~) D_2
${\mathit{D}}_{\mathrm{1}}\cap {\mathit{D}}_{\mathrm{2}}$
Intersection of Domains
D_1 \\ D_2
${\mathit{D}}_{\mathrm{1}}\setminus {\mathit{D}}_{\mathrm{2}}$
Difference of Domains
D_1 ** D_2
${\mathit{D}}_{\mathrm{1}}×{\mathit{D}}_{\mathrm{2}}$
Cartesian product, binary
D_1 ** D_2 ** D_3
${\mathit{D}}_{\mathrm{1}}×{\mathit{D}}_{\mathrm{2}}×{\mathit{D}}_{\mathrm{3}}$
Cartesian product, ternary, etc.
D ^ n
${\mathit{D}}^{\mathit{n}}$
Cartesian power of Domains
D ^ 00
${\mathit{D}}^{\mathrm{\infty }}$
Cartesian power, any length; $\mathit{D}\cup {\mathit{D}}^{\mathrm{2}}\cup {\mathit{D}}^{\mathrm{3}},\mathrm{\dots }$
$P(D) $\mathrm{P}\left(\mathit{D}\right)$ Powerset of Domain (valid for finite $\mathit{D}$ only) $P_{<00}(D)
${\mathrm{P}}_{<\mathrm{\infty }}\left(\mathit{D}\right)$
Finite Powerset of Domain
$Tpl(D) $\mathrm{Tpl}\left(\mathit{D}\right)$ Set of Tuples with members in $\mathit{D}$ $Tpl_[a,b](D)
${\mathrm{Tpl}}_{\left[\mathit{a},\mathit{b}\right]}\left(\mathit{D}\right)$
Set of Tuples with members in $\mathit{D}$, length constrained by $\mathit{a}$ and $\mathit{b}$
$Tpl_{<=n}(D) ${\mathrm{Tpl}}_{\leqq \mathit{n}}\left(\mathit{D}\right)$ Set of Tuples with members in $\mathit{D}$, length constrained by $\mathit{n}$ $Vec(%R), $Vec(%C) $\mathrm{Vec}\left(\mathbb{R}\right),\mathrm{Vec}\left(\mathbb{C}\right)$ Set of Vectors with real / complex values $Vec_k(%R), $Vec_k(%C) ${\mathrm{Vec}}_{\mathit{k}}\left(\mathbb{R}\right),{\mathrm{Vec}}_{\mathit{k}}\left(\mathbb{C}\right)$ Set of Vectors with size $\mathit{k}$ $Mat(%R), $Mat(%C) $\mathrm{Mat}\left(\mathbb{R}\right),\mathrm{Mat}\left(\mathbb{C}\right)$ Set of Matrices with real / complex values $Mat_{m,n}(%R), $Mat_{m,n}(%C) ${\mathrm{Mat}}_{\mathit{m},\mathit{n}}\left(\mathbb{R}\right),{\mathrm{Mat}}_{\mathit{m},\mathit{n}}\left(\mathbb{C}\right)$ Set of $\mathit{m}×\mathit{n}$ Matrices $Qty_d(%R), $Qty_d(%R^*) ${\mathrm{Qty}}_{\mathit{d}}\left(\mathbb{R}\right),{\mathrm{Qty}}_{\mathit{d}}\left({\mathbb{R}}^{\ast }\right)$ Set of Quantities with dimension $\mathit{d}$ $Seq(D)
$\mathrm{Seq}\left(\mathit{D}\right)$
Set of Sequences with members in $\mathit{D}$
$Seq_[a,b](D) ${\mathrm{Seq}}_{\left[\mathit{a},\mathit{b}\right]}\left(\mathit{D}\right)$ Set of Sequences with members in $\mathit{D}$, length constrained by $\mathit{a}$ and $\mathit{b}$ $Seq_{<=n}(D)
${\mathrm{Seq}}_{\leqq \mathit{n}}\left(\mathit{D}\right)$
Set of Sequences with members in $\mathit{D}$, length constrained by $\mathit{n}$
$Asc(F_1, ..., F_n) $\mathrm{Asc}\left({\mathit{F}}_{\mathrm{1}},\mathrm{\dots },{\mathit{F}}_{\mathit{n}}\right)$ Set of Associations defined piecewise from function spaces[27] D --> C $\mathit{D}⟶\mathit{C}$ Set of functions from domain $\mathit{D}$ into codomain $\mathit{C}$[24] D -|-> C[25] $\mathit{D}⇸\mathit{C}$ Set of partial functions[26] from domain $\mathit{D}$ into codomain $\mathit{C}$[24] D -||-> C[25] $\mathit{D}⇻\mathit{C}$ Set of finite partial functions [#fPartialFunction] from domain $\mathit{D}$ into codomain $\mathit{C}$[24] C^D ${\mathit{C}}^{\mathit{D}}$ Set exponentiation, set of Associations from $\mathit{D}$ into $\mathit{C}$[24][28] Notes  [24] (1, 2, 3, 4) “into codomain $\mathit{C}$” means that a function $\mathit{f}$ is an element of of the result Domain iff the actual codomain of $\mathit{f}$ is some ${\mathit{C}}^{\prime }$, such that ${\mathit{C}}^{\prime }\subset \mathit{C}$. Note that the subset relation is generally not computable for infinite $\mathit{C}$.  [25] (1, 2) The arrows used in $\mathit{D}⇸\mathit{C}$ and $\mathit{D}⇻\mathit{C}$ should be rendered longer; however, unfortunately Unicode does not offer a longer form of these operators.  [26] “partial function” means a function with an actual domain ${\mathit{D}}^{\prime }$ such that ${\mathit{D}}^{\prime }\subset \mathit{D}$.  [27] The ${\mathit{F}}_{\mathit{i}}$ argument(s) of the Asc operator can be any combination of the following function spaces: $\mathit{D}⟶\mathit{C}$, $\mathit{D}⇸\mathit{C}$, $\mathit{D}⇻\mathit{C}$, or ${\mathit{C}}^{\mathit{D}}$. The domains specified on the arguments of the Asc operator must be disjoint (non-overlapping), and finite (except $\mathit{D}⇻\mathit{C}$, which allows infinite $\mathit{D}$). The resulting Domain contains all Associations that can be constructed as the union of “pieces” taken from the argument spaces. Example: $\mathrm{Asc}\left(\left\{\mathsf{a},\mathsf{b},\mathsf{c}\right\}⟶\mathbb{R},\mathbb{S}⇻\mathbb{S}\right)$ defines the set of Associations with (mandatory) keys $\left\{\mathsf{a},\mathsf{b},\mathsf{c}\right\}$, whose values are real numbers, plus any (finite) number of optional string keys, whose values are strings.  [28] The notation ${\mathit{C}}^{\mathit{D}}$ is traditionally used in set theory. The meaning is the same as $\mathrm{Asc}\left(\mathit{D}⟶\mathit{C}\right)$. Symbolic Domains Source Display Description / Comment {{ x (- D : f(x) = 0 }} $\left\{\mathit{x}\in \mathit{D}:\mathit{f}\left(\mathit{x}\right)=\mathrm{0}\right\}$ Restriction[29] of a Domain using local variable binding $\mathit{x}\in \mathit{D}$, and condition $\mathit{f}\left(\mathit{x}\right)=\mathrm{0}$ {{ expression : x (- D }} $\left\{\mathit{expression}:\mathit{x}\in \mathit{D}\right\}$ Replacement[30]: symbolic mapping of $\mathit{expression}$ to local variable binding $\mathit{x}\in \mathit{D}$. {{ expression : x (- D /\ f(x)=0 }} $\left\{\mathit{expression}:\mathit{x}\in \mathit{D}\wedge \mathit{f}\left(\mathit{x}\right)=\mathrm{0}\right\}$ Restriction & Replacement combined {{ expression : x (- D : f(x)=0 }} $\left\{\mathit{expression}:\mathit{x}\in \mathit{D}:\mathit{f}\left(\mathit{x}\right)=\mathrm{0}\right\}$ Restriction & Replacement combined (alternative notation) {{ expression : binding }} Generic form of Symbolic Domain construction Notes  [29] The term “restriction” is used in the sense of “specification” / “separation” / “restricted comprehension” / “restriction” in ZFC. Of all these terms, “restriction” seems to be the most expressive. Restriction is similar to selection, but the operator is $:$ instead of $|$, and the resulting set is not computed element by element.  [30] The term “replacement” is used in the sense of “replacement” in ZFC. Replacement is similar to mapping, but the operator is $:$ instead of $|$, and the resulting set is not computed element by element. Replacement is limited to l-value expressions like $\mathit{x}$, $\left(\mathit{x},\mathit{y}\right)$, $\left\{\mathit{x}\right\}$ etc. Domain Relational Operators Source Display Description / Comment x (- D -) y $\mathit{x}\in \mathit{D}\ni \mathit{y}$ Element of / Contains as member x /(- D /-) y $\mathit{x}\notin \mathit{D}\not\ni \mathit{y}$ Not an element of / Does not contain as member D_1 = D_2 /= D_3 ${\mathit{D}}_{\mathrm{1}}={\mathit{D}}_{\mathrm{2}}\ne {\mathit{D}}_{\mathrm{3}}$ Equals / Does not equal. D_1 (: D_2 (:= D_3 (:_ D_4 ${\mathit{D}}_{\mathrm{1}}\subset {\mathit{D}}_{\mathrm{2}}⫅{\mathit{D}}_{\mathrm{3}}\subseteq {\mathit{D}}_{\mathrm{4}}$ Subset[31] D_1 :) D_2 :)= D_3 :)_ D_4 ${\mathit{D}}_{\mathrm{1}}\supset {\mathit{D}}_{\mathrm{2}}⫆{\mathit{D}}_{\mathrm{3}}\supseteq {\mathit{D}}_{\mathrm{4}}$ Superset[31] D_1 (:/= D_2 (:/_ D_3 ${\mathit{D}}_{\mathrm{1}}⫋{\mathit{D}}_{\mathrm{2}}⊊{\mathit{D}}_{\mathrm{3}}$ Proper subset[31] D_1 :)/= D_2 :)/_ D_3 ${\mathit{D}}_{\mathrm{1}}⫌{\mathit{D}}_{\mathrm{2}}⊋{\mathit{D}}_{\mathrm{3}}$ Proper superset[31] D_1 /(: D_2 /(:_ D_3 ${\mathit{D}}_{\mathrm{1}}\not\subset {\mathit{D}}_{\mathrm{2}}⊈{\mathit{D}}_{\mathrm{3}}$ Not subset[31] D_1 /:) D_2 /:)_ D_3 ${\mathit{D}}_{\mathrm{1}}\not\supset {\mathit{D}}_{\mathrm{2}}⊉{\mathit{D}}_{\mathrm{3}}$ Not superset[31] Notes  [31] (1, 2, 3, 4, 5, 6) Sub- / superset relational operators can only be computed if the super is finite #### Vectors Vector Construction Source Display Description / Comment [x_1, x_2, ..., x_n] $\left[{\mathit{x}}_{\mathrm{1}},{\mathit{x}}_{\mathrm{2}},\mathrm{\dots },{\mathit{x}}_{\mathit{n}}\right]$ Coordinates (${\mathit{x}}_{\mathit{i}}\in \mathbb{R}\vee {\mathit{x}}_{\mathit{i}}\in \mathbb{C}$) [listComprehension] Vector constructed by List comprehension Vector Operations Source Display Description / Comment $size !v
$\mathrm{size}\mathbit{v}$
Size of a vector $\mathbit{v}$
( !v )_i
${\left(\mathbit{v}\right)}_{\mathit{i}}$
Coordinate access
!v + !w
$\mathbit{v}+\mathbit{w}$
!v - !w
$\mathbit{v}-\mathbit{w}$
Subtraction
c !v
$\mathit{c}\mathbit{v}$
Scalar multiplication
!v * !w
$\mathbit{v}\cdot \mathbit{w}$
Dot product (scalar product)

#### Matrices

Matrix Construction
Source Display Description / Comment
[a # b ## c # d]
$\left[\begin{array}{cc}\mathit{a}& \mathit{b}\\ \mathit{c}& \mathit{d}\end{array}\right]$
Grid construction
(a # b ## c # d)
$\left(\begin{array}{cc}\mathit{a}& \mathit{b}\\ \mathit{c}& \mathit{d}\end{array}\right)$
Grid construction (alternative notation)[32]
[x # y # z]
$\left[\begin{array}{ccc}\mathit{x}& \mathit{y}& \mathit{z}\end{array}\right]$
Row vector[33]
[x ## y ## z]
$\left[\begin{array}{c}\mathit{x}\\ \mathit{y}\\ \mathit{z}\end{array}\right]$
Column vector[33]
$!0_{n,m} ${\mathbf{0}}_{\mathit{n},\mathit{m}}$ $\mathit{n}×\mathit{m}$ Zero Matrix $I_n
${\mathrm{I}}_{\mathit{n}}$
$\mathit{n}×\mathit{n}$ Identity Matrix
$I(n) $\mathrm{I}\left(\mathit{n}\right)$ $\mathit{n}×\mathit{n}$ Identity Matrix (alternative notation) $J_n
${\mathrm{J}}_{\mathit{n}}$
$\mathit{n}×\mathit{n}$ Unit Matrix (“matrix of ones”)
$J_{n,m} ${\mathrm{J}}_{\mathit{n},\mathit{m}}$ $\mathit{n}×\mathit{m}$ Unit Matrix (“matrix of ones”) Notes  [32] Do not use this notation for 2 × 1 matrices as $\left(\begin{array}{c}\mathit{x}\\ \mathit{y}\end{array}\right)$ means the binomial coefficient, not a Matrix!  [33] (1, 2) Despite the name, row vectors and column vectors are not Vectors, but 1 × $\mathit{m}$ ($\mathit{n}$ × 1) Matrices! Matrix Operations Source Display Description / Comment $size A
$\mathrm{size}\mathit{A}$
Size of a Matrix $\mathit{A}$, returned as a pair $\left(\mathit{m},\mathit{n}\right)$
( A )_{i,j}
${\left(\mathit{A}\right)}_{\mathit{i},\mathit{j}}$
Entry extraction: get entry of Matrix $\mathit{A}$ in row $\mathit{i}$, column $\mathit{j}$
A + B
$\mathit{A}+\mathit{B}$
A - B
$\mathit{A}-\mathit{B}$
Subtraction
c A
$\mathit{c}\mathit{A}$
Scalar multiplication
A B
$\mathit{A}\mathit{B}$
Matrix multiplication
{| a # b ## c # d |}
$\left|\begin{array}{cc}\mathit{a}& \mathit{b}\\ \mathit{c}& \mathit{d}\end{array}\right|$
Determinant
$det A $\mathrm{det}\mathit{A}$ Determinant (alternative notation) A^{-1} ${\mathit{A}}^{-\mathrm{1}}$ Inverse of a square matrix (if invertable) A^n ${\mathit{A}}^{\mathit{n}}$ Matrix exponentiation ($\mathit{n}\in \mathbb{Z}$) $transpose(A)
$\mathrm{transpose}\left(\mathit{A}\right)$
Transpose a matrix
$conj(A) $\mathrm{conj}\left(\mathit{A}\right)$ Complex conjugate of a matrix ### Functions (Morphisms) Function construction Source Display Description / Comment f: D --> C, x |--> expr $\mathit{f}:\mathit{D}⟶\mathit{C},\mathit{x}⟼\mathit{expr}$ Function declaration, single argument. $\mathit{expr}$ is a defining expression. f: D --> C, (x,y) |--> expr $\mathit{f}:\mathit{D}⟶\mathit{C},\left(\mathit{x},\mathit{y}\right)⟼\mathit{expr}$ Function declaration, two arguments[34] f: D -) args |--> expr (- C $\mathit{f}:\mathit{D}\ni \mathit{args}⟼\mathit{expr}\in \mathit{C}$ Function declaration, alternative form (f: D --> C, args |--> expr) $\left(\mathit{f}:\mathit{D}⟶\mathit{C},\mathit{args}⟼\mathit{expr}\right)$ Named Function expression (f: D -) args |--> expr (- C) $\left(\mathit{f}:\mathit{D}\ni \mathit{args}⟼\mathit{expr}\in \mathit{C}\right)$ Named Function expression (alternative form) (D -) args |--> expr (- C) $\left(\mathit{D}\ni \mathit{args}⟼\mathit{expr}\in \mathit{C}\right)$ Anonymous Function expression f .. g $\mathit{f}\circ \mathit{g}$ Composition of functions $id_S
${\mathrm{id}}_{\mathit{S}}$
Identity function (on $\mathit{S}$)
$\iota_{S, T} ${\mathrm{\iota }}_{\mathit{S},\mathit{T}}$ Inclusion function (for $\mathit{S}\subset \mathit{T}$) Notes  [34] Actually all functions have a single argument. “Multiple” arguments work by passing a Tuple to the function. Function Operations Source Display Description / Comment f(x), f(x,y) $\mathit{f}\left(\mathit{x}\right),\mathit{f}\left(\mathit{x},\mathit{y}\right)$ Function invocation $dom f
$\mathrm{dom}\mathit{f}$
Domain of function
$cod f $\mathrm{cod}\mathit{f}$ Codomain of function $ran f
$\mathrm{ran}\mathit{f}$
Range of a function (computable for finite domain only)

### Formulas

Executable operators
Source Display Description / Comment
x = expr
$\mathit{x}=\mathit{expr}$
Assignment of a Variable ($\mathit{x}$) to the value of an expression $\mathit{expr}$
x_n = expr
${\mathit{x}}_{\mathit{n}}=\mathit{expr}$
Assignment of a Slot of an indexed Variable (${\mathit{x}}_{\mathrm{⬚}}$)
x_1 = x_2 = expr
${\mathit{x}}_{\mathrm{1}}={\mathit{x}}_{\mathrm{2}}=\mathit{expr}$
Multiple Assignment
a = 1 => x = expr
$\mathit{a}=\mathrm{1}⇒\mathit{x}=\mathit{expr}$
Conditional
x_1 = 1; x_2 = 2; x_3 = 3
${\mathit{x}}_{\mathrm{1}}=\mathrm{1};{\mathit{x}}_{\mathrm{2}}=\mathrm{2};{\mathit{x}}_{\mathrm{3}}=\mathrm{3}$
Multiple executable expressions
a_i = expr | i = 1,...,n
${\mathit{a}}_{\mathit{i}}=\mathit{expr}|\mathit{i}=\mathrm{1},\mathrm{\dots },\mathit{n}$
For each value of $\mathit{i}$ (local Variable), do assignment
a_i := expr : i (- %N
${\mathit{a}}_{\mathit{i}}≔\mathit{expr}:\mathit{i}\in \mathbb{N}$
Definition of a value (delayed evaluation / assignment)
(x_1,x_2,x_3) = expr
$\left({\mathit{x}}_{\mathrm{1}},{\mathit{x}}_{\mathrm{2}},{\mathit{x}}_{\mathrm{3}}\right)=\mathit{expr}$
Destructuring assignment

### Miscellaneous

Other forms
Source Display Description / Comment
{{0 # i(-{{0,1}} ## x_{i-1} + x_{i-2} # i>1}
$\left\{\begin{array}{ll}\mathrm{0}& \mathit{i}\in \left\{\mathrm{0},\mathrm{1}\right\}\\ {\mathit{x}}_{\mathit{i}-\mathrm{1}}+{\mathit{x}}_{\mathit{i}-\mathrm{2}}& \mathit{i}>\mathrm{1}\end{array}\right\$
Piecewise (switch)
{{0 # i(-{{0,1}} ## x_{i-1} + x_{i-2} # i>1)
$\left\{\begin{array}{ll}\mathrm{0}& \mathit{i}\in \left\{\mathrm{0},\mathrm{1}\right\}\\ {\mathit{x}}_{\mathit{i}-\mathrm{1}}+{\mathit{x}}_{\mathit{i}-\mathrm{2}}& \mathit{i}>\mathrm{1}\end{array}\right\)$
Piecewise (switch) with optional closing parenthesis