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: CS 536 Activities for Lecture 2 Activity 1: Predicate Calculus A. Why? Well be using predicates to write specifications for programs. B. Outcomes At the end of this activity you should: Be able to read and write predicates. Be able to logically negate predicates. Be able to translate informal descriptions of properties on integers and arrays into formal predicates and predicate functions. C. Questions 1. What do we get if we add the redundant parentheses back to ( x . y . z . x y x z z y x > z z y ) ? 2. (a) Are there any redundant parentheses in ( x . ( y . x > y ) ( y . x < y ))? [Whats interesting is to ask if the ones around the first existential are redundant.] (b) If we replace the y s in ( y . x < y ) with z s, do we change the meaning of the predicate? 3. Let P(x,y) be a predicate function (i.e., given values for x and y , it yields true or false). Are the predicates ( x . y . P(x,y) ) and ( y . x . P(x,y) ) equivalent? (I.e., the regardless of how P(x,y) is defined, the first universal is true iff the second universal is true.) 4. Again, assume P(x,y) is a predicate function. Are the predicates ( x . y . P(x,y) ) and ( y . x . P(x,y) ) equivalent?...
View Full Document
- Fall '08