(5) Suppose the following program H existed.
(5) Suppose the following program H existed.
static void main(String [] args)
TokenReader in = new TokenReader(System.in);
String s = in.readString()
/* Set b==true if s is a program that loops when
given s as input, else set b==false. */
if ( b ) System.out.println("loops");
else System.out.println("halts");
Note that for every possible input s, program H prints a message and halts.