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}
Question 1 options:
|
| {x2 1} y = x2 {y 1} |
|
| {x 0} y = x2 {y 1} |
|
| {x 2} y = x2 {y 1} |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
