/* This program illustrates the undecidability of the Halting Problem. */ #include using namespace std; bool Halts (string F, string X) { /* Put your solution of the halting problem here */ } void Q (string F) { if (Halts (F, F)) { while (true) ; } else return; } string Qstring = "void Q (char* F) {" "if (Halts (F, F)) { while (true) ; }" "else return;" "}"; // technically Qstring has to include the definition of Halts int main () { Q (Qstring); return 0; }