Definition

Regular Language

Let be a language. is a regular language if there exists at least one deterministic finite automaton (DFA), that recognises :

Regular Operations

Most operations on languages are closed over regularity or regular-preserving. That is, applying these operations on a regular language will always result in another regular language. The proofs for such properties usually involve the construction of a new DFA or NFA, since if we can construct a DFA that only recognises a set of strings, then the language corresponding to that set of strings is regular.

The following operations preserve regularity (See Theorems for more info):

Limitations

While every finite language is regular, there are some infinite languages that are non-regular.

Take the language

To prove this language is regular, we would need a DFA that can keep track of how many occurrences of it encountered, so that it is equal to the number of occurrences of 0.

However, DFAs are ‘memoryless’, so this is not possible!

Examples

  • is regular

This is because is finite and can be represented by the regex . Then produces a valid regex, and hence it describes a regular language.

Theorems

T1: Every finite language is regular

Let be a language.

Finiteness here means that has a finite number of strings, and is some ‘closed’ set.

C1: Regularity is closed under any boolean combination

From the theorems below, we can construct an equivalent ‘mapping’ that maps set operations with logical connectives. That is, just like we can create a complex predicate using logical connectives over atoms, we can construct a new language using a combination of languages.

If all the ‘atomic’ languages used to make a new language are regular, then the new language is also regular

T2: Regularity is closed under union ^t2

Let be two regular languages. Then, the union (with respect to languages), preserves regularity:

The contrapositive yields:

T3: Complement of a regular language is regular ^t3

Let be a regular language. Then, the complement of , given by is regular:

T4: Regularity is closed under concatenation ^t4

Let be two regular languages. Then, the operation of concatenation preserves regularity:

T5: Regularity is closed under Kleene star ^t5

Let be a regular language. Then, the Kleene star operation preserves regularity:

T6: More regular-preserving operations #TODO ^t6

The following operations all preserve regularity:

  • Intersection
  • Set Difference
  • Reversal