{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

verif_lect_new

# verif_lect_new - Intro to Proofs of Correctness CEN 5035...

This preview shows pages 1–15. Sign up to view the full content.

Intro to Proofs of Correctness Prepared by Stephen M. Thebaut, Ph.D. University of Florida CEN 5035 Software Engineering

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Outline Introduction Axiomatic verification Predicate transforms Functional verification Some limitations
Introduction What is a Proof of Correctness? A collection of techniques that apply the formality and rigor of mathematics to the task of proving the consistency between a program and a rigorous specification of the program. Also referred to as “formal verification.”

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Introduction (cont’d) What are the benefits of studying formal verification? Understanding its limitations . Deeper insights into programming and program structures. Criteria for judging both programs and programming languages. The ability to formally verify small (or parts of large) programs.
Introduction Weak correctness predicate Assignment statements Sequencing if-then statements Iteration Axiomatic verification

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Introduction What is Axiomatic Verification? A formal method of reasoning about the functional correctness of a structured, sequential program by tracing its state changes from an initial (i.e., pre-) condition to a final (i.e., post-) condition according to a set of self-evident rules (i.e., axioms).
Weak Correctness Predicate To prove that program S is (weakly) correct with respect to pre-condition P and post-condition Q, it is sufficient to show: {P} S {Q}. Interpretation of {P} S {Q}: if the input (initial state) satisfies pre- condition P and ( if ) program S executes and terminates, then the output (final state) must satisfy post- condition Q.”

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Weak Correctness Predicate (cont’d) Note that {P} S {Q} is really just a “double conditional” of the form: (A Л B) C where A is “P holds before executing S”, B is “S terminates”, and C is “Q holds after executing S”. Therefore, the one and only case for which {P} S {Q} is false is: “ Q could be false if S terminates, given that P held before S executes.”
Weak Correctness Predicate (cont’d) What are the truth values of the following assertions? (1) {x=1} y := x+1 {y>0}

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Weak Correctness Predicate (cont’d) What are the truth values of the following assertions? (1) {x=1} y := x+1 {y>0} True, because if P holds initially, Q must hold when S terminates
Weak Correctness Predicate (cont’d) What are the truth values of the following assertions? (2) {x>0} x := x-1 {x>0}

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Weak Correctness Predicate (cont’d) What are the truth values of the following assertions? (2) {x>0} x := x-1 {x>0} False, because Q may not hold when S terminates given that P holds initially.
Weak Correctness Predicate (cont’d) What are the truth values of the following assertions? (3) {1=2} k := 5 {k<0}

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Weak Correctness Predicate (cont’d) What are the truth values of the following assertions?
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}