Regular Languages

A language is regular if there exists a finite state machine that recognizes it.

Regular languages are closed under the following operations:

Basic Closure Properties of Regular Languages

TLDR: Regular languages are closed under the regular operations:

Union of Regular Languages

Let L1, L2 be regular languages.
Let M1, M2 be finite automata that recognize L1 and L2 respectively.
A new machine M' that recognizes L1 ∪ L2 can be constructed.

Create a new initial state with ε-transitions to the previous initial states of M1 and M2.

Concatenation of Regular Languages

Let L1, L2 be regular languages.
Let M1, M2 be finite automata that recognize L1 and L2 respectively.
A new machine M' that recognizes L1 ⋅ L2 can be constructed.

From every final state in M1, introduce an ε-transition to the initial state of M2.
Mark every final state in M1 as non-final.

Kleene Closure of Regular Languages

Let L be a regular language.
Let M be a finite automaton that recognizes L.
A new machine M' that recognizes L* can be constructed.

From every final state, introduce an ε-transition to the initial state.


Other Closure Properties

Complementation of Regular Languages

Let L be a regular language.
Let M be a finite automaton that recognizes L.
A new machine M' that recognizes LC can be constructed.

Mark every non-final state as final and every final state as non-final.

Closure under Set-Theoretic Operations

Together, union and complementation make up a complete set of set-theoretic operations.
All other set-theoretic operations can be expressed in terms of these two.

Reversal of Regular Languages

Let L be a regular language.
Let M be a finite automaton that recognizes L.
A new machine M' that recognizes LR can be constructed.