Question: Algorithm Question Parts (a) and (b) refer to the following program. 1234567//pre:((a==5)(a==5))(b>2)cabda+c//assert:if(d15 (a) [1 mark] Fill in an assert statement in line 4. Your statement
Algorithm Question

Parts (a) and (b) refer to the following program. 1234567//pre:((a==5)(a==5))(b>2)cabda+c//assert:if(d15 (a) [1 mark] Fill in an assert statement in line 4. Your statement should contain only the information that is necessary to complete the proof in part (b). (b) [5 marks] Use the assert statement from part (a) to prove that the given code has the partial correctness property. Specifically, your proof must be split into two parts. (1) Assume pre is true in line 1 and line 4 is reached, and prove that assert is true in line 4. (2) Assume assert is true in line 4 and that line 7 is reached, and prove that post is true in line 7. This part of your proof must not refer to any lines of code prior to line 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
