Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| learning:tla_summary [2024/09/28 15:58] – created - external edit 127.0.0.1 | learning:tla_summary [2025/08/20 10:20] (current) – fponzi | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| ---- | ---- | ||
| + | ====== Module-Level Constructs ====== | ||
| - | ====== | + | ^ Construct ^ Description ^ |
| + | | **module M** | Begins the module or submodule named //M//. | | ||
| + | | **extends M1, ..., Mn** | Incorporates the declarations, | ||
| + | | **constants C1, ..., Cn** | Declares the Cj to be constant parameters (rigid variables). Each Cj is either an identifier or has the form C(-,...,-), the latter form indicating that C is an operator with the indicated number of arguments. | | ||
| + | | **variables x1, ..., xn** | Declares the xj to be variables (parameters that are flexible variables). | | ||
| + | | **assume P** | Asserts P as an assumption. | | ||
| + | | **F(x1, ..., xn) == exp** | Defines F to be the operator such that F(e1, | ||
| + | | **f[x ∈ S] == exp** | Defines f to be the function with domain S such that f[x] = exp for all x in S. (The symbol f may occur in exp, allowing a recursive definition.) | | ||
| + | | **instance M with p1 <- e1, ..., pm <- em** | For each defined operator F of module M, this defines F to be the operator whose definition is obtained from the definition of F in M by replacing each declared constant or variable pj of M with ej. (If m = 0, the ' | ||
| + | | **N(x1, ..., xn) == instance M with p1 <- e1, ..., pm <- em** | For each defined operator F of module M, this defines N(d1, | ||
| + | | **theorem P** | Asserts that P can be proved from the definitions and assumptions of the current module. | | ||
| + | | **local def** | Makes the definition(s) of def (which may be a definition or an instance statement) local to the current module, thereby not obtained when extending or instantiating the module. | | ||
| + | | **====** | Ends the current module or submodule. | | ||
| - | * Module-Level Constructs | + | ---- |
| - | * The Constant Operators | + | |
| - | * Miscellaneous Constructs | + | |
| - | * Action Operators | + | |
| - | * Temporal Operators | + | |
| - | * User-Definable Operator Symbols | + | |
| - | * Precedence Ranges of Operators | + | |
| - | * Operators Defined in Standard Modules. | + | |
| - | * ASCII Representation of Typeset Symbols 1 | + | |
| - | ===== Module-Level Constructs | + | ====== The Constant Operators ====== |
| - | ===== \Gamma ===== | + | ^ Category ^ Operators ^ |
| + | | **Logic** | /\\ , \\/ , ~ , => , <=> , TRUE, FALSE, BOOLEAN, ∀, ∃, CHOOSE | | ||
| + | | **Sets** | = , # , ∈ , /∈ , ∪ , ∩ , ⊆ , \\ , {..}, SUBSET, UNION | | ||
| + | | **Functions** | f[e], DOMAIN f, [x ∈ S |-> e], [S -> T], [f EXCEPT ![e1] = e2] | | ||
| + | | **Records** | e.h, [h1 |-> e1, ...], [h1: S1, ...], [r EXCEPT !.h = e] | | ||
| + | | **Tuples** | e[i], << | ||
| - | MODULE $M$Begins the module or submodule named $M$. | + | ---- |
| - | EXTENDS $M_{1}, \ldots, M_{n}$ | + | ====== Miscellaneous Constructs ====== |
| - | Incorporates the declarations, definitions, assumptions, | + | ^ Construct ^ Description ^ |
| + | | **IF p THEN e1 ELSE e2** | Conditional expression: e1 if p is true, else e2. | | ||
| + | | **CASE p1 -> e1 [] ... [] pn -> en** | Some ei such that pi is true. | | ||
| + | | **CASE ... [] OTHER -> e** | Some ei such that pi is true, or e if all pi are false. | | ||
| + | | **LET d1 == e1 ... dn == en IN e** | e in the context of the definitions. | | ||
| + | | **/\\ p1 ... pn** | Conjunction p1 /\\ ... /\\ pn. | | ||
| + | | **\\/ p1 ... pn** | Disjunction p1 \\/ ... \\/ pn. | | ||
| - | CONSTANTS $C_{1}, \ldots, C_{n}^{(1)}$ | + | ---- |
| - | Declares the $C_{j}$ to be constant parameters (rigid variables). Each $C_{j}$ is either an identifier or has the form $C\left(\_, \ldots, \_\right)$, the latter form indicating that $C$ is an operator with the indicated number of arguments. | + | ====== Action Operators ====== |
| - | $$ | + | ^ Operator ^ Description ^ |
| - | \text { VARIABLES } x_{1}, \ldots, x_{n}^{(1)} | + | | **e'** | The value of e in the final state of a step. | |
| - | $$ | + | | **[A]_e** | A ∨ (e' = e). | |
| + | | **< | ||
| + | | **ENABLED A** | An A step is possible. | | ||
| + | | **UNCHANGED e** | e' = e. | | ||
| + | | **A · B** | Composition of actions. | | ||
| - | Declares the $x_{j}$ to be variables (parameters that are flexible variables). | + | ---- |
| - | ===== ASSUME P ===== | + | ====== Temporal Operators ====== |
| - | Asserts $P$ as an assumption. | + | ^ Operator ^ Meaning ^ |
| + | | **[]F** | F is always true. | | ||
| + | | **<> | ||
| + | | **WF_e(A)** | Weak fairness for action A. | | ||
| + | | **SF_e(A)** | Strong fairness for action A. | | ||
| + | | **F ~> G** | F leads to G. | | ||
| - | $F\left(x_{1}, | + | ---- |
| - | Defines $F$ to be the operator such that $F\left(e_{1}, | + | ====== Standard Modules ====== |
| - | $f[x \in S] \triangleq \exp ^{(2)}$ | + | ^ Module ^ Operators ^ |
| + | | **Naturals, Integers, Reals** | + , - , * , / , ^ , .. , div , % , ≤ , ≥ , < , > , Infinity | | ||
| + | | **Sequences** | o , Head , Tail , Append , Len , Seq , SelectSeq , SubSeq | | ||
| + | | **FiniteSets** | IsFiniteSet , Cardinality | | ||
| + | | **Bags** | ⊕ , BagIn , CopiesIn , SubBag , BagOfAll , EmptyBag , BagToSet , IsABag , BagCardinality , BagUnion , SetToBag | | ||
| + | | **RealTime** | RTBound , RTnow , now | | ||
| + | | **TLC** | :> , @@ , Print , Assert , JavaTime , Permutations , SortSeq | | ||
| - | Defines $f$ to be the function with domain $S$ such that $f[x]=\exp$ for all $x$ in $S$. (The symbol $f$ may occur in exp, allowing a recursive definition.) | + | ---- |
| - | - The terminal S in the keyword is optional. | + | ====== ASCII Equivalents ====== |
| - | - $x \in S$ may be replaced by a comma-separated list of items $v \in S$, where $v$ is either a comma-separated list or a tuple of identifiers. | + | |
| - | INSTANCE $M$ WITH $p_{1} | + | ^ Symbol ^ ASCII ^ |
| + | | ∧ | /\\ or \\land | | ||
| + | | ∨ | \\/ or \\lor | | ||
| + | | ¬ | ~ or \\lnot | | ||
| + | | = | = | | ||
| + | | ≠ | # or /= | | ||
| + | | ∈ | \\in | | ||
| + | | /∈ | \\notin | | ||
| + | | ⊆ | \\subseteq | | ||
| + | | ⊂ | \\subset | | ||
| + | | ⊇ | \\supseteq | | ||
| + | | ⊃ | \\supset | | ||
| + | | -> | -> | | ||
| + | | <- | <- | | ||
| + | | [] | [] | | ||
| + | | <> | <> | | ||
| + | | |-> | |-> | | ||
| + | | × | \\X or × | | ||
| + | | · | \\cdot | | ||
| + | | ○ | \\circ | | ||
| + | | • | \\bullet | | ||
| - | For each defined operator $F$ of module $M$, this defines $F$ to be the operator whose definition is obtained from the definition of $F$ in $M$ by replacing each declared constant or variable $p_{j}$ of $M$ with $e_{j}$. (If $m=0$, the WITH is omitted.) $N\left(x_{1}, | + | ---- |
| - | + | ||
| - | For each defined operator $F$ of module $M$, this defines $N\left(d_{1}, | + | |
| - | + | ||
| - | THEOREM $P$ | + | |
| - | + | ||
| - | Asserts that $P$ can be proved from the definitions and assumptions of the current module. | + | |
| - | + | ||
| - | LOCAL def | + | |
| - | + | ||
| - | Makes the definition(s) of def (which may be a definition or an INSTANCE statement) local to the current module, thereby not obtained when extending or instantiating the module. | + | |
| - | + | ||
| - | Ends the current module or submodule. | + | |
| - | + | ||
| - | ===== The Constant Operators ===== | + | |
| - | + | ||
| - | {{https:// | + | |
| - | + | ||
| - | ===== Sets ===== | + | |
| - | + | ||
| - | $=\neq \in \cup$. | + | |
| - | + | ||
| - | $\left\{e_{1}, | + | |
| - | + | ||
| - | $\{x \in S: p\}$ (2) [Set of elements $x$ in $S$ satisfying $p$ ] | + | |
| - | + | ||
| - | $\{e: x \in S\}^{(1)} \quad$ [Set of elements $e$ such that $x$ in $\left.S\right]$ | + | |
| - | + | ||
| - | SUBSET $S \quad$ [Set of subsets of $S$ ] | + | |
| - | + | ||
| - | UNION $S \quad[$ Union of all elements of $S]$ | + | |
| - | + | ||
| - | ===== Functions ===== | + | |
| - | + | ||
| - | $$ | + | |
| - | \begin{array}{ll} | + | |
| - | f[e] & {[\text { Function application] }} \\ | + | |
| - | \text { DOMAIN } f & {[\text { Domain of function } f]} \\ | + | |
| - | {[x \in S \mapsto e]{ }^{(1)}} & {[\text { Function } f \text { such that } f[x]=e \text { for } x \in S]} \\ | + | |
| - | {[S \rightarrow T]} & {[\text { Set of functions } f \text { with } f[x] \in T \text { for } x \in} \\ | + | |
| - | {\left[f \text { EXCEPT }!\left[e_{1}\right]=e_{2}\right]^{(3)}} & {\left[\text { Function } \widehat{f} \text { equal to } f \text { except } \widehat{f}\left[e_{1}\right]=e_{2}\right]} | + | |
| - | \end{array} | + | |
| - | $$ | + | |
| - | + | ||
| - | ===== Records ===== | + | |
| - | + | ||
| - | $\begin{array}{ll}e . h & \text { [The } h \text {-field of record } e] \\ {\left[h_{1} \mapsto e_{1}, \ldots, h_{n} \mapsto e_{n}\right]} & \left.\text { [The record whose } h_{i} \text { field is } e_{i}\right] \\ {\left[h_{1}: | + | |
| - | + | ||
| - | ===== Tuples ===== | + | |
| - | + | ||
| - | $$ | + | |
| - | \begin{array}{ll} | + | |
| - | e[i] & {\left[\text { The } i^{\text {th }} \text { component of tuple } e\right]} \\ | + | |
| - | \left\langle e_{1}, \ldots, e_{n}\right\rangle & {\left[\text { The } n \text {-tuple whose } i^{\text {th }} \text { component is } e_{i}\right]} \\ | + | |
| - | S_{1} \times \ldots \times S_{n} & \text { [The set of all } \left.n \text {-tuples with } i^{\text {th }} \text { component in } S_{i}\right] | + | |
| - | \end{array} | + | |
| - | $$ | + | |
| - | + | ||
| - | - $x \in S$ may be replaced by a comma-separated list of items $v \in S$, where $v$ is either a comma-separated list or a tuple of identifiers | + | |
| - | - $x$ may be an identifier or tuple of identifiers. | + | |
| - | + | ||
| - | (3)! $\left[e_{1}\right]$ or !.h may be replaced by a comma separated list of items $!a_{1} \cdots a_{n}$, where each $a_{i}$ is $\left[e_{i}\right]$ or.$h_{i}$. | + | |
| - | + | ||
| - | ===== Miscellaneous Constructs ===== | + | |
| - | + | ||
| - | {{https:// | + | |
| - | + | ||
| - | ===== Action Operators ===== | + | |
| - | + | ||
| - | ^$e^{\prime}$ | + | |
| - | |$[A]_{e}$ | + | |
| - | |$\langle A\rangle_{e}$ | + | |
| - | |ENABLED $A$ |$[$ An step is possible $]$ | | + | |
| - | |UNCHANGED $e$ | + | |
| - | |$A \cdot B$ |$[$ Composition of actions $]$ | | + | |
| - | + | ||
| - | ===== Temporal Operators ===== | + | |
| - | + | ||
| - | $$ | + | |
| - | \begin{array}{ll} | + | |
| - | \square F & {[F \text { is always true }]} \\ | + | |
| - | \diamond F & {[F \text { is eventually true }]} \\ | + | |
| - | \mathrm{WF}_{e}(A) & {[\text { Weak fairness for action } A]} \\ | + | |
| - | \mathrm{SF}_{e}(A) & {[\text { Strong fairness for action } A]} \\ | + | |
| - | F \sim G & {[F \text { leads to } G]} | + | |
| - | \end{array} | + | |
| - | $$ | + | |
| - | + | ||
| - | ===== User-Definable Operator Symbols ===== | + | |
| - | + | ||
| - | ===== Infix Operators ===== | + | |
| - | + | ||
| - | ^$+^{(1)}$ | + | |
| - | |$\div^{(1)}$ | + | |
| - | |$\oplus^{(5)}$ | + | |
| - | |(1) $^{(1)}$ | + | |
| - | |$\prec$ | + | |
| - | |$\ll$ | + | |
| - | |$\sqsubset$ | + | |
| - | |$\subset$ | + | |
| - | |$\vdash$ | + | |
| - | |$\sim$ | + | |
| - | |$\bigcirc$ | + | |
| - | |$\propto$ | + | |
| - | + | ||
| - | Postfix Operators (7) | + | |
| - | + | ||
| - | $\sim \quad$ - $#$ | + | |
| - | + | ||
| - | - Defined by the Naturals, Integers, and Reals modules. | + | |
| - | - Defined by the Reals module. | + | |
| - | - Defined by the Sequences module. | + | |
| - | - $x^{\wedge} y$ is printed as $x^{y}$. | + | |
| - | - Defined by the Bags module. | + | |
| - | - Defined by the $T L C$ module. | + | |
| - | - $e^{\wedge}+$ is printed as $e^{+}$, and similarly for ${ }^{\wedge} *$ and $\wedge \#$. | + | |
| - | + | ||
| - | ===== Precedence Ranges of Operators ===== | + | |
| - | + | ||
| - | The relative precedence of two operators is unspecified if their ranges overlap. Left-associative operators are indicated by (a). | + | |
| - | + | ||
| - | {{https:// | + | |
| - | - Record field (period). | + | |
| - | )) | + | |
| - | + | ||
| - | ===== Operators Defined in Standard Modules. ===== | + | |
| - | + | ||
| - | Modules Naturals, Integers, Reals | + | |
| - | + | ||
| - | $$ | + | |
| - | \begin{aligned} | + | |
| - | & +\quad-{ }^{(1)} \quad * \quad /^{(2)} \quad \sim^{-(3)} \quad \text {.. } \quad \text { Nat } \quad \text { Real }^{(2)} \\ | + | |
| - | & \div \quad \% \quad \geq \quad> | + | |
| - | \end{aligned} | + | |
| - | $$ | + | |
| - | + | ||
| - | - Only infix - is defined in Naturals. | + | |
| - | - Defined only in Reals module. | + | |
| - | - Exponentiation. | + | |
| - | - Not defined in Naturals module. | + | |
| - | + | ||
| - | Module Sequences | + | |
| - | + | ||
| - | ^$\circ$ | + | |
| - | |Append | + | |
| - | + | ||
| - | ===== Module FiniteSets | + | |
| - | + | ||
| - | Module Bags | + | |
| - | + | ||
| - | ^$\oplus$ | + | |
| - | |$\ominus$ | + | |
| - | |$\sqsubseteq$ | + | |
| - | |BagCardinality | + | |
| - | + | ||
| - | Module RealTime | + | |
| - | + | ||
| - | RTBound RTnow now (declared to be a variable) | + | |
| - | + | ||
| - | Module $T L C$ | + | |
| - | + | ||
| - | $:>$ Print Assert JavaTime Permutations SortSeq | + | |
| - | + | ||
| - | ===== ASCII Representation of Typeset Symbols ===== | + | |
| - | + | ||
| - | ^ $/$ or $\backslash]$ | + | |
| - | | $\sim$ or $\backslash \operatorname{lr}$ | + | |
| - | | | | $\notin$ | + | |
| - | | $<< | + | |
| - | | $< | + | |
| - | | | + | |
| - | | | | $\gg$ | | + | |
| - | | | | | + | |
| - | | | | $\succeq$ | + | |
| - | | | | | + | |
| - | | | | $\supset$ | + | |
| - | | | | | + | |
| - | | | eteq | $\sqsupseteq$ | + | |
| - | | $1-$ | | $\dashv$ | + | |
| - | | $\mid=$ | + | |
| - | | | + | |
| - | | | + | |
| - | | | | $\sqcup$ | + | |
| - | | $(+)$ or 1 | + | |
| - | | $(-)$ or 1 | + | |
| - | | (.) or 1 | | 2 | | + | |
| - | | $(\backslash X)$ or | + | |
| - | | (/) or 1 | | | + | |
| - | | | + | |
| - | | $\backslash \mathrm{EE}$ | + | |
| - | | ]_v | + | |
| - | | $W F_{-} v$ | + | |
| - | + | ||
| - | - $s$ is a sequence of characters. | + | |
| - | - $x$ and $y$ are any expressions. | + | |
| - | - a sequence of four or more - or $=$ characters. | + | |