Presentation is loading. Please wait.

Presentation is loading. Please wait.

CST229 Week 7 Questions or concerns? Hand back Test#1 & Homework #4 – Test1 Average (45/50) Reading: Chapters 12&13 Chapter 12 – Grammar – production rules.

Similar presentations


Presentation on theme: "CST229 Week 7 Questions or concerns? Hand back Test#1 & Homework #4 – Test1 Average (45/50) Reading: Chapters 12&13 Chapter 12 – Grammar – production rules."— Presentation transcript:

1 CST229 Week 7 Questions or concerns? Hand back Test#1 & Homework #4 – Test1 Average (45/50) Reading: Chapters 12&13 Chapter 12 – Grammar – production rules – Derivation/Parse Tree – How to tell if a grammar is ambiguous In-Class Exercise #5 part 1 Chapter 13 – Regular Grammar Production rules – Remove Lambda productions – Remove Unit productions In-Class Exercise #5 part 2

2 In-Class Exercise #5 part 1 Construct Grammar Production Rules for the following: All words over {a,b} in which the letter a is never tripled. (i.e. no aaa allowed) L = {a n b m | 2n <= m <= 3n} L = {a n b m c k | m = 3k} L = {a n b m c k | m = n+k}

3 In-Class Exercise #5 part 2 Define a regular grammar for these languages: – All strings over {a,b} with 2 or 3 b’s and no more. – (a+b)*ab(a+b)* Remove lambda and unit productions from this grammar: S-> aA | aaB A-> aaA | aC | B -> C | bbB C -> cC | c


Download ppt "CST229 Week 7 Questions or concerns? Hand back Test#1 & Homework #4 – Test1 Average (45/50) Reading: Chapters 12&13 Chapter 12 – Grammar – production rules."

Similar presentations


Ads by Google