Question: Q 4 [ 2 0 ] Consider the following specification where a and b are arrays of inte - gers of length n f =
Q
Consider the following specification where a and are arrays of inte
gers of length
:AAiinjin:
Eg
Read the whole question before beginning to answer. The idea is to
develop a command of the form
; while
The command should run in time.
a Propose a loop invariant
Let :I: Let :: so that ;
b Give a command that refines
c Give an expression A and such that
notAAAiinjin
is true for all states, ie so that :notA: skip.
is
d Propose a bound expression for the loop.
Let :: so that
if A then ; else skip
e Give a command that refines and that makes the bound
expression smaller.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
