CS 536 Notes: Predicate Logic and States
Lecture 2, Mon Aug 30, 2010
A. Why
•
We’ll be using predicates to write speci
fi
cations 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 we’re 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 veri
fi
cation.
•
We look at program execution from a logical standpoint, using logical statements to
describe states our programs might be in; we’ll 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 we’ll 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