latex
Formal methods reference
Variable Names
Concept | Math | LaTeX | Notes |
Sets | A,B,C |
| upper-case letters |
Indexed sets | A1, A2, …, An |
| the index may be of any type, not nec. an integer |
Statements | P, Q, R, S |
| |
Statements with variables | P(x), Q(x), R(x), S(x) |
|
Set Theory
Concept | Math | LaTeX | Notes |
Set | {a,b,c} |
| set enumeration |
Set | {x∣P(x)} or {x:P(X)} |
| set comprehension (described implicitly with the property P) aka set-builder notation |
Infinite set | {1, 2, 3, …} |
| and so on |
Infinite set | {…, 1, 2, 3, …} |
| and so on |
Empty set | ∅ or {} |
| |
Powerset | P(S) |
| set of all possible subsets of set S, |P(S)| = 2^|S| |
Member | x∈A |
| |
Not member | x∉A |
| |
Subset | A⊂B or A⊆B |
| |
Not subset | A⊄B or A⊈B |
| |
Set equality | A=B |
| A⊆B and B⊆A |
Union | A∪B |
| |
Intersection | A∩B |
| |
Distributed or generalized union | ⋃SS |
| over set of sets |
Distributed or generalized intersection | ⋂SS |
| over set of sets |
Relative complement | A−B or A∖B |
| {x∣x∈A and x∉B} |
Absolute complement | A+B |
| (A−B)∪(B−A)(A−B)∪(B−A) |
Disjoint sets | A∩B = ∅ | ||
Set cardinality (aka size) | card(S) or |S| |
| number of members of S |
Boolean set | B or {true,false} or {tt,ff} or {1,0} |
| |
Natural numbers set | N or N+ |
| N+ = N∖{0} |
Integer numbers set | Z |
| |
Rational numbers set | Q |
| a/b, a - numerator, b - denominator, b≠0 |
Real numbers set | R |
| |
Set of prime numbers | N |
| |
Set of irrational numbers | II |
| |
Set of complex numbers | CC |
|
Cartesian Products
Concept | Math | LaTeX | Notes |
Ordered Pair | (a,b) |
| |
Triple | (a,b,c) |
| |
N-tuple | (e1,…,en) |
| |
Cartesian product | A×B |
| {(a,b)∣a∈A,b∈B} |
Cartesian plane | R×R |
| {(x,y)∣x,y∈R} |
Cartesian power | An |
| A×A×…×A={x1,x2,…,xn|x1,x2,…,xn∈A} |
Types
Concept | Math | LaTeX | Notes |
User defined type | DEFINEDTYPE={2,4,8} |
| a set defined explicitly, or by set comprehension |
Product type | B×B |
| a set of tuples (here, {(tt,tt),(tt,ff),(ff,ff),(ff,tt)}) |
Two-argument function signature | func:R×N→N |
| type of arguments is product type |
Enumerated type | signal=r | y | g |
| type union of literals |
Mathematical Operators
Concept | Math | LaTeX | Notes |
Absolute operator | abs −20=20 |
| unary |
Floor/integer part operator | floor 2.5=2 |
| unary |
Integer division operator | 5 div 2=2 |
| binary |
Remainder operator | 5 rem −2=1 |
| binary |
Modulus operator | 5 mod −2=−1 |
| binary |
Equality | a=b |
| binary |
Inequality | a≠b |
| binary |
Less than | a>b |
| binary |
Less than or equal | a≥b |
| binary |
More than | a<b |
| binary |
More than or equal | a≤b |
| binary |
Bags
Concept | Math | LaTeX | Notes |
Bag | [[a,b,b,c,d]] |
| Members can repeat, unordered, also |
Count operator | count[[a,b,b,c,d]]b=2 |
| How many times element bb occurs in bag |
Bag cardinality | card(B) |
| Number of members of B |
Bag union (1) | [[a,b,b,c,d]]∪[[a,b,c,c,d]]=[[a,b,b,c,c,d]] |
| Maximum number an element occurs |
Bag union (2) | [[a,b,b,c,d]]∪[[a,b,c,c,d]]=[[a,a,b,b,b,c,c,c,d,c]] |
| Sum of elements |
Bag intersection | [[a,b,b,c,d]]∩[[a,b,c,c,d]]=[[a,b,c,d]] |
| Minimum number an element occurs |
Bag difference | [[a,b,b,c,d]]−[[a,b,c,c,d]]=[[b,c]] |
| Subtract the number of elements in the second bag from the first |
Sequences
Concept | Math | LaTeX | Notes |
Empty sequence | [] | [] | |
Sequence (explicit declaration) | [a,b,b,d] |
| In that order. This is the typical representation. |
Sequence (implicit declaration) | [e∣P(e)] |
| Set comprehension (described implicitly with the property P) |
Head of a sequence | hd A |
| hd [a,b,b,c]=a |
Tail of a sequence | tl A |
| tl [a,b,b,c]=[b,b,c] |
Length of a sequence | len A |
| len [a,b,b,c]=4 |
Element selection (by application) | A(n) |
| Select the nn-th element of the sequence |
Indices of a sequence | inds A |
| inds [a,b,c]={1,2,3} |
Elements of a sequence | elems A |
| elems [a,b,b,c]={a,b,c} |
Sequence concatenation | Symbol varies between notations | ||
List | <a,b,c> or (a,b,c) or abc |
| An alternative notation and naming used by some formal notations |
Empty list | () |
|
Formal Logic
Concept | Math | LaTeX | Notes |
Conjunction (AND) | ∧or & or . |
| Alternatively |
Alternative (OR) | ∨or |or + |
| |
Negation (NOT) | ¬ or ∼ |
| |
Implication | →or ⇒ or ⊃ |
| premise→conclussion |
Equivalence | ↔or ⇔ or ≡ |
|
Equivalence Laws
Concept | Math | LaTeX | Notes |
Commutation (conjunctions) | (P∧Q) ≡ (Q∧P) |
| |
Commutation (alternatives) | (P∨Q) ≡ (Q∨P) |
| |
Commutation (equivalences) | (P↔Q) ≡ (Q↔P) |
| |
Association (conjunctions) | P∧(Q∧R) ≡ (P∧Q)∧R |
| |
Association (alternatives) | P∨(Q∨R) ≡ (P∨Q)∨R |
| |
Distribution (1) | P∨(Q∧R) ≡ (P∨Q)∧(P∨R) |
| |
Distribution (2) | P∧(Q∨R) ≡ (P∧Q)∨(P∧R) |
| |
De Morgan’s Law (negation of conjunction) | ¬(P∧Q) ≡ ¬P∨¬Q |
| |
De Morgan’s Law (negation of alternative) | ¬(P∨Q) ≡ ¬P∧¬Q |
| |
Double Negation | ¬¬P ≡ P |
| |
Excluded Middle | P∨¬P ≡ tt |
| |
Contradiction | P∧¬P ≡ ff |
| |
Material Implication | P→Q ≡ ¬P∨Q |
| |
Material Equivalence (1) | (P↔Q) ≡ (P→Q)∧(Q→P) |
| |
Material Equivalence (2) | (P↔Q) ≡ (P∧Q)∨(¬Q∧¬P) |
| |
Exportation | (P∧Q)→R ≡ P→(Q→R) |
| |
Or-Simplification | P∨P ≡ P |
| |
Or-Simplification (true) | P∨tt ≡ tt |
| |
Or-Simplification (false) | P∨ff ≡ P |
| |
And-Simplification | P∧P ≡ P |
| |
And-Simplification (true) | P∧tt ≡ P |
| |
And-Simplification (false) | P∧ff ≡ ff |
|
Logic Forms
Concept | Math | LaTeX | Notes |
Modus Ponens | P→Q, P ⊢ Q |
| Andrew Harry uses |
Modus Tollens | P→Q, ¬Q ⊢ ¬P |
| |
Hypothetical Syllogism | P→Q, Q→R ⊢ P→R |
| |
Constructive Dillema | P→Q∧R→S, P∨R ⊢ Q∨S |
| |
Destructive Dillema | P→Q∧R→S, ¬Q∨¬S ⊢ ¬P∨¬R |
| |
Conjunction | P, Q ⊢ P∧Q |
| |
Addition | P ⊢ P∨Q |
|
Predicate Logic
Concept | Math | LaTeX | Notes |
Universal qualifier (all) | ∀x |
| |
Universal specification | ∀x∙Px |
| ∀x∙man(x)→mortal(x) |
Existential qualifier (exists) | ∃x |
| |
Existential specification | ∃x∙Px |
| ∃x∙Socrates(x)∧man(x)∃x∙Socrates(x)∧man(x) |
Ranging over types (1) | ∀x∈X or ∀x:X |
| The former suggests X is a set, the latter that it is a type |
Ranging over types (2) | ∃x∈X or ∃x:X |
| The former suggests X is a set, the latter that it is a type |
Covnersion between qualifiers (1) | ∀x∙Px ≡ ¬∃x∙¬Px |
| Alternatively ∄x |
Covnersion between qualifiers (2) | ¬∀x∙Px ≡ ∃x∙¬Px |
| |
Covnersion between qualifiers (3) | ¬∀x∙¬Px ≡ ∃x∙Px |
| |
Covnersion between qualifiers (4) | ∀x∙¬Px ≡ ¬∃x∙Px |
| Alternatively ∄x |
Relationships and Functions
Concept | Math | LaTeX | Notes |
A mapping | x↦y or (x,y) |
| |
Function signiature | f: X→Y |
| Mapping from X (domain) to Y (co-domain). What is allowed to be in X, Y is described by the precondition, postcondition. |
Function definition | square(x)=x2 where 1≤x≤5 |
| |
Function defined as co-ordinates | square={(1,2),(2,4),(3,9),(4,16),(5,25)} |
| The set of right coordinates (here {2,4,9,16,25}) is the range of a function |
Range | range(f) |
| range({(1,a),(2,b),(3,c)})={a,b,c} |
Partial function signiature | f: X↛ Y |
| Not all elements from X are mapped to elements from Y |
Transactional Memory
Concept | Math | LaTeX | Notes |
History | H |
| |
Sequential witness history | S or S^ |
| |
Completion | |||
T-objects | |||
Transaction | Ti, Tj, Tk |
| |
Subhistory – transaction | H|Ti |
| A subhistory containing all operations in history HH that are executed within transaction TiTi |
Subhistory – t-object | H|x |
| A subhistory containing all operations in history HH that are executed on t-object xx |
History prefix | H=H′∘H′ |
| H′H′ is a prefix of H′′H″ |
Commit | |||
Abort | |||
Forced abort | |||
Read | |||
Write | |||
Operation | π |
|
Notation for Presenting Histories
Concept | Math | LaTeX | Notes |
Variables | x, y, z |
| |
Variable local copy or buffer | x_ |
| Transaction’s copy of x |
Variable versioning | xn |
| Variable x with version n |
Transaction identifiers | Ti, Tj, Tk |
| |
Retried transaction identifiers | T′i, T′′i, T′′′i |
| Transaction Ti‘s first, second, etc. retry |
Read operation | r(x)v |
| Reads value vv from variable xx, can be used with specific values, e.g., r(x)1 |
Write operation | w(x)v |
| Writes value vv to variable xx, can be used with specific values, e.g., w(x)1 |
Read-write operation | {x→vy} or {y←vx} |
| Shorthand for the sequence r(x)v,w(y)v |
Read operation with explicit membership | ri(x)v |
| Read operation executed within Ti |
Write operation with explicit membership | wi(x)v |
| Write operation executed within Ti |
Operation identifier | op, opr, opw, opi |
| Operation, read operation, write operation, operation within Ti |
Operation membership | op∈Ti |
| Shorthand for op∈H|Ti |
Transaction start | [[ or \llbracket |
| \llbracket requires the stmaryrd package |
Transaction commit | ]] or \rrbracket |
| \rrbracket requires the stmaryrd package |
Transaction abort | ↻ or \righttoleftarrowor ↶ |
| in amsmath or mathabx or amssymb, respectively |
Weak transaction start | [ |
| Used to indicate transactions with relaxed properties, e.g. eventually consistent transactions |
Weak transaction commit | ] |
| Used to indicate transactions with relaxed properties, e.g. eventually consistent transactions |
Irrevocable operation | irr or ir |
| |
Happens-before relation | ↘ |
| Often rotated by about 22 degrees to be more visually appealing |
Point in time | τ |
| E.g. transaction Ti starts at time τi |
State at point in time | {x=1,y=2,z=3} |
|
Theorems
Concept | Math | LaTeX | Notes |
Proof | \begin{proof} ... \end{proof} |
| |
Named proof | \begin{proof}[name] ... \end{proof} |
|
Various
Concept | Math | LaTeX | Notes |
Binominal coefficient | (nk) = n!k!(n−k)! |
| aka choose function (pl. symbol Newtona) |
Divisor | a|b |
| ax=b and a, b, x ∈ Z |
Sources
Handwriting characters tool to find most suitable latex symbol: Detexify
Last updated