Act02_Pred_Logic_and_States

Act02_Pred_Logic_and_States - CS 536 Activities for Lecture...

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: CS 536 Activities for Lecture 2 Activity 1: Predicate Calculus A. Why? • We’ll 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 ))? [What’s 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

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

Act02_Pred_Logic_and_States - CS 536 Activities for Lecture...

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