Question: The program correctness notation (called a Hoare triple) is {Q}P{R}, where Q is the precondition, P is a program segment, and R is the postcondition.

The program correctness notation (called a Hoare triple) is {Q}P{R}, where Q is the precondition, P is a program segment, and R is the postcondition. Pick the correct Hoare triple for the code segment. { } y = x2 {y? 1} {x? 2 1} y = x2 [2 1} O x 20y = x2 y 2 13 O {x 2 2} y = x? {y 2 1} Question 2 (3 points) Pick the correct precondition for the code segment x = x - 1. { } y = x - 1 {y >0} O {x > 1} {x >0} O {x = x}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
