程序正确性VS 算法正确性 广义上:程序正确性 ≈ 算法正确性 狭义上:程序正确性三 算法正确性 狭义上:程序正确性验证VS算法正确性证明 以下内容,我们将从程序正确性 的关注,转为算法正确性的研究
程序正确性 VS 算法正确性 广义上:程序正确性 ≈ 算法正确性 狭义上:程序正确性 ⊇ 算法正确性 狭义上:程序正确性验证 VS 算法正确性证明 以下内容,我们将从程序正确性 的关注,转为算法正确性的研究
算法的部分和完全正确性 any legal any legal input input algorithm A algorithm A if indeed this point is reached this point is reached then and output this is the desired output output this is the desired output Partial correctness Total correctness
算法的部分和完全正确性
如何利用数学技术来证明算法的正确性? “部分正确性”: We do not care whether execution ever reaches the endpoint, but that if it does we will not be in a situation where the outputs differ from the expected ones. we wish to capture the behavior of the algorithm by making careful statements about what it is doing at certain points. we thus attach intermediate assertions to various checkpoints in the algorithm's text
如何利用数学技术来证明算法的正确性? ◼ “部分正确性”: ❑ We do not care whether execution ever reaches the endpoint, but that if it does we will not be in a situation where the outputs differ from the expected ones. ❑ we wish to capture the behavior of the algorithm by making careful statements about what it is doing at certain points. ❑ we thus attach intermediate assertions to various checkpoints in the algorithm’s text