CH 1
CH 1
Proofs
Propositional Logic
Section Summary
Propositions
Connectives
Negation
Conjunction
Disjunction
Implication; contrapositive, inverse, converse
Biconditional
Truth Tables
Propositions
Constructing Propositions
Propositional Variables: p, q, r, s, …
The proposition that is always true is denoted by T and the proposition that is
always false is denoted by F.
Compound Propositions; constructed from logical connectives and other
propositions
Negation ¬
Conjunction ∧
Disjunction ∨
Implication→
Biconditional ↔
Compound Propositions: Negation
p ¬p
T F
F T
and
The conjunction of propositions p and q is denoted by p ∧ q and has this
truth table:
p q p∧q
T T T
T F F
F T F
F F F
p q p ∨q
T T T
T F T
F T T
F F F
p q p →q
T T T
T F F
F T T
F F T
Example: If p denotes “I am at home.” and q denotes “It is raining.”
then p →q denotes “If I am at home then it is raining.”
In p →q , p is the hypothesis (antecedent or premise) and q is the
conclusion (or consequence).
Understanding Implication
if p, then q p implies q
if p, q p only if q
q unless ¬p q when p
q if p q when p
q whenever p p is sufficient for q
q follows from p q is necessary for p
p q p ↔q
T T T
T F F
F T F
F F T
Two propositions are equivalent if they always have the same truth value.
Example: Show using a truth table that the biconditional is not equivalent to
the contrapositive.
Solution:
p q ¬p ¬q p ↔q ¬q → ¬ p
T T F F T T
T F F T F F
F T T F F T
F F T T T T
Using a Truth Table to Show Non-
Equivalence
Example: Show using truth tables that neither the converse nor inverse of an
implication are not equivalent to the implication.
Solution:
p q ¬p ¬q p →q ¬ p →¬ q q→p
T T F F T T T
T F F T F T T
F T T F T F F
F F T T F T T
Precedence of Logical Operators
Operator Precedence
1
2
3
4
5
p q r is equivalent to (p q)
r
If the intended meaning is p (q
r )
then parentheses must be used.
Applications of
Propositional Logic
Applications of Propositional Logic:
If p or q then not
r.
Example
The inverter (NOT gate)takes an input bit and produces the negation of that bit.
The OR gate takes two input bits and produces the value equivalent to the disjunction of the two
bits.
The AND gate takes two input bits and produces the value equivalent to the conjunction of the two
bits.
More complicated digital circuits can be constructed by combining these basic circuits to
produce the desired output given the input signals by building a circuit for each piece of
the output expression and then combining them. For example:
Diagnosis of Faults in an Electrical
System (Optional)
AI Example (from Artificial Intelligence: Foundations of Computational
Agents by David Poole and Alan Mackworth, 2010)
Need to represent in propositional logic the features of a piece of
machinery or circuitry that are required for the operation to produce
observable features. This is called the Knowledge Base (KB).
We also have observations representing the features that the system is
exhibiting now.
Electrical System Diagram (optional)
Outside
s1 cb1 Power
We assume that the components are working ok, unless we are forced to
assume otherwise. These atoms are called assumables.
The assumables (ok_cb1, ok_s1, ok_s2, ok_s3, ok_l1, ok_l2) represent the
assumption that we assume that the switches, lights, and circuit breakers are ok.
If the system is working correctly (all assumables are true), the observations and
the knowledge base are consistent (i.e., satisfiable).
The augmented knowledge base is clearly not consistent if the assumables are
all true. The switches are both up, but the lights are not lit. Some of the
assumables must then be false. This is the basis for the method to diagnose
possible faults in the system.
A diagnosis is a minimal set of assumables which must be false to explain the
observations of the system.
Diagnostic Results (opt)
See Artificial Intelligence: Foundations of Computational Agents (by David Poole and
Alan Mackworth, 2010) for details on this problem and how the method of
consistency based diagnosis can determine possible diagnoses for the electrical
system.
The approach yields 7 possible faults in the system. At least one of these must hold:
Circuit Breaker 1 is not ok.
Both Switch 1 and Switch 2 are not ok.
Both Switch 1 and Light 2 are not ok.
Both Switch 2 and Switch 3 are not ok.
Both Switch 2 and Light 2 are not ok.
Both Light 1 and Switch 3 are not ok.
Both Light 1 and Light 2 are not ok.