0% found this document useful (0 votes)
90 views12 pages

Language Operations

The document discusses operations that can be used to construct formal languages from other languages. It defines operations like union, concatenation, and Kleene star. It states that the class of regular languages is closed under these operations, as well as intersection, complement, and difference. It provides examples of regular expressions used to describe regular languages, including hints for writing regular expressions over an alphabet.

Uploaded by

nipo809
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views12 pages

Language Operations

The document discusses operations that can be used to construct formal languages from other languages. It defines operations like union, concatenation, and Kleene star. It states that the class of regular languages is closed under these operations, as well as intersection, complement, and difference. It provides examples of regular expressions used to describe regular languages, including hints for writing regular expressions over an alphabet.

Uploaded by

nipo809
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Language operations

Dionis Garcia 12-0836 Gilbert de la Cruz 12-0846

Language Operations
Operations

that can be used to construct languages from other languages. Recall: A language is any set of strings

Operations on formal languages


Let L1 = {10} and L2 = {011, 11}. Union: L1 L2 = {10, 011, 11} Concatenation: L1 L2 = {10011, 1011} Kleene Star: L1 * = {e, 10, 1010, 101010, }

Other operations: intersection, complement, difference

Closure properties of regular languages


Definition: A regular language is any language that is accepted by a finite automaton

The class of regular languages is closed under the following operations (i.e., performing these operations on regular languages creates other regular languages)

Union Concatenation Kleene star Intersection Complement Difference

Definition
If L1 and L2 are two languages, we define:
the

concatenation of L1 and L2, denoted by L1L2, as the set of all words given by the concatenation of any word in L1 with any word in L2.

L={x|x=uv and u belongs to L1 and v belongs to L2}

Regular expressions
A useful shorthand for describing regular languages. Compare to arithmetic expressions, such as (x + 3)/2. An arithmetic expression is constructed using arithmetic operators, such as addition and division. A regular expression is constructed using operations on languages, such as concatenation, union, and Kleene star.

The value of an arithmetic expression is a number. The value of a regular expression is a (formal) language.

Hints for writing regular expressions


Hints for writing regular expressions Assume = {a, b, c}. -Zero or more as: a* -One or more as: aa* -Any string at all: (a + b + c)* -Any nonempty string: (a + b + c)(a + b + c)* -Any string that does not contain a: (b + c)* -Any string containing exactly one a: (b + c)*a(b + c)*

Examples
1. 2. 3. 4. 5. 6.

a*+ b = {b, , a, aa, aaa, aaaa, aaaaa, } a*ba* = {w * | w has exactly one b} (a + b)*aa (a + b)* = {w * : w contains aa} (a + b)*aa (a + b)* + (a + b)*bb (a + b)* = {w * : w contains aa or bb} (a + )b* = {abn : n 0} {bn : n 0}

As with arithmetic expressions, there is an order of precedence for operators -- unless you change it using parentheses. The order is: star closure first, then concatenation, then union.

You might also like