This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Homework 2 CSC 7101, Spring 2011 Due: 28 February 2011 1. (5 pts) What set of states does the formula x.x = 3 characterize? What set of states does the formula x.x = x characterize? Explain your answers. 2. (10 pts) Which of the following Hoare triples are valid: (a) { true } x := 2 { true } (b) { true } x := x { false } (c) { false } x := 2 { true } (d) { false } x := 2 { false } (e) { true } while true do x := 2 end { false } (f) { true } x := x + 1 { x = x + 1 } (g) { x = y } t := x; x := y; y := t { x = y } (h) { x >= 0 } x := y { y >= 0 } 3. (5 pts) The following axiom for the assignment isnt sound: { true } x := e { x = e } Find an example that demonstrates the unsoundness of the rule, i.e., a Hoare triple that can be proved with this rule but that isnt operationally valid. 4. (10 pts) Give a good (i.e., sound and complete) rule for the assignment statement where the post condition is determined by the precondition. In other words, fill in the question mark in thecondition is determined by the precondition....
View
Full
Document
This note was uploaded on 12/31/2011 for the course CSC 7101 taught by Professor Baumgartner,g during the Spring '08 term at LSU.
 Spring '08
 Baumgartner,G

Click to edit the document details