Compute the weakest precondition for each of the following selection constructs and their postconditions: a. if (a
Question:
Compute the weakest precondition for each of the following selection constructs and their postconditions:
a. if (a == b)
b = 2 * a + 1
else
b = 2 * a;
{b > 1}
b. if (x < y)
x = x + 1
else
x = 3 * x
{x < 0}
c. if (x > y)
y = 2 * x + 1
else
y = 3 * x - 1;
{y > 3}
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 55% (9 reviews)
a if a b b 2 a 1 else b 2 a b 1 2 a 1 1 2 a 0 a 0 2 a 1 a 12 The w...View the full answer
Answered By
Vijay Joshi
Provided 1100+ Solutions to the Bartleby Technologies in subject of Physics having 8 months of experience.
Provided 200+ solutions to Chegg india in subject of Advanced physics having 1+ year of experience.
0.00
0 Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
Compute the weakest precondition for each of the following sequences of assignment statements and their postconditions: a. a = 2 * b + 1; b = a - 3 {b < 0} b. a = 3 * (2 * b + a); b = 2 * a - 1 {b >...
-
Compute the weakest precondition for each of the following assignment statements and postconditions: a. a = 2 * (b - 1) - 1 {a > 0} b. b = (c + 10) / 3 {b > 6} c. a = a + 2 * b - 1 {a > 1} d. x = 2 *...
-
Compute the missing amounts for each of the following notes. Total Interest $ 270 (d) Annual Principal Interest Rate (a) Time 60 days 6% 8% $30,000 $60,000 $50,000 3 years 5 months (c) (b) 11% $2,500...
-
What relationship would you expect to find between the level of development of a countrys financial system and its level of economic development? Explain in terms of the countrys level of savings and...
-
Is conflict in a team good or bad? Explain your answer.
-
The uniform 100-kg beam is freely hinged about its upper end A and is initially at rest in the vertical position with = 0. Determine the initial angular acceleration of the beam and the magnitude...
-
The English scores for a sample of 14 students Find the mean, the median, and the mode of the data, if possible. If any measure cannot be found or does not represent the center of the data, explain...
-
On January 1, 2007 the Amity Company leases a crane to Baltimore Company. The lease contains the following terms and provisions: The lease is non-cancelable and has a term of 10 years. The lease does...
-
Regarding the Introduction to Epidemiology it talks about Descriptive and Analytic epidemiology. With descriptive you would look at When, Where, and who in the population was affected With analytic...
-
Your brother has just started a new job as the Controller of an IESBA restricted audit client. You do not serve on the audit engagement. What steps must you take to ensure your independence is not...
-
Explain what the preconditions and postconditions of a given statement mean in axiomatic semantics.
-
What is the problem with using a software pure interpreter for operational semantics?
-
Cakes baked by the Freshfood Bakery, are transported (turn the ovens to be packaged by one of three wrappers. Each wrapper can wrap an average of 120 cakes per hour Poisson distributed. The cakes are...
-
Will the welfare loss from a monopolist with a perfectly elastic marginal cost curve be greater or less than the welfare loss from a monopolist with an upward-sloping marginal cost curve?
-
When approving a tax bill and there are differences between the House and Senate versions, the differences are resolved by the: a. President b. Speaker of the House c. President of the Senate d....
-
The Government Accounting Office reported that airlines block new carriers at major airports. a. What effect does such blocking have on fares and the number of flights at those airports? b. How much...
-
Describe the impact that entity-level controls (i.e., control environment, pervasive controls, general/IT general controls) can have on the B/AR/CR business process controls.
-
Leaders in many supply chains have started moving toward independent forecasting to improve their ability to match supply and demand. toward consecutive forecasting to improve their ability to match...
-
Suppose that a phone company reports that the average duration of a cell phone call is 1.4 minutes, with a standard deviation of 1.2 minutes. 1. Would it be reasonable to use a normal distribution to...
-
Suppose that the laptop of Prob. 2.16 is placed in an insulating briefcase with a fully charged battery, but it does not go into sleep mode, and the battery discharges as if the laptop were in use....
-
TamarindoUniversity andmany other schoolsworldwide are doing a joint project on multimedia. A computer network is built to connect these schools using communication links that form a tree. The...
-
The time delay of a long-distance call can be determined by multiplying a small fixed constant by the number of communication links on the telephone network between the caller and callee. Suppose the...
-
A company named RT&T has a network of n switching stations connected by m high-speed communication links. Each customers phone is directly connected to one station in his or her area. The engineers...
-
A 7 5 kg cliff - diver is falls from a height through the air head, diving towards the water. The drag coefficient for the diver is 0 . 8 3 and the area of the descending diver is 0 . 2 1 m ^ 2 ....
-
In the automobile industry, the dimensionless drag coefficient and the area of the vehicle are often combined into one variable - the drag area whereby the drag area is the product of the...
-
When you drop 10 pebbles into the well, you record the times for hearing the splash as 2.94 s, 3.11 s, 3.12 s, 2.97 s, 3.12 s, 2.97 s, 3.06 s, 3.21 s, 3.37 s, and 3.53 s. (a) Find the average time...
Study smarter with the SolutionInn App