Alphabet

  • An alphabet is a nonempty finite set of symbols (or letters).
    • Symbols are typically denoted by .

Strings

  • A string over an alphabet is a finite sequence of symbols from , usually written without separators.
    • Strings are typically denoted by lowercase letters .
  • The length of a string , written , is the number of symbols in .
  • The set of all possible strings over an alphabet is denoted by .
  • The string of length zero is called the empty string, denoted by .
    • The empty string is a substring of every string.
  • A prefix of a string is a string such that for some string .
  • A suffix of a string is a string such that for some string .
  • A substring of a string is a string such that for some strings .
  • A proper prefix/suffix/substring is a prefix/suffix/substring that is not equal to .
  • The lexicographic order of strings follows dictionary order.
  • The shortlex order (or string order) is a lexicographic order where shorter strings precede longer ones.

Operations

  • For strings , their concatenation is written as or and is the string formed by appending to .
  • The reverse of a string , written , is the string obtained by writing in the opposite order.
  • A power of a string , written , represents concatenated with itself times.

Grammar

  • A formal grammar is a tuple where
    • is a finite set of variables (or non-terminals)
      • Symbolized by
      • (In other areas, these are called syntactic categories)
    • is a finite set of terminals (with and disjoint)
      • Symbolized by
      • This is the alphabet of the language
    • is a finite set of rules (or productions)
      • A rule is a string of the form
      • A -rule is a rule of the form , where .
      • An unit rule is a rule of the form , where .
      • A variable is nullable if .
    • is the start variable

Languages

  • Any subset is called a language over .

    • A language is prefix-free if no string in it is a proper prefix of another.
  • The strings in a language are called words.

  • The empty set is a language, called the empty language.

    • is regular
  • The set is a language (sometimes called the empty string language)

    • is regular

Operations & Closure Properties

OperationRegularCFLDecidable (R)Turing-recognizable (RE)
UnionYesYesYesYes
IntersectionYesYesYes
ComplementYesYes
ConcatenationYesYesYesYes
Kleene StarYesYesYesYes
ReverseYesYesYesYes
HomomorphismYesYesYes
Intersection with a regular lang. YesYesYesYes

Classification

Chomsky HierarchyLanguage/GrammarAbstract Machine
Type-0Turing-recognizable (RE) / UnrestrictedTuring Machine
Type-1Context-SensitiveLinear Bounded Automaton
Type-2Context-FreePushdown Automaton
Type-3RegularFinite State Automaton

Automata

Automaton
Deterministic Finite Automaton (DFA)
Nondeterministic Finite Automaton (NFA)
Deterministic Push Down Automaton (DPDA-I) with 1 push-down store
Nondeterministic Push Down Automaton (NPDA-I, PDA) with 1 push-down store.
Linear Bounded Automaton (LBA)
Deterministic Push Down Automaton (DPDA-II) with 2 push-down stores
Nondeterministic Push Down Automaton (NPDA-II) with 2 push-down stores
Deterministic Turing Machine (DTM)
Nondeterministic Turing Machine (NTM)
Probabilistic Turing Machine (PTM)
Multitape Turing Machine (MTM)
Multidimensional Turing Machine