Act12_Array_Parallel

Act12_Array_Parallel - Array Assignments; Parallelism CS...

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: Array Assignments; Parallelism CS 536, Mon Nov 22, 2 1 Activity 12.1: Array Assignment A. Why? Array assignments arent like assignments to plain variables because the actual item to change cant be determined until runtime. We can handle this by e x tending our notion of assignment and/or substitution. B. Outcomes At the end of this activity you should: Be able to perform te x tual substitution to replace an array element. Be able to calculate the wp of an array element assignment. C. Questions For each of the questions below, calculate the given weakest precondition. Then try logically simplifying it to something easier to read. 1. What is wp ( b[0]:= 9 , x > b[i] )? (x > b[i])[9/b[0] is x > if i = 0 then 9 else b[i] fi 2. What is wp ( b[i]:= b[j] , b[k] = )? (b[k] = 0)[b[j]/b[i]] is if k = i then b[j] else b[k] fi = 0 3. What is wp ( b[i]:= b[j] , b[j] = z )? (b[j] = z)[b[j]/b[i]] is (if j = i then b[j] else b[j] fi) = z b[j] = z 4. What is wp ( b[i]:= 1 , b[i] = b[j] )?...
View Full Document

This note was uploaded on 04/17/2011 for the course CS 536 taught by Professor Cs536 during the Fall '08 term at Illinois Tech.

Page1 / 3

Act12_Array_Parallel - Array Assignments; Parallelism CS...

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