530 likes | 549 Views
Learn about Regular Languages properties, NFA to DFA conversion, Regular Expressions, equivalency, and more. Explore examples and proofs step by step.
E N D
Observation • Any Finite Accepter (NFA or DFA) • can be converted to an equivalent NFA • with a single final state
Example NFA Equivalent NFA
In General NFA Equivalent NFA Single final state
Extreme Case NFA without final state Add a final state
Properties • Take any regular languages and • We will prove: Union: Concatenation: Are regular Languages Star: Complement: Intersection:
We Say • Regular Languages are closed: • Under union: • Under concatenation: • Under the star operation: • Under complement: • Under intersection:
For regular languages and • take NFAs and with Single final state
Union • NFA for
Example NFA for
Concatenation • NFA for
Example • NFA for
Star Operation • NFA for
Example • NFA for
Complement • For the complement of regular language : • Take the DFA that accepts • Construct such that: • Each final state of is nonfinal in • nonfinalfinal • We have:
Intersection • For regular languages and : regular regular regular regular regular
Example • Regular languages: The language is regular
Regular Expressions • Regular expressions • are another way of expressing • regular languages • Example: • Stands for the language
Recursive Definition • Regular Expressions: • Primitive regular expressions: • Given regular expressions and Are regular expressions
Examples • A regular expression • Not a regular expression
Languages of Regular Expressions • : language of regular expression • Example
Definition • For primitive regular expressions:
Definition (continued) • For regular expressions and
Example • Regular expression:
Example • Regular expression
Example • Regular expression
Example • Regular expression = { all strings with at least two consecutive 0 }
Example • Regular expression = { all strings without two consecutive 0 }
Equivalent Regular Expressions • Definition: • Regular expressions and • are equivalent if
Example = { all strings with at least two consecutive 0 } and are equivalent regular expr.
Theorem • The class of languages • described by Regular expressions • is identical • to the Regular languages
In Other Words • For any regular expression • the language is regular • For any regular language there is • a regular expression with
Proof • First we prove: • For any regular expression • the language is regular
Induction Basis • Primitive Regular Expressions: NFAs regular languages
Inductive Hypothesis • Assume • for regular expressions and • that • and are regular languages
Inductive Step • We will prove that: Are regular Languages
By inductive hypothesis • and are regular languages • We know: Regular languages are closed under union concatenation star operation
Therefore: Are regular languages
And trivially: is a regular language
Proof - Second Part • Now we want to prove: • For any regular language there is • a regular expression with
Since is regular take the • NFA that accepts it Single final state
From Construct the equivalent • Generalized Transition Graph • labels of transitions • are regular expressions Example: