Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Calculus Early Transcendentals

Authors: James Stewart

8th edition

1285741552, 9781305482463 , 978-1285741550

More Books

Students also viewed these Programming questions

Question

Express the function in the form f g. F(x) = (2x + x 2 ) 4

Answered: 1 week ago

Question

If find the following limits. (a) (b) f(x) - 5, lim .2 * lim f(x)

Answered: 1 week ago