我想问是否有人能帮我回答这个问题。这是以前一份考试论文的答案,我可以知道这个年度考试的答案。
这个问题似乎如此简单,以至于我完全迷失了方向,到底要问什么?
考虑以下涉及整数变量的代码部分:
if (i < j) { m = i; } else { m = j; }
By stating an appropriate output condition and then verifying the correctness of the piece of code, prove that after execution, m is equal to the minimum of i and j.
I have got the post condition as: {m = i ∧ i < j ∨ m = j ∧ j < i}
这是正确的吗?你如何核实这一点?