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 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Calculus Early Transcendentals
Authors: James Stewart
8th edition
1285741552, 9781305482463 , 978-1285741550
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App