Here is the pseudo code given...new to programming and need help....
1 If (x>k) then
2 x= x-k
3Else
4 x= x
5End if
You can assume that pre(1) is T.
In order to get credit, each derivation must include an explanation of how it is derived from an earlier step. If substitution is applied, then the function (RHS of assignment) and its inverse function must be defined. A reason must be provided to explain why substitution or forget is used.
I suggest that resolve the pre/post conditions in this order: pre(2), post(2), pre(4), post(4) and finally post(5).
1 If (x>k) then
2 x= x-k
3Else
4 x= x
5End if
You can assume that pre(1) is T.
In order to get credit, each derivation must include an explanation of how it is derived from an earlier step. If substitution is applied, then the function (RHS of assignment) and its inverse function must be defined. A reason must be provided to explain why substitution or forget is used.
I suggest that resolve the pre/post conditions in this order: pre(2), post(2), pre(4), post(4) and finally post(5).