Question: 1. (5 marks) What should the pre-condition be in each of the following ten correctness statements for the statement to be an instance of

1. (5 marks) What should the pre-condition be in each of the

1. (5 marks) What should the pre-condition be in each of the following ten correctness statements for the statement to be an instance of Hoare's axiom scheme? All variables are of type int. (a) P { x = 2; } x == 1 (b) P { x = 2; } x == 2 (c) P { x = y + z; } 0 < x + y + z (d) P { x = y*z + 3; } x*x > y +2 (e) P { z = y + 1; } Exists(z = 0%; z < 10) z + y == 50 (f) P { x = x + y; } Exists(y = 0; y < 15) x*x == y + t (g) P { x = y + 1; } For All (z = 1; z < 100) x + 2*y > z + 2 (h) P { z = x + y; } ForAll(z = 1; z < x) x + y + z < 100 P { x = y + z; } Exists(z = 0; z < 10) z*z + 2*x == 15 (j) P { x = y + z} Exists(y = 0; y < 100) (x + y == 15 || z*x + y < 100 )

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 Programming Questions!