How could we use DOES-HALT to determine if a program produces the correct output for a specific input? Keep in mind that DOES-HALT does just that — it halts.
对于一个特定的输入来说,我们如何用DOES - HALT判断程序是否产生了一个恰当的输出呢?
Now, all we need to do is run DOES-HALT (COMPARE-OUTPUT, [program, input, expected output]) to know whether or not program passes the test case, input, and outputs the expected output.
现在,我们所要做的全部事情就是运行DOES - HALT (COMPARE - output,[program, input, expected out put]),这样一来我们就会知道程序是否通过了测试用例,输入,和输出预期的输出。
That means work on this input will halt, as it should.
这意味着在此的输入作业将停止,因为它应该停下。 但如果它检测到一个不可停止的循环,那么P报告"Bad"!
应用推荐