How to use Hoare Logic to Prove this Assertion
-
05-11-2019 - |
문제
Given this assertion in Hoare Logic:
\begin{align} &\mathbf{\{p >= 0\}}\\ &s = 0 ; n = 1 ;\\ &\mathtt{while}\ (n <= p)\ \{\\ &\quad s = s + n ;\\ &\quad n = n + 1\\ &\}\\ &\mathbf{\{s == p * (p + 1) / 2\}} \end{align}
How to prove this using the rules of Hoare Logic. I am not sure where to really begin, I only currently understand (most) of the meaning of the axioms, but not what is required for a proof.
올바른 솔루션이 없습니다
제휴하지 않습니다 cs.stackexchange