Introduction: A regular set (language) is a set accepted by a finite automaton.
Closure: A set is closed under an operation if, whenever the operation is applied to members of the set, the result is also a member of the set. For example, the set of integers is closed under addition, because x y is an integer whenever x and y are integers. However, integers are not closed under division: if x and y are integers, x/y may or may not be an integer.
There are several operations defined on languages:
L1 L2 È : strings in either L1 or L2.
L1 L2 Ç : strings in both L1 and L2.
L1L2 : strings com posed of one string from L, fol lowed by one string from L2.
–L2 : All strings (over the same alpha bet) not in L1.
L1* : Zero or more strings from L1 con catenated together
L1 L2 - : strings in L1 that are not in L2.
LR1 : strings in L1, reversed.
We shall show that the set of regular languages is closed under each of these operations.
Union, Concatenation, Negation, Kleene Star, Reverse
The general approach is as follows:
Union of L1 and L2
Concatenation of L1 and L2
Intersection and Set Difference
Just as with the other operations, it can be proved that regular languages are closed under intersection and set difference by starting with automata for the initial languages, and constructing a new automaton that represents the operation applied to the initial languages. In this construction, a completely new machine is formed, whose states are labelled with an ordered pair of state names: the first element of each pair is a state from L1 and the second element of each pair is a state from L2.
Negation of L1
Kleene star of L1
Reverse of L1
The same construction is used for both intersection and set difference. The distinction is in how the final states are selected.
Intersection: Make a state (A, B) as final if both
Set Difference
Mark a state (A, B) as final if A is a final state in L1, but B is not a final state in L2.