barcodeaddin.com

Program verification in Software Draw 39 barcode in Software Program verification




How to generate, print barcode using .NET, Java sdk library control with example project source code free download:
4 Program verification generate, create 3 of 9 none with software projects QR Code Standardiztion (a) De ne repe Software barcode 3/9 at C until B as a derived expression using our core language. (b) Can one de ne every repeat expression in our core language extended with for-statements (You might need the empty command skip which does nothing.).

Exercises 4.3 1. For any sto Software Code 39 re l as in Example 4.4 (page 264), determine which of the relations below hold; justify your answers: * (a) l (x + y < z) (x y = z) (b) l u (u < y) (u z < y z) * (c) l x + y z < x y z.

* 2. For any , and P explain why par P holds whenever the relation tot P holds. 3.

Let the relation P l ; l hold i P s execution in store l terminates, resulting in store l . Use this formal judgment P l ; l along with the relation l to de ne par and tot symbolically. 4.

Another reason for proving partial correctness in isolation is that some program fragments have the form while (true) {C}. Give useful examples of such program fragments in application programming. * 5.

Use the proof rule for assignment and logical implication as appropriate to show the validity of (a) par x > 0 y = x + 1 y > 1 y = x; y = x + x + y y = 3 x (b) par (c) par x > 1 a = 1; y = x; y = y - a y > 0 x > y . * 6. Write down a program P such that P y =x+2 (a) P z >x+y+4 (b) holds under partial correctness; then prove that this is so.

7. For all instances of Implied in the proof on page 274, specify their corresponding AR sequents. 8.

There is a safe way of relaxing the format of the proof rule for assignment: as long as no variable occurring in E gets updated in between the assertion [E/x] and the assignment x = E we may conclude right after this assignment. Explain why such a proof rule is sound. 9.

(a) Show, by means of an example, that the reversed version of the rule Implied. C C Implied Reversed is unsound for partial correctness. (b) Explain why the modi ed rule If-Statement in (4.7) is sound with respect to the partial and total satisfaction relation.

. 4.6 Exercises * (c) Show tha t any instance of the modi ed rule If-Statement in a proof can be replaced by an instance of the original If-statement and instances of the rule Implied. Is the converse true as well P z = min(x, y) , where min(x, y) is * 10. Prove the validity of the sequent par the smallest number of x and y e.

g. min(7, 3) = 3 and the code of P is given by if (x > y) { z = y; } else { z = x; } 11. For each of the speci cations below, write code for P and prove the partial correctness of the speci ed input/output behaviour: P z = max(w, x, y) , where max(w, x, y) denotes the largest of w, x * (a) and y.

P ((x = 5) (y = 3)) ((x = 3) (y = 1)) . * (b) Succ y = x + 1 without using the 12. Prove the validity of the sequent par modi ed proof rule for if-statements.

* 13. Show that par x 0 Copy1 x = y is valid, where Copy1 denotes the code a = x; y = 0; while (a != 0) { y = y + 1; a = a - 1; } * 14. Show that par y 0 Multi1 z = x y is valid, where Multi1 is: a = 0; z = 0; while (a != y) { z = z + x; a = a + 1; } 15.

Show that par y = y0 y 0 Multi2 z = x y0 is valid, where Multi2 is: z = 0; while (y != 0) { z = z + x; y = y - 1; } 16. Show that par x 0 Copy2 x = y is valid, where Copy2 is: y = 0; while (y != x) { y = y + 1; }.
Copyright © barcodeaddin.com . All rights reserved.