Question: Find the loop invariant, variant and weakest pre-condition in the following function. Prove total correctness of this function. What do you think this function
Find the loop invariant, variant and weakest pre-condition in the following function. Prove total correctness of this function. What do you think this function is computing. int funl (int x) { int y = 1; int z = x; while (z > 0) { y = y N = N * - z; 1; } return y;
Step by Step Solution
3.53 Rating (156 Votes )
There are 3 Steps involved in it
To analyze the function provided 1 Loop Invariant The loop invariant is a condition that holds true ... View full answer
Get step-by-step solutions from verified subject matter experts
