(Solved):Prove that it is possible to write a program P which: a. takes an input M, a java program b. runs forever, and prints out strings to the console c. for every x, if M(x) halts, then P(M) eventually… View Answer…

 

Question

Prove that it is possible to write a program P which:

a. takes an input M, a java program

b. runs forever, and prints out strings to the console

c. for every x, if M(x) halts, then P(M) eventually prints out x

d. for every x, if M(x) does NOT halt, then P(M) never prints out x

 

EXPERT ANSWER

Following is the Algorithm

Starting out, Let S = {}
for i =

Scroll to top