/* 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 Paradox (string F) { if (Halts (F, F)) { while (true) ; } else return; } string paradox = "void Paradox (string F) {" "if (Halts (F, F)) { while (true) ; }" "else return;" "}"; // technically paradox has to include the definition of Halts int main () { Paradox (paradox); return 0; }