CS336F103 - 8/30/10 1 CS 336 f10 Lecture 3 What will we...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 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 Ss 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 satised. 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....
View Full Document

This note was uploaded on 11/30/2010 for the course CS 336 taught by Professor Myers during the Fall '08 term at University of Texas at Austin.

Page1 / 5

CS336F103 - 8/30/10 1 CS 336 f10 Lecture 3 What will we...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online