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

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
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 ==>
Background image of page 2
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

This note was uploaded on 07/25/2008 for the course CSE 460 taught by Professor Torng during the Fall '07 term at Michigan State University.

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 Right Arrow Icon
Ask a homework question - tutors are online