This preview shows pages 1–3. 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 Notes: Predicate Logic and States Lecture 2, Mon Aug 30, 2010 A. Why Well be using predicates to write specifications for programs. Predicates and programs have meaning relative to states. B. Outcomes After this lecture, you should Understand what a predicate is, how to write them, and see a basic set of logical rules for transforming them. See the connection between formal and informal descriptions of some simple predicates. Understand what a state is, how were representing them, and how they connect to programs, expressions, predicates, and proofs. C. No Class Next Week! Monday September 6 is a holiday, Labor Day: No class. D. Last Time: Science of Programming; Propositional Logic Science of Programming is about program verification. We look at program execution from a logical standpoint, using logical statements to describe states our programs might be in; well connect program execution to changes in logical statements. So in the meantime we need to review/study logic, programs, states, and execution. We looked at propositional logic. Proposition letters (boolean variables), the connectives , , , , and . Truth tables, logical tautologies, contradictions, equivalence, entailment Basic and derived proof rules for propositional logic. Today well extend this to the predicate calculus, look at states, expressions, and values of expressions. E. Predicate Logic In propositional logic, we assert truths about boolean values; in predicate logic, we assert truths about values from one or more domains of discourse like the integers. We extend propositional logic with domains (sets of values), variables whose values range over these domains, and operations on values (e.g. addition). E.g., with the integers we add the set , operations like +, , *, /, % (mod), and the relations =, , <, >, , and . A predicate is a logical assertion that describes some property of values. Illinois Institute of Technology Notes for Lecture 2 CS 536: Science of Programming - 1 of 7 - James Sasaki, 2010 To describe properties involving values, we add basic relations on values (e.g., less- than), and we add quantified predicates so that we can talk about properties relative to sets of values. E.g., for all integers x , either x is negative or nonnegative. A universally quantified predicate (or just universal for short) has the form ( x S . P ) where S is a set and P (the body of the universal) is a predicate involving x . E.g., every natural number > 1 is is < its own square: ( x . x > 1 x < x ). Often we leave out the set if it is understood. E.g., ( x . x > 1 x < x )....
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.
- Fall '08