This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 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 . answer: for (plane = 0; 1; plane++) for (i = 0; i <= plane; i++) for (j = 0; j <= plane; j++) for (k = 0; k <= plane; k++) if (i + j + k == plane) print("(i,j,k)"); (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 timeframe (outputs 0 otherwise). Write pseudocode to enumerate the language H = { 2 i 3 j  C i halts on input j } . answer: for (num_steps = 0; 1; num_steps++) for (i = 0; i <= num_steps; i++) for (j = 0; j <= num_steps; j++) if (i + j == num_steps) if halts(i,j,num steps) print(2 i 3 j ); 2...
View
Full
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.
 Spring '08
 Staff
 Computer Science

Click to edit the document details