# hw6 - of ﬁve statements Find the ﬁrst erroneous...

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

University of Central Florida School of Computer Science COT 4210 Spring 2004 Prof. Rene Peralta Homework 6 Due date: April 12 1. Chapter 9, exercise 1 (Sudkamp text). 2. Consider the following grammar over Σ = { a,b } . S AB + A ; A AS + Sb + a ; B BS + aA + S . (i)To make S A redundant, consider the step in a derivation where a new variable S is produced. (ii)This happens when one of the produc- tions A AS ; A Sb ; B BS ; B S is used. (iii) The only place where S A can play a role is in changing one of these newly produced S ’s into an A . (iv) So adding the rules A AA + Ab and B BA makes S A redundant. (v) We thus obtain the equivalent grammar S AB ; A AS + Sb + a + AA + Ab ; B BS + aA + S + BA . The above is wrong. For example, the grammar no longer generates the string “a”. So the argument must be ﬂawed. The argument consists

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: of ﬁve statements. Find the ﬁrst erroneous statement. Explain. Your answer should be precise and concise. 1 3. Here is pseudocode to enumerate INXIN : for (plane = 0; 1; plane++) for (i = 0; i <= plane; i++) for (j = 0; j <= plane; j++) if (i + j == plane) print("(i,j)"); Let C i denote the i th C program. We can use this ordering to, for example, run C i on input j for all i,j ∈ IN . (a) Write pseudocode to enumerate INXINXIN . (b) Assume “halts(i,j,k)” is a subroutine that runs C i on input j for up to k steps and outputs 1 if the program halts in that time-frame (outputs 0 otherwise). Write pseudocode to enumerate the language H = { 2 i 3 j | C i halts on input j } . 2...
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

hw6 - of ﬁve statements Find the ﬁrst erroneous...

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

View Full Document
Ask a homework question - tutors are online