Question: Consider the following program, where : = denotes variable assignment. Assume only integer variables. y : = w + 1 ; z : = y

Consider the following program, where := denotes variable assignment. Assume only integer variables.
y:=w+1;
z:=y*w;
x:=1z
We don't want the last instruction to divide by zero. In order to avoid this contingency, what needs to be True in the initial
state?
Hint: insert the assertion/comment {z0} before the line that assigns to x. Then use the "magic" technique
described in Appendix D.2 of the IFM book to determine what must be True before each of the preceding
assignments.
a.)0
b.w>0
c.w0
d.)-1
e.z0
 Consider the following program, where := denotes variable assignment. Assume only

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!