This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS536 spring 2010 Assignment #6Due date – April 24 2010Question 1.Consider the earliest meeting time UNITY program.1a. Construct and formally prove partial correctness of a deterministic sequential program by showing that your program is a refinement of the UNITY program.Consider the earliest deterministic sequential program with 4 people. F1, F2, F3, F4.Program:r:=0 ; oldr := 1;while oldr ≠ r do;oldr := r;r:= f1(r)r:= f2(r)r:= f3(r)r:= f4(r)endFormal proof of partial correctness: The state transformation that the program is going through is f1 – f2 – f3 – f4 – f1 – f2 – f 3 – f4 ……This is a branch of the computation tree of the UNITY program. Since the UNITY program is partially correct, a branch in the tree is also partially correct. 1b. Prove partial correctness directly :CINV: { ¥u: 0<= u< r: !com(u) ^ r>=0}Proof:a)CINV before loop { ¥u: 0<= u< r: !com(u) ^ r>=0}Substitute r=0. The set is empty and its true for an empty setb){ ¥u: 0<= u< r: !com(u) ^ r>=0}Substitute r:= f1(r)¥u: 0<= u<f1(r): !com(u) ^ f1(r)>=0¥u: 0<= u<f1(r): !...
View
Full Document
 Spring '08
 cs536
 Correctness, Formal verification, formal methods, Hoare logic, F3

Click to edit the document details