{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

View Full Document Right Arrow Icon
Intro to Proofs of Correctness Prepared by Stephen M. Thebaut, Ph.D. University of Florida CEN 5035 Software Engineering
Background image of page 1

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

View Full Document Right Arrow Icon
Outline Introduction Axiomatic verification Predicate transforms Functional verification Some limitations
Background image of page 2
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.”
Background image of page 3

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

View Full Document Right Arrow Icon
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.
Background image of page 4
Introduction Weak correctness predicate Assignment statements Sequencing if-then statements Iteration Axiomatic verification
Background image of page 5

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

View Full Document Right Arrow Icon
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).
Background image of page 6
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.”
Background image of page 7

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

View Full Document Right Arrow Icon
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.”
Background image of page 8
Weak Correctness Predicate (cont’d) What are the truth values of the following assertions? (1) {x=1} y := x+1 {y>0}
Background image of page 9

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

View Full Document Right Arrow Icon
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
Background image of page 10
Weak Correctness Predicate (cont’d) What are the truth values of the following assertions? (2) {x>0} x := x-1 {x>0}
Background image of page 11

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

View Full Document Right Arrow Icon
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.
Background image of page 12
Weak Correctness Predicate (cont’d) What are the truth values of the following assertions? (3) {1=2} k := 5 {k<0}
Background image of page 13

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

View Full Document Right Arrow Icon
Weak Correctness Predicate (cont’d) What are the truth values of the following assertions?
Background image of page 14
Image of page 15
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}