XHWans - University of Central Florida School of Computer...

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

View Full Document Right Arrow Icon
School of Computer Science COT 4210 Spring 2004 Prof. Rene Peralta Extra credit HW: answers to selected problems 1. Consider the following grammar over Σ = { a,b } : S AB ; A AS + Sb + a ; B BS + aA + λ ; Convert the grammar to Chomsky Normal Form (please use rules U a and V b ). answer: Besides some simpler transformations, we must remove unallowed λ -productions and chain rules. The general technique I taught in class is to remove a given production P , add redundant productions until P itself becomes redundant. Then remove P . First deal with the mixed (terminals and variables) terms using U a and V b : S AB ; A AS + SV + a ; B BS + UA + λ ; To make B λ redundant, add S A and B S : S AB + A ; A AS + SV + a ; B BS + UA + S . To make S A redundant, add S AS + SV + a . Reasoning: when the rule S A is used in a derivation, the variable A must at some
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/09/2011 for the course COT 4210 taught by Professor Staff during the Spring '08 term at University of Central Florida.

Page1 / 4

XHWans - University of Central Florida School of Computer...

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