hw5 - Homework 5 CSC 7101, Spring 2011 Due: 4 May 2011 This...

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

View Full Document Right Arrow Icon
Homework 5 CSC 7101, Spring 2011 Due: 4 May 2011 This homework is just for practice. You don’t need to hand it in. 1. Consider Dijkstra’s guarded conditional: a c A ::= if a be A 1 → a c A 1 [] a be A 2 → a c A 2 [] a be A 3 → a c A 3 fi where if and fi are keywords, a be A i are boolean expressions and a c A i are commands. (Dijkstra’s guarded conditional has arbitrarily many clauses; we’ll restrict ourselves to exactly three for simplicity.) The guarded conditional is a generalization of the if-statement with multiple conditions ( a be A 1 . . . a be A 3 ) and multiple branches ( a c A 1 . . . a c A 3 ). The boolean expressions are guards for the commands that follow them. A command a c A i can only be executed if its guard a be A i is true. If more than one guard is true, one of the commands whose guard is true is chosen nondeterministically (at random) to be executed. DeFne the denotational semantics of this command. Since we are dealing with commands, you need to deFne a semantic function with a state argument. In the semantic domains in denotational semantics,
Background image of page 1

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

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

Page1 / 2

hw5 - Homework 5 CSC 7101, Spring 2011 Due: 4 May 2011 This...

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