Regular Grammars Generate Regular Languages 1 Theorem Regular
- Slides: 44
Regular Grammars Generate Regular Languages 1
Theorem Regular grammars generate exactly the class of regular languages: If is a regular grammar then is a regular language If is a regular language then there is a regular grammar with 2
Proof First we prove: If is a regular grammar then is a regular language can be: Right-linear grammar or Left-linear grammar 3
The case of Right-Linear Grammars Let be a right-linear grammar We will show: is regular The proof: We will construct an NFA with 4
Grammar is right-linear Example: 5
Construct NFA such that every state is a variable: special final state 6
Add edges for each production: 7
8
9
10
11
12
NFA Grammar 13
In General A right-linear grammar has variables: and productions: or 14
We construct the NFA each variable such that: corresponds to a node: 15
For each production: we add transitions and intermediate nodes ……… 16
For each production: we add transitions and intermediate nodes ……… 17
Resulting NFA looks like this: 18
Now, we need to show: 19
The Case: Take We will show: there is a path with label from state to state in ………… 20
Grammar looks like: strings 21
22
Since: …… …… We have: 26
Since: We have: and …… We have: 27
The Case: Take We will show that in 28
Since there is a path …… 29
Write: There is a path …… …… 30
Since: …… …… This derivation is possible 31
Since: We have: 32
The Case of Left-Linear Grammars Let be a left-linear grammar We will show: is regular The proof: We will construct a right-linear grammar with 33
Since is left-linear grammar the productions look like: 34
Construct right-linear grammar In : 35
In : 36
It is easy to see that: Since is right-linear, we have: is regular language (homework) is regular language 37
Proof - Part 2 Now we will prove: If is a regular language then there is a regular grammar with Proof outline: we will take an NFA for and convert it to a regular grammar 38
Since is regular There is an NFA such that Example: 39
Convert to a right-linear grammar 40
41
42
We can generalize this process for any regular language : For any regular language we obtain an right-linear grammar with 43
Since is right-linear grammar is also a regular grammar with 44
- Which grammar generates regular language?
- Unrestricted grammar
- What is unrestricted grammar
- Handling questions in context-free grammars
- Useless variables in context-free grammars
- Stokes theorem gives relationship between
- Contradiction example
- Decision properties of regular languages
- Decision properties of regular languages
- Decision properties of regular languages
- Right linear grammar
- Properties of regular languages
- Closure under intersection
- Regular and irregular languages
- Pumping lemma non regular languages examples
- Decision properties of regular languages
- Linear factors theorem and conjugate zeros theorem
- Remainder theorem
- Conjugate zeros theorem
- Remainder theorem class 9
- P and q rational root theorem
- Factor therom
- Hill climbing heuristic
- 5 axioms of urban economics
- Generate and conceptualize artistic ideas and work
- Edis tpin
- Udin verification
- Can backdated udin be generated
- Contoh soal metode generate and test
- Eclipse generate jpa entities from database
- Frequency synonyms
- Purdom power plant
- Concept generation in product design
- Generator phone number club080
- Generate synonym
- Eft gp
- Generate thesis statement
- Parameter verilog
- Bulk sms hsn code
- Design process used in ied
- Cobol xml
- Masalah ruang keadaan dan pencarian
- A repeated pattern designed to generate rhythmic momentum
- Generate ash report for sql_id
- How do business processes generate value