Skip to content

Instantly share code, notes, and snippets.

@jemc
Last active January 17, 2022 18:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jemc/b994b96d5e4cc7bdfcc34d8c6b587e3a to your computer and use it in GitHub Desktop.
Save jemc/b994b96d5e4cc7bdfcc34d8c6b587e3a to your computer and use it in GitHub Desktop.
An informal glossary of formal notation commonly used in academic papers relevant to computer science

Overview

Laypersons who are not trained in the relevant formal notation may sometimes feel lost when trying to read academic papers on computer science.

This gist is intended to be a short introductory "cheat sheet" for some of the symbols we may encounter in such papers, to help make the work more accessible to a broader audience, particularly those working in the software industry looking to gain a deeper understanding into formal computer science.

In addition to this introductory glossary of symbols, it may also be helpful to reference this glossary of terms so that the formal usage of certain words can be known to the reader.

One can also read a great bit more detail on this topic in The Formal Semantics of Programming Languages, a text introducing a lot of details in formal notation.

The sections below are delineated by the branch of mathematics / computer science where the symbols are commonly used, and the introduction to each section briefly describes the primary relevance to software and also gives resources for further reading if available.

These notes are from my personal reference - they are incomplete and subject to expansion and revision over time. Suggestions and feedback are welcome in the comments below.

Predicate Logic

TODO: Intro here

A ∨ B

A or B - the logical disjunction (the overall predicate is true if and only if eiher A or B are true)

A ∧ B

A and B - the logical conjunction (the overall predicate is true if and only if both A and B are true)

¬A or ~A or -A

not A - the logical complement or negation (the predicate is true if and only if A is not true)

A → B or A ⊢ B

A entails/proves B, or we may say B follows from A (if predicate A is true, then predicate B must be true - A is "sufficient" for B, but it may not be "necessary")

A ↔ B or A iff B

A is true "if and only if" B is true (the condition B is both "necessary" and "sufficient" to prove A) - or put another way, A entails/proves B and B also entails/proves A

Set Theory

Set Theory is commonly used in computer science papers to describe semantics related to type systems - particularly algebraic types.

Below are some common symbols in set theory. See also this more comprehensive listing.

a

an element named a (denoted as a lowercase variable)

A

a set named A (denoted as an uppercase variable), implied to contain zero or more elements

{a, b, c}

a set containing the elements a, b, and c

{x | f(x)} or {x : f(x)}

a set containing every element x which satisfies the predicate function f (and containing no elements which do not satisfy it) - the | or : is sometimes called "set builder notation" and can be read as "such that" or "for which"

A ∪ B or A ∨ B

the union of sets A and B (the set of elements that are in either A or B)

A ∩ B or A ∧ B

the intersection of sets A and B (the set of elements that are in both A and B)

a ∈ B

a is an element within the set/domain B

a ∉ B

a is an element which is not within the set/domain B

A ⊆ B or A ≤ B

set A is a subset of set B (all of the elements in A are also in B)

A ⊇ B or A ≥ B

set A is a superset of set B (all of the elements in B are also in A)

A ⊂ B or A < B

set A is a strict/proper subset of set B (all of the elements in A are also in B, but there exist elements in B which are not in A)

A ⊃ B or A > B

set A is a strict/proper superset of set B (all of the elements in B are also in A, but there exist elements in A which are not in B)

Structural Operational Semantics

Structural Operational Semantics is a system of notation for specifying formal semantics of a program or programming language.

It is used to specify a sort of "virtual machine" which knows certain rules for holding program state and reducing expressions based on that state.

This paper where Plotkin introduced the notation is a helpful resource.

(horizontal line with one expression above and one below)

 A 
---
 B

If the condition A in the program state is met, then the program state will update as shown in B.

a −→ b

an initial state of a evaluates/transitions to a new state of b

a → b

typically a function accepting term a and emitting term b

a |→ b

typically a mapping of key a to value b within a state store

∆ ⊢ A or Γ ⊢ A

the predicate A is true within the given program state / runtime environment /Γ (these two greek letters seem to be the most commonly used, but other names are possible)

Other Shorthand

TODO: Intro here

"for all" or "for any"

"there exists"

or 's.t.'

"such that"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment