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

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

View Full Document Right Arrow Icon
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 flawed. The argument consists
Background image of page 1

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

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

Page1 / 2

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

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