class5

# class5 - 1 Theorem R L isaregularlanguage Proof idea R :L...

This preview shows pages 1–20. Sign up to view the full content.

1 Reverse of a Regular Language

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 Theorem: The reverse         of a regular language is a regular language    R L L Proof idea: Construct NFA that accepts        : R L invert the transitions of the NFA that accepts   L
3 Proof Since        is regular,  there is NFA that accepts  L Example: ba ab L + = * a b b a L

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4 Invert Transitions a b b a
5 Make old initial state a final state a b b a

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6 Add a new initial state a b b a λ
7 a b b a λ Resulting machine accepts R L ba ab L + = * ab a b L R + = * R L is regular

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
8 Grammars
9 Grammars Grammars express languages Example:     the English language verb predicate noun article phrase noun predicate phrase noun sentence _ _

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
10   walks verb runs verb dog noun boy noun the article a article
11 A derivation of “ the boy walks ”: walks boy the verb boy the verb noun the verb noun article verb phrase noun predicate phrase noun sentence _ _

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
12 A derivation of “ a dog runs ”: runs dog a verb dog a verb noun a verb noun article verb phrase noun predicate phrase noun sentence _ _
13 Language of the grammar: L = { “ a boy runs ”,         “ a boy walks ”,         “ the boy runs ”,         “ the boy walks ”,         “ a dog runs ”,         “ a dog walks ”,         “ the dog runs ”,         “ the dog walks ” }

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
14 Notation   dog noun boy noun    Variable         or Non-terminal Terminal Production rule
15 Another Example Grammar: Derivation of sentence       : λ S aSb S ab aSb S ab aSb S S

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
16 aabb aaSbb aSb S aSb S λ S aabb S aSb S Grammar: Derivation of sentence            :
17 Other derivations: aaabbb aaaSbbb aaSbb aSb S aaaabbbb aaaaSbbbb aaaSbbb aaSbb aSb S

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
18 Language of the grammar λ S aSb S } 0 : { = n b a L n n
More Notation Grammar   ( 29 P S T V G , , , = : V

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 75

class5 - 1 Theorem R L isaregularlanguage Proof idea R :L...

This preview shows document pages 1 - 20. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online