{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Module32Worksheet

# Module32Worksheet - G ABCD How short can the final derived...

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

Module 32 Worksheet In Class Questions The running example will be to use the grammar G with the following productions: S → AACD| ED A → aAb | λ C → aC | a D → aDa | bDb | λ E → ADD 1) (S4) Nullable variables N 0 = N 1 = N 2 = N 3 = 2) (S5) Give the updated set of productions applying the rules of eliminating λ- productions 3) (S6) Identify which variables are S-derivable in the given grammar. Base Case: Recursive Case: Final answer: 4) (S7) Update the example now eliminating unit productions

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

View Full Document
5) (S9) Identify productions that need to be shortened and shorten one of them. 6) (S10) Consider a derivation from a CNF grammar G that begins S ==>
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: G ABCD How short can the final derived terminal string be? Why? 7) (S10) A path in a parse tree has length x if it contains x variable nodes . Consider a parse tree T for a string x and a CNF grammar G with m variables. Suppose the longest path in T has length k. How long can this string x be? Suppose string x has length 2 m . How short can the longest path in T be? Take home review questions 1) What is a nullable variable? 2) How can we transform the following production so it fits CNF? S → AbCD where A, C, and D are variables and b is a terminal character....
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

Module32Worksheet - G ABCD How short can the final derived...

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

View Full Document
Ask a homework question - tutors are online