0000
A general definition of language must cover a variety of distinct categories: natural languages, programming languages, mathematical languages, etc. The notion of natural languages like English, Hindi, etc. is familiar to us. Informally, language can be defined as a system suitable for the expression of certain ideas, facts, or concepts, which includes a set of symbols and rules to manipulate these.
The languages we consider for our discussion is an abstraction of natural languages. That is, our focus here is on formal languages that need precise and formal definitions. Programming languages belong to this category. We start with some basic concepts and definitions required in this regard.
A language is a set of strings over that alphabet ∑. Therefore, a language L is any subset of ∑* i.e. L ⊆ ∑*.
Example let ∑ = {a,b} so, Language L can be any finite and infinite subset of ∑*.
Like = {aa.bb} or = {aabb, bbaa, aba} (finite set of strings) = | n ≥ 0 (infinite set of strings)
OPERATION OF LANGUAGE:
Union:- Let language = {01, 11, 101, 110} and = {10, 11,110, 001} then
= ∪ = { 01, 11, 101, 110} ∪ {10, 11, 110, 001} = {01, 11, 101, 110, 10, 001}
Intersection:- Let language = {01, 11, 101, 110} and = {10, 11,110, 001} then
= ∩ = {01, 11, 101, 110} ∩ {10, 11, 110, 001} = {11, 110}
Complement: - ∑ = {a,b} then ∑* = {λ, a, b, aa, ba, bb, …..} (set of all strings generated by a,b).
A complement of the language is just like a set where = U (Universal set) – A
[here universal set is ∑*]
Example:
Say one language set of all even string L = {|| mod 2} then = {|| mod 2 = 1}
Another example L= (set of all string starting with a and ending with b) then
A complement of this language = (set of all string not starting with a or not ending with b)
Reversal of Language: - Reversal of the language is denoted by
Let L = {aa, ab, abb, aba,} then = {aa, ba, bba, aba}
Concatenation:- . = {}. Let = {a, ba} and = {b,aa}
. = {a, ba}{b,aa} = {ab, aaa, bab, baaa}
Power of Language L:- = L concatenated n times. Let L = {ab, ba}
Kleen's star operation:- Kleens’s star operation on language L is denoted by L*.
={x | x is the concatenation of zero or more strings from L}
Example: L = {a, b}
Same way
= {x | x is the concatenation of one or more strings from L}