{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CS336F103

# CS336F103 - What will we cover CS 336 f10 Lecture 3 Hoare...

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

8/30/10 1 CS 336 f10 Lecture 3 What will we cover Hoare triples Weakest preconditions Writing specifications Using Predicates to Document Programs . If S is a sequence of commands (i.e. a program) and Q and R are predicates, then {Q} S {R} (curly brackets enclose predicates) Means if execution of S begins in a state satisfying Q,then it terminates in a state satisfying R. Terminology: if Q holds initially, then S establishes R. Using Predicates to Document Programs . {Q} S {R} The predicate Q is known as S’s pre condition ,and R is known as its post condition .They are both known as assertions . The command sequence S may be an entire program or part of a larger program.It may contain any number (0 included) of commands. Proof Outlines We will be combining program segments, along with their pre- and postconditions, into sequences to form programs. {Q 1 } S 1 {R 1 } ; {Q 2 } S 2 {R 2 } ; …; {Q n } S n {R n } Frequently, R i and Q i+1 will be equivalent; then we can write {Q 1 } S 1 ; {Q 2 } S 2 ; …; {Q n } S n {R n } but this is not required. Our Approach wp(S,R) denotes the minimum (i.e. weakest ”) precondition necessary for the postcondition to be satisfied.

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

View Full Document
8/30/10 2 The predicate wp (S,R) represents the set of all the initial states starting in which the execution of S is guaranteed to establish R.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

CS336F103 - What will we cover CS 336 f10 Lecture 3 Hoare...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online