hw2 - Homework 2 CSC 7101, Spring 2011 Due: 28 February...

Info iconThis preview shows pages 1–2. 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: 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.

Page1 / 2

hw2 - Homework 2 CSC 7101, Spring 2011 Due: 28 February...

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

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