Michael Genesereth, Introduction To Logic-Morgan (2017)
Michael Genesereth, Introduction To Logic-Morgan (2017)
ird Edition
Michael Genesereth
Stanford University
Eric J. Kao
VMware, Inc.
M
&C Morgan & cLaypool publishers
Copyright © 2017 by Morgan & Claypool
DOI 10.2200/S00734ED2V01Y201609CSL008
Lecture #8
Series ISSN
Synthesis Lectures on Computer Science
Print 1932-1228 Electronic 1932-1686
ABSTRACT
is book is a gentle but rigorous introduction to Formal Logic. It is intended primarily for use
at the college level. However, it can also be used for advanced secondary school students, and it
can be used at the start of graduate school for those who have not yet seen the material.
e approach to teaching logic used here emerged from more than 20 years of teaching
logic to students at Stanford University and from teaching logic to tens of thousands of others
via online courses on the World Wide Web. e approach differs from that taken by other books
in logic in two essential ways, one having to do with content, the other with form.
Like many other books on logic, this one covers logical syntax and semantics and proof
theory plus induction. However, unlike other books, this book begins with Herbrand semantics
rather than the more traditional Tarskian semantics. is approach makes the material consider-
ably easier for students to understand and leaves them with a deeper understanding of what logic
is all about.
In addition to this text, there are online exercises (with automated grading), online logic
tools and applications, online videos of lectures, and an online forum for discussion. ey are
available at
http://intrologic.stanford.edu//.
KEYWORDS
Formal Logic, Symbolic Logic, Propositional Logic, Herbrand Logic, Relational
Logic, deduction, reasoning, Artificial Intelligence
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Possible Worlds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Logical Sentences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Logical Entailment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.5 Logical Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.6 Formalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.7 Automation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.8 Reading Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.9 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2 Propositional Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.2 Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.3 Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.4 Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.5 Satisfaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.6 Example–Natural Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.7 Example–Digital Circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5 Propositional Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.2 Clausal Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.3 Resolution Principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.4 Resolution Reasoning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6 Relational Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.2 Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.3 Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.4 Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
6.5 Satisfaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.6 Example–Sorority World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
6.7 Example–Blocks World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
6.8 Example–Modular Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
6.9 Logical Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
6.10 Logical Entailment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
6.11 Relational Logic and Propositional Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
6.12 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
7 Relational Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.2 Truth Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.3 Semantic Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.4 Boolean Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.5 Non-Boolean Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
7.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
8 Relational Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
8.2 Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
8.3 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
8.4 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
8.5 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
8.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
11 Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
11.2 Domain Closure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
11.3 Linear Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
11.4 Tree Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
11.5 Structural Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
11.6 Multidimensional Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
11.7 Embedded Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
11.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
12 Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
12.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
12.2 Clausal Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
12.3 Unification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
12.4 Resolution Principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
12.5 Resolution Reasoning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
12.6 Unsatisfiability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
12.7 Logical Entailment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
12.8 Answer Extraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
12.9 Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
12.10 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Preface
is book is a first course in Formal Logic. It is intended primarily for use at the college level.
However, it can also be used for advanced secondary school students, and it can be used at the
start of graduate school for those who have not yet seen the material.
ere are just two prerequisites. e book presumes that the student understands sets and
set operations, such as union, intersection, and so forth. It also presumes that the student is
comfortable with symbolic manipulation, as used, for example, in solving high-school algebra
problems. Nothing else is required.
e approach to teaching Logic used here emerged from more than 10 years of experience
in teaching the logical foundations of Artificial Intelligence and more than 20 years of experience
in teaching Logic for Computer Scientists. e result of this experience is an approach that differs
from that taken by other books in Logic in two essential ways, one having to do with content,
the other with form.
e primary difference in content concerns that semantics of the logic that is taught. Like
many other books on Logic, this one covers first-order syntax and first-order proof theory plus
induction. However, unlike other books, this book starts with Herbrand semantics rather than
the more traditional Tarskian semantics.
In Tarskian semantics, we define an interpretation as a universe of discourse together with
a function (1) that maps the object constants of our language to objects in a universe of discourse
and (2) that maps relation constants to relations on that universe. We define variable assignments
as assignments to variables. We define the semantics of quantified expressions as variations on
variable assignments, saying, for example, that a universally quantified sentence is true for a given
interpretation if and only if it is true for every variation of the given variable assignment. It is a
mouthful to say and even harder for students to understand.
In Herbrand semantics, we start with the object constants, function constants, and relation
constants of our language; we define the Herbrand base (i.e. the set of all ground atoms that can be
formed from these components); and we define a model to be an arbitrary subset of the Herbrand
base. at is all. In Herbrand semantics, an arbitrary logical sentence is logically equivalent to the
set of all of its instances. A universally quantified sentence is true if and only if all of its instances
are true. ere are no interpretations and no variable assignments and no variations of variable
assignments.
Although both approaches ultimately end up with the same deductive mechanism, we get
there in two different ways. Deciding to use Herbrand semantics was not an easy to choice to
make. It took years to get the material right and, even then, it took years to use it in teaching
Logic. Although there are some slight disadvantages to this approach, experience suggests that
the advantages significantly outweigh those disadvantages. is approach is considerably easier
for students to understand and leaves them with a deeper understanding of what Logic is all
about. at said, there are some differences between Herbrand semantics and Tarskian semantics
that some educators and theoreticians may find worrisome.
First of all, Herbrand semantics is not compact—there are infinite sets of sentences that
are inconsistent while every finite subset is consistent. e upshot of this is that there are infi-
nite sets of sentences where we cannot demonstrate unsatisfiability with a finite argument within
the language itself. Fortunately, this does not cause any practical difficulties, since in all cases of
practical interest we are working with finite sets of premises.
One significant deficiency of Herbrand semantics vis a vis Tarskian semantics is that with
Herbrand semantics there are restrictions on the cardinality of the worlds that can be axioma-
tized. Since there is no external universe, the cardinality of the structures that can be axiomatized
is equal to the number of ground terms in the language. (To make things easy, we can always
choose a countable language. We can even choose an uncountable language, though doing so
would ruin some of the nice properties of the logic. On the positive side, it is worth noting that in
many practical applications we do not care about uncountable sets. Although there are uncount-
ably many real numbers, remember that there are only countably many floating point numbers.)
More significantly, recall that the Lowenheim-Skolem eorem for Tarskian semantics assures
us that even with Tarskian semantics we cannot write sentences that distinguish models of dif-
ferent infinite cardinalities. So, it is unclear whether this restriction has any real significance for
the vast majority of students.
Herbrand semantics shares most important properties with Tarskian semantics. In the ab-
sence of function constants, the deductive calculus is complete for all finite axiomatizations. In
fact, the calculus derives the exact same set of sentences. When we add functions, we lose this
nice property. However, we get some interesting benefits in return. For one, it is possible with
Herbrand semantics (with functions) to finitely axiomatize arithmetic. As we know from Godel,
this is not possible in a first-order language with Tarskian semantics. e downside is that we
lose completeness. However, it is nice to know that we can at least define things, even though
we cannot prove them. Moreover, as mentioned above, we do not actually lose any consequences
that we are able to deduce with Tarskian semantics.
at’s all for what makes the content of this book different from other books. ere is also
a difference in form. In addition to the text of the book in print and online, there are also online
exercises (with automated grading), some online Logic tools and applications, online videos of
lectures, and an online forum for discussion.
e online offering of the course began with an experimental version early in the 2000s.
While it was moderately successful, we were at that time unable to combine the online mate-
rials and tools and grading program with videos and an online forum, and so we discontinued
the experiment. Recently, it was revived when Sebastian run, Daphne Koller, and Andrew Ng
created technologies for comprehensive offering online courses and began offering highly suc-
cessful online courses of their own. With their technology and the previous materials, it was easy
to create a comprehensive online course in Logic. And this led to completion of this book.
anks also to Pat Suppes, Jon Barwise, John Etchemendy, David-Barker Plummer, and
others at the Stanford Center for the Study of Language and Information for their pioneering
work on online education in Logic. Language, Proof, and Logic (LPL) in particular is a wonder-
ful introduction to Logic and is widely used around the world. Although there are differences
between that volume and this one in theory (especially semantics) and implementation (notably
the use here of browser-based exercises and applications), this volume is in many ways similar to
LPL. In particular, this volume shamelessly copies the LPL tactic of using online worlds (like
Tarski’s World) as a teaching tool for Logic.
And thanks as well to the thousands of students who over the years have had to endure early
versions of this material, in many cases helping to get it right by suffering through experiments
that were not always successful. It is a testament to the intelligence of these students that they
seem to have learned the material despite multiple bumbling mistakes on our part. eir patience
and constructive comments were invaluable in helping us to understand what works and what
does not.
Finally, we need to acknowledge the enormous contributions of a former graduate
student—Tim Hinrichs. He is a co-discoverer of many of the results about Herbrand seman-
tics, without which this book would not have been written.
Introduction
1.1 INTRODUCTION
Logic is one of the oldest intellectual disciplines in human history. It dates back to Aristotle. It
has been studied through the centuries by people like Leibniz, Boole, Russell, Turing, and many
others. And it is still a subject of active investigation today.
We use Logic in just about everything we do. We use the language of Logic to state observa-
tions, to define concepts, and to formalize theories. We use logical reasoning to derive conclusions
from these bits of information. We use logical proofs to convince others of our conclusions.
And we are not alone! Logic is increasingly being used by computers—to prove mathemat-
ical theorems, to validate engineering designs, to diagnose failures, to encode and analyze laws
and regulations and business rules.
Logic is also becoming more common at the interface between man and machine, in “logic-
enabled” computer systems, where users can view and edit logical sentences. ink, for example,
about email readers that allow users to write rules to manage incoming mail messages—deleting
some, moving others to various mailboxes, and so forth based on properties of those messages.
In the business world, eCommerce systems allow companies to encode price rules based on the
product, the customer, the date, and so forth.
Moreover, Logic is sometimes used not just by users in communicating with computer
systems but by software engineers in building those systems (using a programming methodology
known as logic programming ).
is chapter is an overview of Logic as presented in this book. We start with a discussion of
possible worlds and illustrate the notion in an application area known as Sorority World. We then
give an informal introduction to the key elements of Logic—logical sentences, logical entailment,
and logical proofs. We then talk about the value of using a formal language for expressing logical
information instead of natural language. Finally, we discuss the automation of logical reasoning
and some of the computer applications that this makes possible.
Abby ü
Bess ü
Cody ü ü ü
Dana ü
Of course, this is not the only possible state of affairs. Figure 1.2 shows another possible
world. In this world, every girl likes exactly two other girls, and every girl is liked by just two girls.
Abby ü ü
Bess ü ü
Cody ü ü
Dana ü ü
Sentences like these constrain the possible ways the world could be. Each sentence divides
the set of possible worlds into two subsets, those in which the sentence is true and those in which
the sentence is false. Believing a sentence is tantamount to believing that the world is in the first
set. Given two sentences, we know the world must be in the intersection of the set of worlds in
which the first sentence is true and the set of worlds in which the second sentence is true. Ideally,
when we have enough sentences, we know exactly how things stand.
Effective communication requires a language that allows us to express what we know, no
more and no less. If we know the state of the world, then we should write enough sentences to
communicate this to others. If we do not know which of various ways the world could be, we
need a language that allows us to express only what we know. e beauty of Logic is that it gives
us a means to express incomplete information when that is all we have and to express complete
information when full information is available.
Abby ü Abby ü ü
Bess ü Bess ü
Cody ü ü ü Cody ü ü ü
Dana ü Dana ü
Abby ü Abby ü ü
Bess ü Bess ü
Cody ü ü ü Cody ü ü ü
Dana ü ü Dana ü ü
One way to check whether a set of sentences logically entails a conclusion is to examine the
set of all worlds in which the given sentences are true. For example, in our case, we notice that,
in every world that satisfies our sentences, Bess likes Cody, so the statement that Bess likes Cody
is a logical conclusion from our set of sentences.
1.6 FORMALIZATION
So far, we have illustrated everything with sentences in English. While natural language works
well in many circumstances, it is not without its problems. Natural language sentences can be
complex; they can be ambiguous; and failing to understand the meaning of a sentence can lead
to errors in reasoning.
Even very simple sentences can be troublesome. Here we see two grammatically legal sen-
tences. ey are the same in all but the last word, but their structure is entirely different. In the
first, the main verb is blossoms, while in the second blossoms is a noun and the main verb is sank.
e cherry blossoms in the Spring.
e cherry blossoms in the Spring sank.
As another example of grammatical complexity, consider the following excerpt taken from
the University of Michigan lease agreement. e sentence in this case is sufficiently long and
the grammatical structure sufficiently complex that people must often read it several times to
understand precisely what it says.
e University may terminate this lease when the Lessee, having made application and
executed this lease in advance of enrollment, is not eligible to enroll or fails to enroll in the
University or leaves the University at any time prior to the expiration of this lease, or for
violation of any provisions of this lease, or for violation of any University regulation rela-
tive to resident Halls, or for health reasons, by providing the student with written notice of
this termination 30 days prior to the effective date of termination, unless life, limb, or prop-
erty would be jeopardized, the Lessee engages in the sales of purchase of controlled substances
in violation of federal, state or local law, or the Lessee is no longer enrolled as a student,
or the Lessee engages in the use or possession of firearms, explosives, inflammable liquids,
fireworks, or other dangerous weapons within the building, or turns in a false alarm, in
which cases a maximum of 24 hours notice would be sufficient.
As an example of ambiguity, suppose I were to write the sentence ere’s a girl in the room
with a telescope. See Figure 1.6 for two possible meanings of this sentence. Am I saying that there
is a girl in a room containing a telescope? Or am I saying that there is a girl in the room and she
is holding a telescope?
Scientists Grow Frog Eyes and Ears British Left Waffles On Falkland Islands
e Daily Camera, Boulder, 2000
As an illustration of errors that arise in reasoning with sentences in natural language, con-
sider the following examples. In the first, we use the transitivity of the better relation to derive a
conclusion about the relative quality of champagne and soda from the relative quality of cham-
pagne and beer and the relative quality or beer and soda. So far so good.
Champagne is better than beer.
Beer is better than soda.
erefore, champagne is better than soda.
Now, consider what happens when we apply the same transitivity rule in the case illustrated
below. e form of the argument is the same as before, but the conclusion is somewhat less
believable. e problem in this case is that the use of nothing here is syntactically similar to the
use of beer in the preceding example, but in English it means something entirely different.
Bad sex is better than nothing.
Nothing is better than good sex.
erefore, bad sex is better than good sex.
Logic eliminates these difficulties through the use of a formal language for encoding infor-
mation. Given the syntax and semantics of this formal language, we can give a precise definition
for the notion of logical conclusion. Moreover, we can establish precise reasoning rules that pro-
duce all and only logical conclusions.
In this regard, there is a strong analogy between the methods of Formal Logic and those
of high school algebra. To illustrate this analogy, consider the following algebra problem.
Xavier is three times as old as Yolanda. Xavier’s age and Yolanda’s age add up to twelve.
How old are Xavier and Yolanda?
Typically, the first step in solving such a problem is to express the information in the form
of equations. If we let x represent the age of Xavier and y represent the age of Yolanda, we can
capture the essential information of the problem as shown below.
x 3y D 0
x C y D 12
Using the methods of algebra, we can then manipulate these expressions to solve the prob-
lem. First we subtract the second equation from the first.
x 3y D 0
x C y D 12
4y D 12
Next, we divide each side of the resulting equation by 4 to get a value for y . en substi-
tuting back into one of the preceding equations, we get a value for x .
xD9
yD3
If Mary loves Pat, then Mary loves Quincy. If it is Monday and raining, then Mary loves
Pat or Quincy. If it is Monday and raining, does Mary love Quincy?
As with the algebra problem, the first step is formalization. Let p represent the possibility
that Mary loves Pat; let q represent the possibility that Mary loves Quincy; let m represent the
possibility that it is Monday; and let r represent the possibility that it is raining.
With these abbreviations, we can represent the essential information of this problem with
the following logical sentences. e first says that p implies q , i.e., if Mary loves Pat, then Mary
loves Quincy. e second says that m and r implies p or q , i.e., if it is Monday and raining, then
Mary loves Pat or Mary loves Quincy.
p ) q
m^r ) p_q
As with Algebra, Formal Logic defines certain operations that we can use to manipulate
expressions. e operation shown below is a variant of what is called Propositional Resolution. e
expressions above the line are the premises of the rule, and the expression below is the conclusion.
p1 ^ ... ^ pk ) q1 _ .. _ ql
r1 ^ ... ^ rm ) s1 _ ... _ sn
p1 ^ ... ^ pk ^ r1 ^ ... ^ rm ) q1 _ ... _ ql _ s1 _ ... _ sn
ere are two elaborations of this operation. (1) If a proposition on the left hand side of
one sentence is the same as a proposition on the right hand side of the other sentence, it is okay to
drop the two symbols, with the proviso that only one such pair may be dropped. (2) If a constant
is repeated on the same side of a single sentence, all but one of the occurrences can be deleted.
We can use this operation to solve the problem of Mary’s love life. Looking at the two
premises above, we notice that p occurs on the left-hand side of one sentence and the right-hand
side of the other. Consequently, we can cancel the p and thereby derive the conclusion that, if is
Monday and raining, then Mary loves Quincy or Mary loves Quincy.
p ) q
m^r ) p_q
m^r ) q_q
Dropping the repeated symbol on the right hand side, we arrive at the conclusion that, if
it is Monday and raining, then Mary loves Quincy.
m^r ) q_q
m^r ) q
is example is interesting in that it showcases our formal language for encoding logical
information. As with algebra, we use symbols to represent relevant aspects of the world in ques-
tion, and we use operators to connect these symbols in order to express information about the
things those symbols represent.
e example also introduces one of the most important operations in Formal Logic, viz.
Resolution (in this case a restricted form of Resolution). Resolution has the property of being
complete for an important class of logic problems, i.e., it is the only operation necessary to solve
any problem in the class.
1.7 AUTOMATION
e existence of a formal language for representing information and the existence of a corre-
sponding set of mechanical manipulation rules together have an important consequence, viz. the
possibility of automated reasoning using digital computers.
e idea is simple. We use our formal representation to encode the premises of a problem
as data structures in a computer, and we program the computer to apply our mechanical rules
in a systematic way. e rules are applied until the desired conclusion is attained or until it is
determined that the desired conclusion cannot be attained. (Unfortunately, in some cases, this
determination cannot be made; and the procedure never halts. Nevertheless, as discussed in later
chapters, the idea is basically sound.)
Although the prospect of automated reasoning has achieved practical realization only in
the last few decades, it is interesting to note that the concept itself is not new. In fact, the idea of
building machines capable of logical reasoning has a long tradition.
One of the first individuals to give voice to this idea was Leibnitz. He conceived of “a
universal algebra by which all knowledge, including moral and metaphysical truths, can some day
be brought within a single deductive system.” Having already perfected a mechanical calculator
for arithmetic, he argued that, with this universal algebra, it would be possible to build a machine
capable of rendering the consequences of such a system mechanically.
Boole gave substance to this dream in the 1800s with the invention of Boolean algebra and
with the creation of a machine capable of computing accordingly.
e early twentieth century brought additional advances in Logic, notably the invention of
the predicate calculus by Russell and Whitehead and the proof of the corresponding completeness
and incompleteness theorems by Godel in the 1930s.
e advent of the digital computer in the 1940s gave increased attention to the prospects for
automated reasoning. Research in artificial intelligence led to the development of efficient algo-
rithms for logical reasoning, highlighted by Robinson’s invention of resolution theorem proving
in the 1960s.
Today, the prospect of automated reasoning has moved from the realm of possibility to that
of practicality, with the creation of logic technology in the form of automated reasoning systems,
such as Vampire, Prover9, the Prolog Technology eorem Prover, Epilog, and others.
e emergence of this technology has led to the application of logic technology in a wide
variety of areas. e following paragraphs outline some of these uses.
Mathematics. Automated reasoning programs can be used to check proofs and, in some
cases, to produce proofs or portions of proofs.
Engineering. Engineers can use the language of Logic to write specifications for their prod-
ucts and to encode their designs. Automated reasoning tools can be used to simulate designs and
in some cases validate that these designs meet their specification. Such tools can also be used to
diagnose failures and to develop testing programs.
Database Systems. By conceptualizing database tables as sets of simple sentences, it is pos-
sible to use Logic in support of database systems. For example, the language of Logic can be used
to define virtual views of data in terms of explicitly stored tables, and it can be used to encode
constraints on databases. Automated reasoning techniques can be used to compute new tables, to
detect problems, and to optimize queries.
Data Integration e language of Logic can be used to relate the vocabulary and structure
of disparate data sources, and automated reasoning techniques can be used to integrate the data
in these sources.
Logical Spreadsheets. Logical spreadsheets generalize traditional spreadsheets to include log-
ical constraints as well as traditional arithmetic formulas. Examples of such constraints abound.
For example, in scheduling applications, we might have timing constraints or restrictions on who
can reserve which rooms. In the domain of travel reservations, we might have constraints on
adults and infants. In academic program sheets, we might have constraints on how many courses
of varying types that students must take.
Law and Business. e language of Logic can be used to encode regulations and business
rules, and automated reasoning techniques can be used to analyze such regulations for inconsis-
tency and overlap.
Although Logic is a single field of study, there is more than one logic in this field. In the three
main units of this book, we look at three different types of logic, each more sophisticated than
the one before.
Propositional Logic is the logic of propositions. Symbols in the language represent “condi-
tions” in the world, and complex sentences in the language express interrelationships among these
conditions. e primary operators are Boolean connectives, such as and, or, and not.
Relational Logic expands upon Propositional Logic by providing a means for explicitly talk-
ing about individual objects and their interrelationships (not just monolithic conditions). In order
to do so, we expand our language to include object constants and relation constants, variables and
quantifiers.
Herbrand Logic takes us one step further by providing a means for describing worlds with
infinitely many objects. e resulting logic is much more powerful than Propositional Logic and
Relational Logic. Unfortunately, as we shall see, many of the nice computational properties of
the first two logics are lost as a result.
Despite their differences, there are many commonalities among these logics. In particular,
in each case, there is a language with a formal syntax and a precise semantics; there is a notion of
logical entailment; and there are legal rules for manipulating expressions in the language.
ese similarities allow us to compare the logics and to gain an appreciation of the fun-
damental tradeoff between expressiveness and computational complexity. On the one hand, the
introduction of additional linguistic complexity makes it possible to say things that cannot be
said in more restricted languages. On the other hand, the introduction of additional linguistic
flexibility has adverse effects on computability. As we proceed though the material, our attention
will range from the completely computable case of Propositional Logic to a variant that is not at
all computable.
One final comment. In the hopes of preventing difficulties, it is worth pointing out a poten-
tial source of confusion. is book exists in the meta world. It contains sentences about sentences;
it contains proofs about proofs. In some places, we use similar mathematical symbology both for
sentences in Logic and sentences about Logic. Wherever possible, we try to be clear about this
distinction, but the potential for confusion remains. Unfortunately, this comes with the territory.
We are using Logic to study Logic. It is our most powerful intellectual tool.
RECAP
Logic is the study of information encoded in the form of logical sentences. Each logical sentence
divides the set of all possible world into two subsets—the set of worlds in which the sentence
is true and the set of worlds in which the set of sentences is false. A set of premises logically
entails a conclusion if and only if the conclusion is true in every world in which all of the premises
are true. Deduction is a form of symbolic reasoning that produces conclusions that are logically
entailed by premises (distinguishing it from other forms of reasoning, such as induction, abduction,
and analogical reasoning ). A proof is a sequence of simple, more-or-less obvious deductive steps
that justifies a conclusion that may not be immediately obvious from given premises. In Logic, we
usually encode logical information as sentences in formal languages; and we use rules of inference
appropriate to these languages. Such formal representations and methods are useful for us to use
ourselves. Moreover, they allow us to automate the process of deduction, though the computability
of such implementations varies with the complexity of the sentences involved.
1.9 EXERCISES
1.1. Consider the state of the Sorority World depicted below.
Abby ü ü
Bess ü
Cody ü ü ü
Dana ü ü
For each of the following sentences, say whether or not it is true in this state of the world.
(a) Abby likes Dana.
(b) Dana does not like Abby.
(c) Abby likes Cody or Dana.
(d ) Abby likes someone who likes her.
(e) Somebody likes everybody.
1.2. Come up with a table of likes and dislikes for the Sorority World that makes all of the
following sentences true. Note that there is more than one such table.
Dana likes Cody.
Abby does not like Dana.
Bess likes Cody or Dana.
Abby likes everyone whom Bess likes.
Cody likes everyone who likes her.
Nobody likes herself.
1.3. Consider a set of Sorority World premises that are true in the four states of Sorority
World shown in Figure 1.4. For each of the following sentences, say whether or not it is
logically entailed by these premises.
(a) Abby likes Bess or Bess likes Abby.
(b) Somebody likes herself.
(c) Everybody likes somebody.
1.4. Say whether or not the following reasoning patterns are logically correct.
(a) All x are z . All y are z . erefore, some x are y .
(b) Some x are y . All y are z . erefore, some x are z .
(c) All x are y . Some y are z . erefore, some x are z .
CHAPTER 2
Propositional Logic
2.1 INTRODUCTION
Propositional Logic is concerned with propositions and their interrelationships. e notion of a
proposition here cannot be defined precisely. Roughly speaking, a proposition is a possible condi-
tion of the world that is either true or false, e.g., the possibility that it is raining, the possibility
that it is cloudy, and so forth. e condition need not be true in order for it to be a proposition.
In fact, we might want to say that it is false or that it is true if some other proposition is true.
In this chapter, we first look at the syntactic rules that define the language of Propositional
Logic. We then introduce the notion of a truth assignment and use it to define the meaning
of Propositional Logic sentences. After that, we present a mechanical method for evaluating
sentences for a given truth assignment, and we present a mechanical method for finding truth
assignments that satisfy sentences. We conclude with some examples of Propositional Logic in
formalizing Natural Language and Digital Circuits.
2.2 SYNTAX
In Propositional Logic, there are two types of sentences—simple sentences and compound sen-
tences. Simple sentences express simple facts about the world. Compound sentences express log-
ical relationships between the simpler sentences of which they are composed.
Simple sentences in Propositional Logic are often called proposition constants or, sometimes,
logical constants. In what follows, we write proposition constants as strings of letters, digits, and
underscores (“_”), where the first character is a lower case letter. For example, raining is a propo-
sition constant, as are rAiNiNg, r32aining, and raining_or_snowing. Raining is not a proposition
constant because it begins with an upper case character. 324567 fails because it begins with a
number. raining-or-snowing fails because it contains hyphens (instead of underscores).
Compound sentences are formed from simpler sentences and express relationships among the
constituent sentences. ere are five types of compound sentences, viz. negations, conjunctions,
disjunctions, implications, and biconditionals.
A negation consists of the negation operator : and an arbitrary sentence, called the target.
For example, given the sentence p , we can form the negation of p as shown below.
(:p )
A conjunction is a sequence of sentences separated by occurrences of the ^ operator and
enclosed in parentheses, as shown below. e constituent sentences are called conjuncts. For ex-
ample, we can form the conjunction of p and q as follows.
(p ^ q )
(p _ q )
(p ) q )
(p , q )
Note that the constituent sentences within any compound sentence can be either simple
sentences or compound sentences or a mixture of the two. For example, the following is a legal
compound sentence.
((p _ q ) ) r )
One disadvantage of our notation, as written, is that the parentheses tend to build up and
need to be matched correctly. It would be nice if we could dispense with parentheses, e.g., sim-
plifying the preceding sentence to the one shown below.
p_q)r
((p _ q ) ) r )
(p _ (q ) r ))
e solution to this problem is the use of operator precedence. e following table gives a
hierarchy of precedences for our operators. e : operator has higher precedence than ^; ^ has
higher precedence than _; and _ has higher precedence than ) and ,.
:
^
_
),
In sentences without parentheses, it is often the case that an expression is flanked by op-
erators, one on either side. In interpreting such sentences, the question is whether the expression
associates with the operator on its left or the one on its right. We can use precedence to make this
determination. In particular, we agree that an operand in such a situation always associates with
the operator of higher precedence. When an operand is surrounded by operators of equal prece-
dence, the operand associates to the right. e following examples show how these rules work in
various cases. e expressions on the right are the fully parenthesized versions of the expressions
on the left.
:p^q ((: p ) ^ q )
p ^ :q (p ^ (: q ))
p^q_r ((p ^ q ) _ r )
p_q^r (p _ (q ^ r ))
p)q)r (p )(q ) r ))
p)q,r (p ) (q , r ))
Note that just because precedence allows us to delete parentheses in some cases does not
mean that we can dispense with parentheses entirely. Consider the example shown earlier. Prece-
dence eliminates the ambiguity by dictating that the sentence without parentheses is an implica-
tion with a disjunction as antecedent. However, this makes for a problem for those cases when
we want to express a disjunction with an implication as a disjunct. In such cases, we must retain
at least one pair of parentheses.
We end the section with two simple definitions that are useful in discussing Propositional
Logic. A propositional vocabulary is a set of proposition constants. A propositional language is the
set of all propositional sentences that can be formed from a propositional vocabulary.
2.3 SEMANTICS
e treatment of semantics in Logic is similar to its treatment in Algebra. Algebra is unconcerned
with the real-world significance of variables. What is interesting are the relationships among the
values of the variables expressed in the equations we write. Algebraic methods are designed to
respect these relationships, independent of what the variables represent.
In a similar way, Logic is unconcerned with the real world significance of proposition con-
stants. What is interesting is the relationship among the truth values of simple sentences and the
truth values of compound sentences within which the simple sentences are contained. As with
Algebra, logical reasoning methods are independent of the significance of proposition constants;
all that matter is the form of sentences.
Although the values assigned to proposition constants are not crucial in the sense just de-
scribed, in talking about Logic, it is sometimes useful to make truth assignments explicit and to
consider various assignments or all assignments and so forth. Such an assignment is called a truth
assignment.
Formally, a truth assignment for a propositional vocabulary is a function assigning a truth
value to each of the proposition constants of the vocabulary. In what follows, we use the digit
1 as a synonym for true and 0 as a synonym for false; and we refer to the value of a constant or
expression under a truth assignment i by superscripting the constant or expression with i as the
superscript.
e assignment shown below is an example for the case of a propositional vocabulary with
just three proposition constants, viz. p , q , and r .
pi D 1
qi D 0
ri D 1
e following assignment is another truth assignment for the same vocabulary.
pi D 0
qi D 0
ri D 1
Note that the formulas above are not themselves sentences in Propositional Logic. Proposi-
tional Logic does not allow superscripts and does not use the = symbol. Rather, these are informal,
metalevel statements about particular truth assignments. Although talking about Propositional
Logic using a notation similar to that of Propositional Logic can sometimes be confusing, it al-
lows us to convey meta-information precisely and efficiently. To minimize problems, in this book
we use such meta-notation infrequently and only when there is little chance of confusion.
Looking at the preceding truth assignments, it is important to bear in mind that, as far as
logic is concerned, any truth assignment is as good as any other. Logic itself does not fix the truth
assignment of individual proposition constants.
On the other hand, given a truth assignment for the proposition constants of a language,
logic does fix the truth assignment for all compound sentences in that language. In fact, it is
possible to determine the truth value of a compound sentence by repeatedly applying the following
rules.
If the truth value of a sentence is true, the truth value of its negation is false. If the truth
value of a sentence is false, the truth value of its negation is true.
' :'
1 0
0 1
e truth value of a conjunction is true if and only if the truth values of its conjuncts are
both true; otherwise, the truth value is false.
' '^
1 1 1
1 0 0
0 1 0
0 0 0
e truth value of a disjunction is true if and only if the truth value of at least one its
disjuncts is true; otherwise, the truth value is false. Note that this is the inclusive or interpretation
of the _ operator and is differentiated from the exclusive or interpretation in which a disjunction
is true if and only if an odd number of its disjuncts are true.
' '_
1 1 1
1 0 1
0 1 1
0 0 0
e truth value of an implication is false if and only if its antecedent is true and its conse-
quent is false; otherwise, the truth value is true. is is called material implication.
' ')
1 1 1
1 0 0
0 1 1
0 0 1
A biconditional is true if and only if the truth values of its constituents agree, i.e., they are
either both true or both false.
' ',
1 1 1
1 0 0
0 1 0
0 0 1
Using these definitions, it is easy to determine the truth values of compound sentences with
proposition constants as constituents. As we shall see in the next section, we can determine the
truth values of compound sentences with other compound sentences as parts by first evaluating
the constituent sentences and then applying these definitions to the results.
We finish up this section with a few definitions for future use. We say that a truth assign-
ment satisfies a sentence if and only if the sentence is true under that truth assignment. We say
that a truth assignment falsifies a sentence if and only if the sentence is false under that truth as-
signment. A truth assignment satisfies a set of sentences if and only if it satisfies every sentence in
the set. A truth assignment falsifies a set of sentences if and only if it falsifies at least one sentence
in the set.
2.4 EVALUATION
Evaluation is the process of determining the truth values of compound sentences given a truth
assignment for the truth values of proposition constants.
As it turns out, there is a simple technique for evaluating complex sentences. We substitute
true and false values for the proposition constants in our sentence, forming an expression with
1s and 0s and logical operators. We use our operator semantics to evaluate subexpressions with
these truth values as arguments. We then repeat, working from the inside out, until we have a
truth value for the sentence as a whole.
As an example, consider the truth assignment i shown below.
pi D 1
qi D 0
ri D 1
Using our evaluation method, we can see that i satisfies (p _ q ) ^ (:q _ r ).
(p _ q ) ^ (: q _ r )
(1 _ 0) ^ (:0 _ 1)
1^ (:0 _ 1)
1^ (1 _ 1)
1^1
1
Now consider truth assignment j defined as follows.
pj D 0
qj D 1
rj D 0
In this case, j does not satisfy (p _ q ) ^ (:q _ r ).
(p _ q ) ^ (:q _ r )
(0 _ 1) ^ (:1 _ 0)
1 ^ (:1 _ 0)
1 ^ (0 _ 0)
1^0
0
Using this technique, we can evaluate the truth of arbitrary sentences in our language.
e cost is proportional to the size of the sentence. Of course, in some cases, it is possible to
economize and do even better. For example, when evaluating a conjunction, if we discover that
the first conjunct is false, then there is no need to evaluate the second conjunct since the sentence
as a whole must be false.
2.5 SATISFACTION
Satisfaction is the opposite of evaluation. We begin with one or more compound sentences and try
to figure out which truth assignments satisfy those sentences. One nice feature of Propositional
Logic is that there are effective procedures for finding truth assignments that satisfy Propositional
Logic sentences. In this section, we look at a method based on truth tables.
A truth table for a propositional language is a table showing all of the possible truth assign-
ments for the proposition constants in the language. e columns of the table correspond to the
proposition constants of the language, and the rows correspond to different truth assignments for
those constants.
e following figure shows a truth table for a propositional language with just three propo-
sition constants (p , q , and r ). Each column corresponds to one proposition constant, and each row
corresponds to a single truth assignment. e truth assignments i and j defined in the preceding
section correspond to the third and sixth rows of this table, respectively.
p q r
1 1 1
1 1 0
1 0 1
1 0 0
0 1 1
0 1 0
0 0 1
0 0 0
Note that, for a propositional language with n proposition constants, there are n columns
in the truth table and 2n rows.
In solving satisfaction problems, we start with a truth table for the proposition constants of
our language. We then process our sentences in turn, for each sentence placing an x next to rows
in the truth table corresponding to truth assignments that do not satisfy the sentence. e truth
assignments remaining at the end of this process are all possible truth assignments of the input
sentences.
As an example, consider the sentence p _ q ) q ^ r . We can find all truth assignments
that satisfy this sentence by constructing a truth table for p , q , and r . See below. We place an x
next to each row that does not satisfy the sentence (rows 2, 3, 4, 6). Finally, we take the remaining
rows (1, 5, 7, 8) as answers.
p q r
1 1 1
x 1 1 0 x
x 1 0 1 x
x 1 0 0 x
0 1 1
x 0 1 0 x
0 0 1
0 0 0
c_f )p
Next, we have the sentence A person is popular only if he is either cool or funny. is is similar
to the previous sentence, but the presence of the phrase only if suggests that the conditionality
goes the other way. It is equivalent to the sentence If a person is popular, then he is either cool or
funny. And this sentence can be translated directly into Propositional Logic as shown below.
p)c_f
A person is popular if and only if he is either cool or funny. e use of the phrase if and only if
suggests a biconditional, as in the translation shown below. Note that this is the equivalent to the
conjunction of the two implications shown above. e biconditional captures this conjunction in
a more compact form.
p,c_f
Finally, we have a negative sentence. ere is no one who is both cool and funny. e word
no here suggests a negation. To make it easier to translate into Propositional Logic, we can first
rephrase this as It is not the case that there is a person who is both cool and funny. is leads directly
to the following encoding.
:(c ^ f )
Note that, just because we can translate sentences into the language of Propositional Logic
does not mean that they are true. e good news is that we can use our evaluation procedure to
determine which sentences are true and which are false?
Suppose we were to imagine a person who is cool and funny and popular, i.e., the propo-
sition constants c and f and p are all true. Which of our sentences are true and which are false.
Using the evaluation procedure described earlier, we can see that, for this person, the first
sentence is true.
c_f )p
(1 _ 1) ) 1
1)1
1
e second sentence is also true.
p)c_f
1 ) (1 _ 1)
1)1
1
Since the third sentence is really just the conjunction of the first two sentences, it is also
true, which we can confirm directly as shown below.
p,c_f
1 , (1 _ 1)
1,1
1
Unfortunately, the fourth sentence is not true, since the person in this case is both cool and
funny.
:(c ^ f )
:(1 ^ 1)
:1
0
In this particular case, three of the sentences are true, while one is false. e upshot of this
is that there is no such person (assuming that the theory expressed in our sentences is correct). e
good news is that there are cases where all four sentences are true, e.g. a person who is cool and
popular but not funny or the case of a person who is funny and popular but not cool. Question to
consider: What about a person is neither cool nor funny nor popular? Is this possible according
to our theory? Which of the sentences would be true and which would be false?
At a given point in time, a node in a circuit can be either on or off. e input nodes are set
from outside the circuit. A gate sets its output either on or off based on the type of gate and the
values of its input nodes. e output of an and gate is on if and only if both of its inputs are on.
e value of an or node is on if and only if at least one of its inputs is on. e output of an xor
gate is on if and only if its inputs disagree with each other.
Given the Boolean nature of signals on nodes and the deterministic character of gates, it
is quite natural to model digital circuits in Propositional Logic. We can represent each node of a
circuit as a proposition constant, with the idea that the node is on if and only if the constant is
true. Using the language of Propositional Logic, we can capture the behavior of gates by writing
sentences relating the values of the inputs nodes and out nodes of the gates.
e sentences shown below capture the five gates in the circuit shown above. Node o must
be on if and only if nodes p and q disagree.
(p ^ :q ) _ (:p ^ q ) , o
r ^o,a
p^q,b
(o ^ :r )_ (:o ^ r ) , s
a_b,c
Once we have done this, we can use our formalization to analyze the circuit - to determine if
it meets it specification, to test whether a particular instance is operating correctly, and to diagnose
the problem in cases here it is not.
RECAP
e syntax of Propositional Logic begins with a set of proposition constants. Compound sentences
are formed by combining simpler sentences with logical operators. In the version of Propositional
Logic used here, there are five types of compound sentences—negations, conjunctions, disjunc-
tions, implications, and biconditionals. A truth assignment for Propositional Logic is a mapping
that assigns a truth value to each of the proposition constants in the language. A truth assignment
satisfies a sentence if and only if the sentences is true under that truth assignment according to
rules defining the logical operators of the language. Evaluation is the process of determining the
truth values of a complex sentence, given a truth assignment for the truth values of proposition
constants in that sentence. Satisfaction is the process of determining whether or not a sentence
has a truth assignment that satisfies it.
2.8 EXERCISES
2.1. Say whether each of the following expressions is a syntactically legal sentence of Propo-
sitional Logic.
(a) p^:p
(b ) :p _ :p
(c ) :(q _ r ) :q ) ::p
(d ) (p ^ q ) _ (p :^ q )
(e ) p _ : q ^ :p _ : q ) p _ q
2.2. Consider a truth assignment in which p is true, q is false, r is true. Use this truth assign-
ment to evaluate the following sentences.
(a) p )q^r
(b ) p )q_r
(c ) p ^q)r
(d ) p ^ q ) :r
(e ) p ^q,q^r
2.3. A small company makes widgets in a variety of constituent materials (aluminum, copper,
iron), colors (red, green, blue, grey), and finishes (matte, textured, coated). Although
there are more than one thousand possible combinations of widget features, the com-
pany markets only a subset of the possible combinations. e following sentences are
constraints that characterize the possibilities. Suppose that a customer places an order
for a copper widget that is both green and blue with a matte coating. Your job is to de-
termine which constraints are satisfied and which are violated.
(a) aluminum _ copper _ iron
(b ) aluminum ) grey
(c ) copper ^ :coated ) red
(d ) coated ^ :copper ) green
(e ) green _ blue , :textured ^ :iron
2.4. Consider the sentences shown below. ere are three proposition constants here, meaning
that there are eight possible truth assignments. How many of these assignments satisfy
all of these sentences?
p_q_r
p)q^r
q):r
2.5. A small company makes widgets in a variety of constituent materials (aluminum, cop-
per, iron), colors (red, green, blue, grey), and finishes (matte, textured, coated). Although
there are more than one thousand possible combinations of widget features, the company
markets only a subset of the possible combinations. e sentences below are some con-
straints that characterize the possibilities. Your job here is to select materials, colors, and
finishes in such a way that all of the product constraints are satisfied. Note that there are
multiple ways this can be done.
Intuitively, we think of two sentences as being equivalent if they say the same thing, i.e., they are
true in exactly the same worlds. More formally, we say that a sentence ' is logically equivalent
to a sentence if and only if every truth assignment that satisfies ' satisfies and every truth
assignment that satisfies satisfies ' .
e sentence :(p _ q ) is logically equivalent to the sentence (:p ^ :q ). If p and q are
both true, then both sentences are false. If either p is true or q is true, then the disjunction in the
first sentence is true and the sentence as a whole false. Similarly, either p is true or q is true, then
one of the conjuncts in the second sentence is false and so the sentence as a whole is false. Since
both sentences are satisfied by the same truth assignments, they are logically equivalent.
By contrast, the sentences (p ^ q ) and (p _ q ) are not logically equivalent. e first is false
when p is true and q is false, while in this situation the disjunction is true. Hence, they are not
logically equivalent.
One way of determining whether or not two sentences are logically equivalent is to check
the truth table for the proposition constants in the language. is is called the truth table method.
(1) First, we form a truth table for the proposition constants and add a column for each of the
sentences. (2) We then evaluate the two expressions. (3) Finally, we compare the results. If the
values for the two sentences are true in every case, then the two sentences are logically equivalent;
otherwise, they are not.
As an example, let’s use this method to show that :(p _ q ) is logically equivalent to (:p ^
:q ). We set up our truth table, add a column for each of our two sentences, and evaluate them for
each truth assignment. Having done so, we notice that every row that satisfies the first sentence
also satisfies the second. Hence, the sentences are logically equivalent.
p q :.p _ q/ :p ^ :q
1 1 0 0
1 0 0 0
0 1 0 0
0 0 1 1
Now, let’s do the same for (p ^ q ) and (p _ q ). We set up our table as before and evaluate
our sentences. In this case, there is only one row that satisfies first sentence while three rows satisfy
the second. Consequently, they are not logically equivalent.
p q p^q p_q
1 1 1 1
1 0 0 1
0 1 0 1
0 0 0 0
p q p_q :p _ :q :p ^ :q
1 1 1 0 0
1 0 1 1 0
0 1 1 1 0
0 0 0 1 1
e distinction between entailment and consistency is a subtle one and deserves some at-
tention. Just because two sentences are consistent does not mean that they are logically equivalent
or that either sentence logically entails the other.
Consider the sentences in the previous example. As we have seen, the first sentence and the
second sentence are logically consistent, but they are clearly not logically equivalent and neither
sentence logically entails the other.
Conversely, if one sentence logically entails another this does not necessarily mean that
the sentences are consistent. is situation occurs when one of the sentences is unsatisfiable. If
a sentence is unsatisfiable, there are no truth assignments that satisfy it. So, by definition, every
truth assignment that satisfies the sentence (there are none) trivially satisfies the other sentence.
An interesting consequence of this fact is that any unsatisfiable sentence or set of sentences
logically entails everything. Weird fact, but it follows directly from our definitions. And it makes
clear why we want to avoid unsatisfiable sets of sentences in logical reasoning.
Before we end this chapter, it is worth noting that there are some strong connections between
logical properties like validity and satisfiability and the logical relationships introduced in the
preceding three sections.
First of all, there is a connection between the logical equivalence of two sentences and the
validity of the biconditional sentence built from the two sentences. In particular, we have the
following theorem expressing this connection.
Equivalence eorem: A sentence ' and a sentence are logically equivalent if and only if the
sentence (' , ) is valid.
Why is this true? Consider the definition of logical equivalence. Two sentences are logically
equivalent if and only if they are satisfied by the same set of truth assignments. Now recall the
semantics of sentences involving the biconditional operator. A biconditional is true if and only if
the truth values of the conditional sentences are the same. Clearly, if two sentences are logically
equivalent, they are satisfied by the same truth assignments, and so the corresponding bicondi-
tional must be valid. Conversely, if a biconditional is valid, the two component sentences must
be satisfied by the same truth assignments and so they are logically equivalent.
ere is a similar connection between logical entailment between two sentences and the
validity of the corresponding implication. And there is a natural extension to cases of logical
entailment involving finite sets of sentences. e following theorem summarizes these results.
Deduction eorem: A sentence ' logically entails a sentence if and only if (' ) ) is valid.
More generally, a finite set of sentences {' 1 , ... , ' n } logically entails ' if and only if the compound
sentence (' 1 ^ ... ^ ' n ) ' ) is valid.
If a sentence ' logically entails a sentence , it means that any truth assignment that satis-
fies ' also satisfies . Looking at the semantics of implications, we see that an implication is true
if and only if every truth assignment that makes the antecedent true also makes the consequent
true. Consequently, logical entailment holds exactly when the corresponding implication is valid.
ere is also a connection between logical entailment and unsatisfiability. In particular, if a
set of sentences logically entails a sentence ' , then together with the negation of ' must be
unsatisfiable. e reverse is also true.
Unsatisfiability eorem: A set of sentences logically entails a sentence ' if and only if the set
of sentences [ {:' } is unsatisfiable.
Suppose that logically entails ' . If a truth assignment satisfies , then it must also satisfy
' . But then it cannot satisfy :' . erefore, [ {:' } is unsatisfiable. Suppose that [{:' } is
unsatisfiable. en every truth assignment that satisfies must fail to satisfy :' , i.e., it must
satisfy ' . erefore, must logically entail ' .
An interesting consequence of this result is that we can determine logical entailment by
checking for unsatisfiability. is turns out to be useful in various logical proof methods, as de-
scribed in the following chapters.
Finally, consider the definition of logical consistency. A sentence ' is logically consistent
with a sentence if and only if there is a truth assignment that satisfies both ' and . is is
equivalent to saying that the sentence (' ^ ) is satisfiable.
Consistency eorem: A sentence ' is logically consistent with a sentence if and only if the
sentence (' ^ ) is satisfiable. More generally, a sentence ' is logically consistent with a finite set
of sentences {' 1 , ... , ' n } if and only if the compound sentence (' 1 ^ ... ^ ' n ^ ' ) is satisfiable.
In thinking about these various connections, the main thing to keep in mind is that logical
properties and logical relationships are metalevel. ey are things we assert in talking about log-
ical sentences; they are not sentences within our formal language. By contrast, implications and
biconditionals and conjunctions are statements within our formal language; they are not met-
alevel statements. What the preceding paragraphs tell us is that we can implicitly express some
logical relationships within our formal language by writing the corresponding biconditionals and
implications and conjunctions and checking for the logical properties of these sentences.
RECAP
A sentence is valid if and only if it is satisfied by every truth assignment. A sentence is unsat-
isfiable if and only if it is not satisfied by any truth assignment. A sentence is contingent if and
only if it is both satisfiable and falsifiable, i.e., it is neither valid nor unsatisfiable. A sentence is
satisfiable if and only if it is either valid or contingent. A sentence is falsifiable if and only if it is
unsatisfiable or contingent. A sentence ' is logically equivalent to a sentence if and only if every
truth assignment that satisfies ' satisfies and every truth assignment that satisfies satisfies
' . A set of sentences logically entails a sentence ' (written |= ' ) if and only if every truth
assignment that satisfies also satisfies ' . A sentence ' is consistent with a set of sentences if
and only if there is a truth assignment that satisfies both and ' . e Equivalence eorem states
that sentence ' and a sentence are logically equivalent if and only the sentence (' , ) is
valid. e Deduction eorem states that a sentence ' logically entails a sentence if and only the
sentence (' ) ) is valid. More generally, a finite set of sentences {' 1 , ... , ' n } logically entails
' if and only if the compound sentence (' 1 ^ ... ^ ' 1 ) ' ) is valid. e Unsatisfiability eorem
states that a set of sentences logically entails a sentence ' if and only if the set of sentences
[ {:' } is unsatisfiable. e Consistency eorem states that a sentence ' is consistent with a set
of sentences if and only if the set of sentences [ {' } is satisfiable. A sentence ' is consistent
with a set of sentences {' 1 , ... , ' n } if and only if the compound sentence (' 1 ^ ... ^ ' 1 ^ ' ) is
satisfiable. Finally, a consequence of our definitions—any unsatisfiable set of sentences logically
entails everything.
3.7 EXERCISES
3.1. Say whether each of the following sentences is valid, contingent, or unsatisfiable.
(a) (p ) q ) _ (q ) p )
(b ) p ^ (p ) :q ) ^ q
(c ) (p ) (q ^ r )) , (p ) q ) ^ (p ) r )
(d ) (p ) (q ) r )) ) ((p ^ q ) ) r )
(e ) (p ) q ) ^ (p ) :q )
(f ) (:p _ :q ) ) :(p ^ q )
(g ) ((:p ) q ) ) (:q ) p )) ^ (p _ q )
(h) (:p _ q ) ) (q ^ (p , q ))
(i ) ((:r ) :p ^ :q ) _ s ) , (p _ q ) r _ s )
(j ) (p ^ (q ) r )) , ((:p _ q ) ) (p ^ r ))
3.2. For each of the following pairs of sentences, determine whether or not the sentences are
logically equivalent.
(a) (p ) q _ r ) and (p ^ q ) r )
(b ) (p ) (q ) r )) and (p ^ q ) r )
(c ) (p ^ q ) r ) and (p ^ r ) q )
(d ) ((p ) q _ r ) ^ (p ) r )) and (q ) r )
(e ) ((p ) q ) _ (q ) r )) and (p _ :p )
3.3. Use the Truth Table Method to answer the following questions about logical entailment.
(a) {p ) q _ r } |= (p ) r )
(b ) {p ) r } |= (p ) q _ r )
(c ) {q ) r } |= (p ) q _ r )
(d ) {p ) q _ r , p ) r } |= (q ) r )
(e ) {p ) q _ r , q ) r } |= (p ) r )
3.4. Let and be sets of sentences in Propositional Logic, and let ' and be individual
sentences in Propositional Logic. State whether each of the following statements is true
or false.
(a) If |= ' and |= ' , then \ |= ' .
(b ) If |= ' and |= ' , then [ |= ' .
(c ) If |= ' and |# ' , then [ |= ' .
(d ) If |# , then |= : .
(e ) If |= : , then |# .
3.5. In each of the following cases, determine whether the given individual sentence is con-
sistent with the given set of sentences.
(a) {p _ q , p _ :q , :p _ q } and (:p _ :q )
(b ) {p ) r , q ) r , p _ q } and r
(c ) {p ) r , q ) r , p _ q } and :r
(d ) {p ) q _ r , q ) r } and p ^ q
(e ) {p ) q _ r , q ) r } and q ^ r
3.6. Logical equivalence, logical entailment, and logical consistency are related to each other
in interesting ways, but they are not identical. Answer the following true or false questions
about the relationships between these concepts.
(a) If ' is equivalent to , then ' entails .
(b ) If ' is equivalent to , then ' is consistent with .
(c ) If ' entails , then ' is equivalent to .
(d ) If ' entails , then ' is consistent with .
(e ) If ' is consistent with , then ' is equivalent to .
(f ) If ' is consistent with , then ' entails .
CHAPTER 4
Propositional Proofs
4.1 INTRODUCTION
Checking logical entailment with truth tables has the merit of being conceptually simple. How-
ever, it is not always the most practical method. e number of truth assignments of a language
grows exponentially with the number of logical constants. When the number of logical constants
in a propositional language is large, it may be impossible to process its truth table.
Proof methods provide an alternative way of checking logical entailment that addresses this
problem. In many cases, it is possible to create a proof of a conclusion from a set of premises that
is much smaller than the truth table for the language; moreover, it is often possible to find such
proofs with less work than is necessary to check the entire truth table.
We begin this lesson with a discussion of linear reasoning and linear proofs. We then move
on to hypothetical reasoning and structured proofs. Once we have seen both linear and struc-
tured proofs, we show how they are combined in the popular Fitch proof system, and we provide
some tips for finding proofs using the Fitch system. We finish with definitions for soundness and
completeness—the standards by which proof systems are judged.
')
Implication Distribution (ID) tells us that implication can be distributed over other impli-
cations. If (' ) ( ) )) is true, then we can infer ((' ) ) ) (' ) )).
' ) ( ) )
(' ) ) ) (' ) )
An instance of a rule of inference is the rule obtained by consistently substituting sen-
tences for the metavariables in the rule. For example, the following is an instance of Implication
Elimination.
p)q
p
q
If a metavariable occurs more than once, the same expression must be used for every occur-
rence. For example, in the case of Implication Elimination, it would not be acceptable to replace
one occurrence of ' with one expression and the other occurrence of ' with a different expression.
Note that the replacement can be an arbitrary expression so long as the result is a legal
expression. For example, in the following instance of Implication Elimination, we have replaced
the variables by compound sentences.
(p ) q ) ) (q ) r )
(p ) q )
(q ) r )
Remember that there are infinitely many sentences in our language. Even though we start
with finitely many propositional constants (in a propositional vocabulary) and finitely many oper-
ators, we can combine them in arbitrarily many ways. e upshot is that there are infinitely many
instances of any rule of inference involving metavariables.
A rule applies to a set of sentences if and only if there is an instance of the rule in which all
of the premises are in the set. In this case, the conclusions of the instance are the results of the
rule application.
For example, if we had a set of sentences containing the sentence p and the sentence (p
) q ), then we could apply Implication Elimination to derive q as a result. If we had a set of
sentences containing the sentence (p ) q ) and the sentence (p ) q ) ) (q ) r ), then we could
apply Implication Elimination to derive (q ) r ) as a result.
In using rules of inference, it is important to remember that they apply only to top-level
sentences, not to components of sentences. While applying to components sometimes works, it
can also lead to incorrect results.
As an example of such a problem, consider the incorrect application of Implication Elimi-
nation shown below. Suppose we believe (p ) q ) and (p ) r ). We might try to apply Implication
Elimination here, taking the first premise as the implication and taking the occurrence of p in
the second premise as the matching condition, leading us to conclude (q ) r ).
p)q
p)r
q)r
Unfortunately, this is not a proper logical conclusion from the premises, as we all know
from experience and as we can quickly determine by looking at the associated truth table. It is
important to remember that rules of inference apply only to top-level sentences.
By writing down premises, writing instances of axiom schemas, and applying rules of in-
ference, it is possible to derive conclusions that cannot be derived in a single step. is idea of
stringing things together in this way leads to the notion of a linear proof.
A linear proof of a conclusion from a set of premises is a sequence of sentences terminating
in the conclusion in which each item is either (1) a premise, (2) an instance of an axiom schema,
or (3) the result of applying a rule of inference to earlier items in sequence.
Here is an example. Suppose we have the set of sentences we saw earlier. We start our proof
by writing out our premises. We believe p ; we believe (p ) q ); and we believe that (p ) q ) )
(q ) r ). Using Implication Elimination on the first premise and the second premise, we derive
q . Applying Implication Elimination to the second premise and the third premise, we derive (q
) r ). Finally, we use the derived premises on lines 4 and 5 to arrive at our desired conclusion.
1. p Premise
2. p)q Premise
3. (p ) q ) ) (q ) r ) Premise
4. q Implication Elimination: 2, 1
5. q)r Implication Elimination: 3, 2
6. r Implication Elimination: 5, 4
Here is another example. Whenever p is true, q is true. Whenever q is true, r is true. With
these as premises, we can prove that, whenever p is true, r is true. On line 3, we use Implication
Creation to derive (p ) (q ) r )). On line 4, we use Implication Distribution to distribute the
implication in line 3. Finally, on line 5, we use Implication Elimination to produce the desired
result.
1. p)q Premise
2. q)r Premise
3. p ) (q ) r ) Implication Creation: 2
4. (p ) q ) ) (p ) r ) Implication Distribution: 3
5. p)r Implication Elimination: 4, 1
Let R be a set of rules of inference. If there exists a proof of a sentence ' from a set of
premises using the rules of inference in R, we say that ' is provable from using R. We usually
write this as |-R ' , using the provability operator |- (which is sometimes called single turnstile).
If the set of rules is clear from context, we usually drop the subscript, writing just |- ' .
Note that the set of rules presented here is not powerful enough to prove everything that
is entailed by a set of premises in Propositional Logic. ere is no support for using or deducing
negations or conjunctions or disjunctions or biconditionals. Even if we restrict ourselves to im-
plications, we need more rules. While such rules of inference exist, they are a little complicated.
For many people, it is easier to reason about implications using hypothetical reasoning.
1. p ⇒ q Premise
2. q ⇒ r Premise
3. p Assumption
4. q Implication Elimination: 3, 1
5. r Implication Elimination: 4, 2
6. p r Implication Introduction: 3, 5
e main benefit of structured proofs is that they allow us to prove things that cannot
be proved using only ordinary rules of inference. In structured proofs, we can make assumptions
within subproofs; we can prove conclusions from those assumptions; and, from those derivations,
we can derive implications outside of those subproofs, with our assumptions as antecedents and
our conclusions as consequents.
e structured proof above illustrates this. On line 3, we begin a subproof with the assump-
tion that p is true. Note that p is not a premise in the overall problem. In a subproof, we can make
whatever assumptions that we like. From p , we derive q using the premise on line 1; and, from
that q , we prove r using the premise on line 2. at terminates the subproof. Finally, from this
subproof, we derive (p ) r ) in the outer proof. Given p , we can prove r ; and so we know (p )
r ). e rule used in this case is called Implication Introduction, or II for short.
As this example illustrates, there are three basic operations involved in creating useful
subproofs—(1) making assumptions, (2) using ordinary rules of inference to derive conclusions,
and (3) using structured rules of inference to derive conclusions outside of subproofs. Let’s look
at each of these operations in turn.
In a structured proof, it is permissible to make an arbitrary assumption in any subproof. e
assumptions need not be members of the initial premise set. Note that such assumptions cannot
be used directly outside of the subproof, only as conditions in derived implications, so they do not
contaminate the superproof or any unrelated subproofs.
For example, in the proof we just saw, we used this assumption operation in the nested
subproof even though p was not among the given premises.
An ordinary rule of inference applies to a particular subproof of a structured proof if and
only if there is an instance of the rule in which all of the premises occur earlier in the subproof or in
some superproof of the subproof. Importantly, it is not permissible to use sentences in subproofs
of that subproof or in other subproofs of its superproofs.
For example, in the structured proof we have been looking at, it is okay to apply Implication
Elimination to 1 and 3. And it is okay to use Implication Elimination on lines 2 and 4.
However, it is not acceptable to use a sentence from a subproof in applying an ordinary rule
of inference in a superproof.
e last line of the malformed proof shown below gives an example of this. It is not permis-
sible to use Implication Elimination as shown here because it uses a conclusion from a subproof
as a premise in an application of an ordinary rule of inference in its superproof.
1. p ⇒ q Premise
2. q ⇒ r Premise
3. p Assumption
4. q Implication Elimination: 1, 3
5. r Implication Elimination: 2, 4
6. p ⇒ r Implication Introduction: 3, 5
Wrong! 7. r Implication Elimination: 2, 4 Wrong!
e malformed proof shown below is another example. Here, line 8 is illegal because line
4 is not in the current subproof or a superproof of this subproof.
1. p ⇒ q Premise
2. q ⇒ r Premise
3. p Assumption
4. q Implication Elimination: 1, 3
5. r Implication Elimination: 2, 4
6. p ⇒ r Implication Introduction: 3, 5
7. r Assumption
Wrong! 8. r Implication Elimination: 2, 4 Wrong!
9. r r Implication Introduction: 7, 8
Correctly utilizing results derived in subproofs is the responsibility of a new type of rule of
inference. Like an ordinary rule of inference, a structured rule of inference is a pattern of reasoning
consisting of one or more premises and one or more conclusions. As before, the premises and
conclusions can be schemas. However, the premises can also include conditions of the form ' |-
, as in the following example. e rule in this case is called Implication Introduction, because
it allows us to introduce new implications.
' |-
')
Once again, looking at the correct example above, we see that there is an instance of Im-
plication Introduction (shown here on the left) in deriving line 6 from the subproof on lines 3–5.
e application of Implication Introduction in the malformed proof is also okay in deriving line 7
from the subproof in lines 4–6.
Finally, we define a structured proof of a conclusion from a set of premises to be a sequence
of (possibly nested) sentences terminating in an occurrence of the conclusion at the top level of
the proof. Each step in the proof must be either (1) a premise (at the top level) or an assumption
(other than at the top level) or (2) the result of applying an ordinary or structured rule of inference
to earlier items in the sequence (subject to the constraints given above).
4.4 FITCH
Fitch is a proof system that is particularly popular in the Logic community. It is as powerful
as many other proof systems and is far simpler to use. Fitch achieves this simplicity through its
support for structured proofs and its use of structured rules of inference in addition to ordinary
rules of inference.
Fitch has ten rules of inference in all. Nine of these are ordinary rules of inference. e
other rule (Implication Introduction) is a structured rule of inference.
And Introduction (shown below on the left) allows us to derive a conjunction from its con-
juncts. If a proof contains sentences ' 1 through ' n , then we can infer their conjunction. And
Elimination (shown below on the right) allows us to derive conjuncts from a conjunction. If we
have the conjunction of ' 1 through ' n , then we can infer any of the conjuncts.
And Introduction
'1 And Elimination
... '1 ^ ... ^ 'n
'n 'i
'1 ^ ... ^ 'n
Or Elimination
'1 _ ... _ 'n
Or Introduction
'1 )
'i
...
'1 _ ... _ 'n
'n )
Negation Introduction
Negation Elimination
')
::'
'):
'
:'
Implication Introduction is the structured rule we saw in Section 4.3. If, by assuming ' ,
we can derive , then we can derive (' ) ). Implication Elimination is the first rule we saw
Section 4.2.
Implication Elimination
Implication Introduction
')
' |-
'
')
If the goal has the form (' ^ ), we first prove ' and then prove and then use And
Introduction to derive (' ^ ).
If the goal has the form (' _ ), all we need to do is to prove ' or prove , but we do
not need to prove both. Once we have proved either one, we can disjoin that with anything else
whatsoever.
If the goal has the form (:' ), it is often useful to assume ' and prove a contradiction,
meaning that ' must be false. To do this, we assume ' and derive some sentence leading to ('
) ). We assume ' again and derive some sentence : leading to (' ) : ). Finally, we use
Negation Introduction to derive :' as desired.
More generally, whenever we want to prove a sentence ' of any sort, we can sometimes
succeed by assuming :' , proving a contradiction as just discussed and thereby deriving ::' . We
can then apply Negation Elimination to get ' .
e following two tips suggest useful things we can try based on the form of the premises
and the goal or subgoal we are trying to prove.
If there is a premise of the form (' ) ) and our goal is to prove , then it is often useful
to try proving ' . If we succeed, we can then use Implication Elimination to derive .
If we have a premise (' _ ) and our goal is to prove , then we should try proving (' )
) and ( ) ). If we succeed, we can then use Or Elimination to derive .
As an example of using these tips in constructing the proof, consider the following problem.
We are given p _ q and :p , and we are asked to prove q . Since the goal is not an implication or
a conjunction or a disjunction or a negation, only the last of the goal-based tips applies. Unfortu-
nately, this does not help us in this case. Luckily, the second of the premise-based tips is relevant
because we have a disjunction as a premise. To use this all we need is to prove p ) q and q )
q . To prove p ) q , we use the first goal-based tip. We assume p and try to prove q . To do this
we use that last goal-based tip. We assume ~q and prove p . en we assume ~q and prove :p .
Since we have proved p and :p from :q , we can infer q . Using Implication Introduction, we
then have p ) q . Proving q ) q is easy. Finally, we can apply or elimination to get the desired
result.
1. p | q Premise
2. p Premise
3. p Assumption
4. q Assumption
5. p Reiteration: 3
6. q⇒p Implication Introduction: 4, 5
7. q Assumption
8. p Reiteration: 2
9. q ⇒ p Implication Introduction: 7, 8
10. q Negation Introduction: 6, 9
11. q Negation Elimination: 10
12. p ⇒ q Implication Introduction: 3, 11
13. q Assumption
14. q ⇒ q Implication Introduction: 13
15. q Or Elimination: 1, 12, 14
In general, when trying to generate a proof, it is useful to apply the premise tips to derive
conclusions. However, this often works only for very short proofs. For more complex proofs, it
is often useful to think backward from the desired conclusion before starting to prove things
from the premises in order to devise a strategy for approaching the proof. is often suggests
subproblems to be solved. We can then work on these simpler subproblems and put the solutions
together to produce a proofs for our overall conclusion.
4.6 SOUNDNESS AND COMPLETENESS
In talking about Logic, we now have two notions—logical entailment and provability. A set
of premises logically entails a conclusion if and only if every truth assignment that satisfies the
premises also satisfies the conclusion. A sentence is provable from a set of premises if and only if
there is a finite proof of the conclusion from the premises.
e concepts are quite different. One is based on truth assignments; the other is based on
symbolic manipulation of expressions. Yet, for the proof systems we have been examining, they
are closely related.
We say that a proof system is sound if and only if every provable conclusion is logically
entailed. In other words, if |- ' , then |= ' . We say that a proof system is complete if and only
if every logical conclusion is provable. In other words, if |= ' , then |- ' .
e Fitch system is sound and complete for the full language. In other words, for this
system, logical entailment and provability are identical. An arbitrary set of sentences logically
entails an arbitrary sentence ' if and only if ' is provable from using Fitch.
e upshot of this result is significant. On large problems, the proof method often takes
fewer steps than the truth table method. (Disclaimer: In the worst case, the proof method may
take just as many or more steps to find an answer as the truth table method.) Moreover, proofs are
usually much smaller than the corresponding truth tables. So writing an argument to convince
others does not take as much space.
RECAP
A pattern is an expression satisfying the grammatical rules of our language except for the occur-
rence of metavariables in place of various subparts of the expression. An instance of a pattern is
the expression obtained by substituting expressions of the appropriate sort for the metavariables
in the pattern so that the result is a legal expression. A rule of inference is a pattern of reasoning
consisting of one set of patterns, called premises, and a second set of schemas, called conclusions. A
linear proof of a conclusion from a set of premises is a sequence of sentences terminating in the
conclusion in which each item is either (1) a premise or (2) the result of applying a rule of infer-
ence to earlier items in sequence. If there exists a proof of a sentence ' from a set of premises
and the axiom schemas and rules of inference of a proof system, then ' is said to be provable from
(written as |- ' ) and is called a theorem of . Fitch is a powerful yet simple proof system
that supports structured proofs. A proof system is sound if and only if every provable conclusion
is logically entailed. A proof system is complete if and only if every logical conclusion is provable.
Fitch is sound and complete for Propositional Logic.
4.7 EXERCISES
4.1. Given p and q and (p ^ q ) r ), use the Fitch system to prove r .
4.2. Given (p ^ q ), use the Fitch system to prove (q _ r ).
4.3. Given p ) q and q , r , use the Fitch system to prove p ) r .
4.4. Given p ) q and m ) p _ q , use the Fitch System to prove m ) q .
4.5. Given p ) (q ) r ), use the Fitch System to prove (p ) q ) ) (p ) r ).
4.6. Use the Fitch System to prove p ) (q ) p ).
4.7. Use the Fitch System to prove (p ) (q ) r )) ) ((p ) q ) ) (p ) r )).
4.8. Use the Fitch System to prove (:p ) q ) ) ((:p ) :q ) ) p ).
4.9. Given p , use the Fitch System to prove ::p .
4.10. Given p ) q , use the Fitch System to prove :q ) :p .
4.11. Given p ) q , use the Fitch System to prove :p _ q .
4.12. Use the Fitch System to prove ((p ) q ) ) p ) ) p .
4.13. Given :(p _ q ), use the Fitch system to prove (:p ^ :q ).
4.14. Use the Fitch system to prove the tautology (p _ :p ).
CHAPTER 5
Propositional Resolution
5.1 INTRODUCTION
Propositional Resolution is a powerful rule of inference for Propositional Logic. Using Proposi-
tional Resolution (without axiom schemata or other rules of inference), it is possible to build a
theorem prover that is sound and complete for all of Propositional Logic. What’s more, the search
space using Propositional Resolution is much smaller than for standard Propositional Logic.
is chapter is devoted entirely to Propositional Resolution. We start with a look at clausal
form, a variation of the language of Propositional Logic. We then examine the resolution rule
itself. We close with some examples.
') ! :' _
'( ! '_:
', ! (:' _ ) ^ (' _ : )
2. Negations (N):
::' ! '
:(' ^ ) ! :' _ :
:(' _ ) ! :' ^ :
3. Distribution (D):
4. Operators (O):
g ^ (r ) f )
I g ^ (:r _ f )
N g ^ (:r _ f )
D g ^ (:r _ f )
O {g }
{:r , f }
As a slightly more complicated case, consider the following conversion. We start with the
same sentence except that, in this case, it is negated.
:(g ^ (r ) f ))
I :(g ^ (:r _ f ))
N :g _ :(:r _ f )
:g _ (::r ^ :f )
:g _ (r ^ :f )
D (:g _ r ) ^ (:g _ :f )
O {:g ,r }
{:g , :f }
Note that, even though the sentences in these two examples are similar to start with (dis-
agreeing on just one : operator), the results are quite different.
Here is another example, this time illustrating the way in which we can use Resolution to
prove valid sentences. Let’s say that we have no premises at all and we want to prove (p ) (q )
p )), an instance of the Implication Creation axiom schema.
e first step is to negate this sentence and convert to clausal form. A trace of the conversion
process is shown below. Note that we end up with three clauses.
:(p ) (q ) p ))
I :(:p _ (:q _ p ))
N ::p ^ :(:q _ p )
p ^ (::q ^ :p )
D p ^ q ^ :p
O {p }
{q }
{:p }
Finally, we take these clauses and produce a resolution derivation of the empty clause in
one step.
1. {p } Premise
2. {q } Premise
3. {:p } Premise
4. {} 1, 3
One of the best features of Propositional Resolution is that it much more focussed than
the other proof methods we have seen. ere is no need to choose instantiations carefully or to
search through infinitely many possible instantiations for rules of inference.
Moreover, unlike the other methods we have seen, Propositional Resolution can be used in a
proof procedure that always terminates without losing completeness. Since there are only finitely
many clauses that can be constructed from a finite set of proposition constants, the procedure
eventually runs out of new conclusions to draw, and when this happens we can terminate our
search for a proof.
RECAP
Propositional Resolution is a rule of inference for Propositional Logic. Propositional Resolution
works only on expressions in clausal form. A literal is either an atomic sentence or a negation
of an atomic sentence. A clausal sentence is either a literal or a disjunction of literals. A clause
is the set of literals in a clausal sentence. e empty set {} is also a clause; it is equivalent to
an empty disjunction and, therefore, is unsatisfiable. Given a clause containing a literal and
another clause containing the literal :, we can infer the clause consisting of all the literals of both
clauses without the complementary pair. is rule of inference is called Propositional Resolution
or the Resolution Principle. A resolution derivation of a conclusion from a set of premises is a finite
sequence of clauses terminating in the conclusion in which each clause is either a premise or the
result of applying the Resolution Principle to earlier members of the sequence. A resolution proof
of a sentence ' from a set of sentences is a resolution derivation of the empty clause from the
clausal form of [ {:' }. A sentence ' is provable from a set of sentences by Propositional
Resolution (written |- ' ) if and only if there is a resolution proof of ' from . Resolution is
not generatively complete, i.e., it is not possible to find resolution derivations for all clauses that are
logically entailed by a set of premise clauses. On the other hand, it is complete in another sense—
if a set of clauses is unsatisfiable, then there is guaranteed to be a resolution derivation of the
empty clause from . More generally, if a set of Propositional Logic sentences is unsatisfiable,
then there is guaranteed to be a resolution derivation of the empty clause from the clausal form
of . Propositional Resolution can be used in a proof procedure that always terminates without
losing completeness.
5.5 EXERCISES
5.1. Convert the following sentences to clausal form.
(a ) p^q)r _s
(b ) p_q)r _s
(c ) :(p _ q _ r )
(d ) :(p ^ q ^ r )
(e ) p^q,r
5.2. What are the results of applying Propositional Resolution to the following pairs of
clauses.
(a) {p , q , :r } and {r , s }
(b ) {p , q , r } and {r , :s , :t }
(c ) {q , :q } and {q , :q }
(d ) {:p , q , r } and {p , :q , :r }
5.3. Use Propositional Resolution to show that the clauses {p , q }, {:p , r }, {:p , :r }, {p , :q }
are not simultaneously satisfiable.
5.4. Given the premises (p ) q ) and (r ) s ), use Propositional Resolution to prove the
conclusion (p _ r ) q _ s ).
CHAPTER 6
Relational Logic
6.1 INTRODUCTION
Propositional Logic allows us to talk about relationships among individual propositions, and it
gives us the machinery to derive logical conclusions based on these relationships. Suppose, for
example, we believe that, if Jack knows Jill, then Jill knows Jack. Suppose we also believe that Jack
knows Jill. From these two facts, we can conclude that Jill knows Jack using a simple application
of Implication Elimination.
Unfortunately, when we want to say things more generally, we find that Propositional Logic
is inadequate. Suppose, for example, that we wanted to say that, in general, if one person knows
a second person, then the second person knows the first. Suppose, as before, that we believe that
Jack knows Jill. How do we express the general fact in a way that allows us to conclude that Jill
knows Jack? Here, Propositional Logic is inadequate; it gives us no way of succinctly encoding
this more general belief in a form that captures its full meaning and allows us to derive such
conclusions.
Relational Logic is an alternative to Propositional Logic that solves this problem. e trick
is to augment our language with two new linguistic features, viz. variables and quantifiers. With
these new features, we can express information about multiple objects without enumerating those
objects; and we can express the existence of objects that satisfy specified conditions without saying
which objects they are.
In this chapter, we proceed through the same stages as in the introduction to Propositional
Logic. We start with syntax and semantics. We then discuss evaluation and satisfaction. We look
at some examples. en, we talk about properties of Relational Logic sentences and logical en-
tailment for Relational Logic. Finally, we say a few words about the equivalence of Relational
Logic and Propositional Logic and its decidability.
6.2 SYNTAX
In Propositional Logic, sentences are constructed from a basic vocabulary of propositional con-
stants. In Relational Logic, there are no propositional constants; instead we have object constants,
relation constants, and variables.
In our examples here, we write both variables and constants as strings of letters, digits, and
a few non-alphanumeric characters (e.g., “_”). By convention, variables begin with letters from
the end of the alphabet (viz. u, v , w , x , y , z ). Examples include x , ya, and z _2. By convention,
all constants begin with either alphabetic letters (other than u, v , w , x , y , z ) or digits. Examples
include a, b , 123, comp225, and barack_obama.
Note that there is no distinction in spelling between object constants and relation constants.
e type of each such word is determined by its usage or, in some cases, in an explicit specification.
As we shall see, relation constants are used in forming complex expressions by combining
them with an appropriate number of arguments. Accordingly, each relation constant has an as-
sociated arity, i.e., the number of arguments with which that relation constant can be combined.
A relation constant that can combined with a single argument is said to be unary; one that can
be combined with two arguments is said to be binary; one that can be combined with three ar-
guments is said to be ternary; more generally, a relation constant that can be combined with n
arguments is said to be n-ary.
A vocabulary consists of a set of object constants, a set of relation constants, and an as-
signment of arities for each of the relation constants in the vocabulary. (Note that this definition
here is slightly non-traditional. In many textbooks, a vocabulary (sometimes called a signature)
includes a specification of relation constants but not object constants, whereas our definition here
includes both types of constants.)
A term is defined to be a variable or an object constant. Terms typically denote objects
presumed or hypothesized to exist in the world; and, as such, they are analogous to noun phrases
in natural language, e.g., Joe or someone.
ere are three types of sentences in Relational Logic, viz. relational sentences (the analog
of propositions in Propositional Logic), logical sentences (analogous to the logical sentences in
Propositional Logic), and quantified sentences (which have no analog in Propositional Logic).
A relational sentence is an expression formed from an n-ary relation constant and n terms.
For example, if q is a relation constant with arity 2 and if a and y are terms, then the expression
shown below is a syntactically legal relational sentence. Relational sentences are sometimes called
atoms to distinguish them from logical and quantified sentences.
q (a, y )
Logical sentences are defined as in Propositional Logic. ere are negations, conjunctions,
disjunctions, implications, and equivalences. See below for examples.
Negation: (:p (a))
Conjunction: (p (a) ^ q (b , c ))
Disjunction: (p (a) _ q (b , c ))
Implication: (p (a) ) q (b , c ))
Biconditional: (p (a) , q (b , c ))
Note that the syntax here is exactly the same as in Propositional Logic except that the
elementary components are relational sentences rather than proposition constants.
Quantified sentences are formed from a quantifier, a variable, and an embedded sentence.
e embedded sentence is called the scope of the quantifier. ere are two types of quantified
sentences in Relational Logic, viz. universally quantified sentences and existentially quantified
sentences.
A universally quantified sentence is used to assert that all objects have a certain property. For
example, the following expression is a universally quantified sentence asserting that, if p holds of
an object, then q holds of that object and itself.
(8x .(p (x ) ) q (x ,x )))
An existentially quantified sentence is used to assert that some object has a certain property.
For example, the following expression is an existentially quantified sentence asserting that there
is an object that satisfies p and, when paired with itself, satisfies q as well.
(9x .(p (x ) ^ q (x ,x )))
Note that quantified sentences can be nested within other sentences. For example, in the
first sentence below, we have quantified sentences inside of a disjunction. In the second sentence,
we have a quantified sentence nested inside of another quantified sentence.
((8x .p (x )) _ (9x .q (x ,x )))
(8x .(9y .q (x ,y )))
As with Propositional Logic, we can drop unneeded parentheses in Relational Logic, re-
lying on precedence to disambiguate the structure of unparenthesized sentences. In Relational
Logic, the precedence relations of the logical operators are the same as in Propositional Logic,
and quantifiers have higher precedence than logical operators.
e following examples show how to parenthesize sentences with both quantifiers and
logical operators. e sentences on the right are partially parenthesized versions of the sentences
on the left. (To be fully parenthesized, we would need to add parentheses around each of the
sentences as a whole.)
8x .p (x ) ) q (x ) (8x .p (x )) ) q (x )
9x .p (x ) ^ q (x ) (9x .p (x )) ^ q (x )
Notice that, in each of these examples, the quantifier does not apply to the second relational
sentence, even though, in each case, that sentence contains an occurrence of the variable being
quantified. If we want to apply the quantifier to a logical sentence, we must enclose that sentence
in parentheses, as in the following examples.
8x .(p (x ) ) q (x ))
9x .(p (x ) ^ q (x ))
An expression in Relational Logic is ground if and only if it contains no variables. For
example, the sentence p (a) is ground, whereas the sentence 8x .p (x ) is not.
An occurrence of a variable is free if and only if it is not in the scope of a quantifier of that
variable. Otherwise, it is bound. For example, y is free and x is bound in the following sentence.
9x .q (x ,y )
A sentence is open if and only if it has free variables. Otherwise, it is closed. For example,
the first sentence below is open and the second is closed.
p (y ) ) 9x .q (x ,y )
8y .(p (y ) ) 9x .q (x ,y ))
6.3 SEMANTICS
e semantics of Relational Logic presented here is termed Herbrand semantics. It is named after
the logician Herbrand, who developed some of its key concepts. As Herbrand is French, it should
properly be pronounced “air-brahn”. However, most people resort to the Anglicization of this,
instead pronouncing it “her-brand”. (One exception is Stanley Peters, who has been known at
times to pronounce it “hare-brained”.)
e Herbrand base for a vocabulary is the set of all ground relational sentences that can be
formed from the constants of the language. Said another way, it is the set of all sentences of the
form r (t 1 ,...,t n ), where r is an n-ary relation constant and t 1 , ... , t n are object constants.
For a vocabulary with object constants a and b and relation constants p and q where p has
arity 1 and q has arity 2, the Herbrand base is shown below.
It is worthwhile to note that, for a given relation constant and a finite set of terms, there
is an upper bound on the number of ground relational sentences that can be formed using that
relation constant. In particular, for a set of terms of size b , there are bn distinct n-tuples of object
constants; and hence there are bn ground relational sentences for each n-ary relation constant.
Since the number of relation constants in a vocabulary is finite, this means that the Herbrand
base is also finite.
A truth assignment for a Relational Logic language is a function that maps each ground
relational sentence in the Herbrand base to a truth value. As in Propositional Logic, we use the
digit 1 as a synonym for true and 0 as a synonym for false; and we refer to the value assigned
to a ground relational sentence by writing the relational sentence with the name of the truth
assignment as a superscript. For example, the truth assignment shown below is an example for
the case of the language mentioned a few paragraphs above.
p (a) ! 1
p (b ) ! 0
q (a,a) ! 1
q (a,b ) ! 0
q (b ,a) ! 1
q (b ,b ) ! 0
As with Propositional Logic, once we have a truth assignment for the ground relational
sentences of a language, the semantics of our operators prescribes a unique extension of that
assignment to the complex sentences of the language.
e rules for logical sentences in Relational Logic are the same as those for logical sentences
in Propositional Logic. A truth assignment satisfies a negation :' if and only if it does not satisfy
' . A truth assignment satisfies a conjunction (' 1 ^ ... ^ ' n ) if and only if it satisfies every ' i . A
truth assignment satisfies a disjunction (' 1 _ ... _ ' n ) if and only if it satisfies at least one ' i .
A truth assignment satisfies an implication (' ) ) if and only if it does not satisfy ' or does
satisfy . A truth assignment satisfies an equivalence (' , ) if and only if it satisfies both '
and or it satisfies neither ' nor .
In order to define satisfaction of quantified sentences, we need the notion of instances.
An instance of an expression is an expression in which all free variables have been consistently
replaced by ground terms. Consistent replacement here means that, if one occurrence of a variable
is replaced by a ground term, then all occurrences of that variable are replaced by the same ground
term.
A universally quantified sentence is true for a truth assignment if and only if every instance
of the scope of the quantified sentence is true for that assignment. An existentially quantified
sentence is true for a truth assignment if and only if some instance of the scope of the quantified
sentence is true for that assignment.
A truth assignment satisfies a sentence with free variables if and only if it satisfies every
instance of that sentence. A truth assignment satisfies a set of sentences if and only if it satisfies
every sentence in the set.
6.4 EVALUATION
Evaluation for Relational Logic is similar to evaluation for Propositional Logic. e only differ-
ence is that we need to deal with quantifiers. In order to evaluate a universally quantified sentence,
we check that all instances of the scope are true. (We are in effect treating it as the conjunction
of all those instances.) In order to evaluate an existentially quantified sentence, we check that at
least one instance of the scope. (We are in effect treating it as the disjunction of those instances.)
Once again, assume we have a language with a unary relation constant p , a binary relation
constant q , and object constants a and b ; and consider our truth assignment from the last section.
What is the truth value of the sentence 8x .(p (x ) ) q (x ,x )) under this assignment? ere
are two instances of the scope of this sentence. See below.
p (a) ) q (a,a)
p (b ) ) q (b ,b )
We know that p (a) is true and q (a,a) is true, so the first instance is true. q (b ,b ) is false, but
so is p (b ) so the second instance is true as well.
(p (a) ) q (a,a)) ! 1
(p (b ) ) q (b ,b )) ! 1
Since both instances are true, the original quantified sentence is true as well.
8x .(p (x ) ) q (x ,x )) ! 1
Now let’s consider a case with nested quantifiers. Is 8x .9y .q (x ,y ) true or false for the truth
assignment shown above? As before, we know that this sentence is true if every instance of its
scope is true. e two possible instances are shown below.
9y .q (a,y )
9y .q (b ,y )
To determine the truth of 9y .q (a,y ), we must find at least one instance of q (a,y ) that is
true. e possibilities are shown below.
q (a,a)
q (a,b )
Looking at our truth assignment, we see that the first of these is true and the second is
false.
q (a,a) ! 1
q (a,b ) ! 0
Since one of these instances is true, the existential sentence as a whole is true.
9y .q (a,y ) ! 1
Now, we do the same for the second existentially quantified. e possible instances in this
case are shown below.
q (b ,a)
q (b ,b )
Of these, the first is true, and the second is false.
q (b ,a) ! 1
q (b ,b ) ! 0
Again, since one of these instances is true, the existential sentence as a whole is true.
9y .q (b ,y ) ! 1
At this point, we have truth values for our two existential sentences. Since both instances
of the scope of our original universal sentence are true, the sentence as a whole must be true as
well.
8x .9y .q (x ,y ) ! 1
6.5 SATISFACTION
As in Propositional Logic, it is in principle possible to build a truth table for any set of sentences in
Relational Logic. is truth table can then be used to determine which truth assignments satisfy
a given set of sentences.
As an example, let us assume we have a language with just two object constants a and b
and two unary relation constants p and q . Now consider the sentences shown below, and assume
our job is to find a truth assignment that satisfies these sentences.
p (a) _ p (b )
8x .(p (x ) ) q (x ))
9x .q (x )
A truth table for this problem is shown below. Each of the four columns on the left repre-
sents one of the elements of the Herbrand base for this language. e three columns on the right
represent our sentences.
Looking at the table, we see that there are twelve truth assignments that make the first
sentence true, nine that make the second sentence true, twelve that make the third sentence true,
and five that make them all true (rows 1, 5, 6, 9, and 11).
6.6 EXAMPLE–SORORITY WORLD
Consider once again the Sorority World example introduced in Chapter 1. Recall that this world
focusses on the interpersonal relations of a small sorority. ere are just four members—Abby,
Bess, Cody, and Dana. Our goal is to represent information about who likes whom.
In order to encode this information in Relational Logic, we adopt a vocabulary with four
object constants (abby, bess, cody, dana) and one binary relation constant (likes).
If we had complete information about the likes and dislikes of the girls, we could completely
characterize the state of affairs as a set of ground relational sentences or negations of ground rela-
tional sentences, like the ones shown below, with one sentence for each member of the Herbrand
base. (In our example here, we have written the positive literals in black and the negative literals
in grey in order to distinguish the two more easily.)
:likes(abby,abby) :likes(abby,bess) likes(abby,cody) :likes(abby,dana)
:likes(bess,abby) :likes(bess,bess) likes(bess,cody) :likes(bess,dana)
likes(cody,abby) likes(cody,bess) :likes(cody,cody) likes(cody,dana)
:likes(dana,abby) :likes(dana,bess) likes(dana,cody) :likes(dana,dana)
To make things more interesting, let’s assume that we do not have complete information,
only fragments of information about the girls’ likes and dislikes. Let’s see how we can encode
such fragments in Relational Logic.
Let’s start with a simple disjunction. Bess likes Cody or Dana. Encoding a sentence with a
disjunctive noun phrase (such as Cody or Dana) is facilitated by first rewriting the sentence as a
disjunction of simple sentences. Bess likes Cody or Bess likes Dana. In Relational Logic, we can
express this fact as a simple disjunction with the two possibilities as disjuncts.
likes(bess,cody) _ likes(bess,dana)
Abby likes everyone Bess likes. Again, paraphrasing helps translate. If Bess likes a girl, then
Abby also likes her. Since this is a fact about everyone, we use a universal quantifier.
8y .(likes(bess,y ) ) likes(abby,y ))
Cody likes everyone who likes her. In other words, if some girl likes Cody, then Cody likes that
girl. Again, we use a universal quantifier.
8y .(likes(y ,cody) ) likes(cody,y ))
Bess likes somebody who likes her. e word somebody here is a tip-off that we need to use an
existential quantifier.
9y .(likes(bess,y ) ^ likes(y ,bess))
Nobody likes herself. e use of the word nobody here suggests a negation. A good technique
in such cases is to rewrite the English sentence as the negation of a positive version of the sentence
before translating to Relational Logic.
:9x .likes(x ,x )
Everybody likes somebody. Here we have a case requiring two quantifiers, one universal and
one existential. e key to this case is getting the quantifiers in the right order. Reversing them
leads to a very different statement.
8x .9y .likes(x ,y )
ere is someone everyone likes. e preceding sentence tells us that everyone likes someone,
but that someone can be different for different people. is sentence tells us that everybody likes
the same person.
9y .8x .likes(x ,y )
Most people looking at this figure interpret it as a configuration of five toy blocks. Some
people conceptualize the table on which the blocks are resting as an object as well; but, for sim-
plicity, we ignore it here.
In order to describe this scene, we adopt a vocabulary with five object constants, as shown
below, with one object constant for each of the five blocks in the scene. e intent here is for each
of these object constants to represent the block marked with the corresponding capital letter in
the scene.
{a, b , c , d , e }
In a spatial conceptualization of the Blocks World, there are numerous meaningful rela-
tions. For example, it makes sense to think about the relation that holds between two blocks if
and only if one is resting on the other. In what follows, we use the relation constant on to refer to
this relation. We might also think about the relation that holds between two blocks if and only
if one is anywhere above the other, i.e., the first is resting on the second or is resting on a block
that is resting on the second, and so forth. In what follows, we use the relation constant above to
talk about this relation. ere is the relation that holds of three blocks that are stacked one on top
of the other. We use the relation constant stack as a name for this relation. We use the relation
constant clear to denote the relation that holds of a block if and only if there is no block on top of
it. We use the relation constant table to denote the relation that holds of a block if and only if that
block is resting on the table. e set of relation constants corresponding to this conceptualization
is shown below.
{on, above, stack, clear, table}
e arities of these relation constants are determined by their intended use. Since on is
intended to denote a relation between two blocks, it has arity 2. Similarly, above has arity 2. e
stack relation constant has arity 3. Relation constants clear and table each have arity 1.
Given this vocabulary, we can describe the scene in Figure 6.1 by writing ground literals
that state which relations hold of which objects or groups of objects. Let’s start with on. e
following sentences tell us directly for each ground relational sentence whether it is true or false.
(Once again, we have written the positive literals in black and the negative literals in grey in order
to distinguish the two more easily.)
:on(a,a) on(a,b ) :on(a,c ) :on(a,d ) :on(a,e )
:on(b ,a) :on(b ,b ) on(b ,c ) :on(b ,d ) :on(b ,e )
:on(c ,a) :on(c ,b ) :on(c ,c ) :on(c ,d ) :on(c ,e )
:on(d ,a) :on(d ,b ) :on(d ,c ) :on(d ,d ) on(d ,e )
:on(e ,a) :on(e ,b ) :on(e ,c ) :on(e ,d ) :on(e ,e )
We can do the same for the other relations. However, there is an easier way. Each of the
remaining relations can be defined in terms of on. ese definitions together with our facts about
the on relation logically entail every other ground relational sentence or its negation. Hence, given
these definitions, we do not need to write out any additional data.
A block satisfies the clear relation if and only if there is nothing on it.
8y .(clear (y ) , :9x .on(x ,y ))
A block satisfies the table relation if and only if it is not on some block.
8x .(table(x ) , :9y .on(x ,y ))
ree blocks satisfy the stack relation if and only if the first is on the second and the second
is on the third.
8x .8y .8z .(stack(x ,y ,z ) , on(x ,y ) ^ on(y ,z ))
e above relation is a bit tricky to define correctly. One block is above another block if
and only if the first block is on the second block or it is on another block that is above the second
block. Also, no block can be above itself. Given a complete definition for the on relation, these
two axioms determine a unique above relation.
8x .8z .(above(x ,z ) , on(x ,z ) _ 9y .(on(x ,y ) ^ above(y ,z )))
:9x .above(x ,x )
In order to see why this saves us the work of writing out the negative literals, we can write
this axiom in the equivalent form shown below.
8x .8y .8z .(next (x ,y ) ^ :same(y ,z ) ) :next (x ,z ))
e addition table for Modular Arithmetic is the usual addition table for arbitrary numbers
except that we wrap around whenever we get past 3. For such a small arithmetic, it is easy to write
out the ground relational sentences for addition, as shown below.
plus(0,0,0) plus(1,0,1) plus(2,0,2) plus(3,0,3)
plus(0,1,1) plus(1,1,2) plus(2,1,3) plus(3,1,0)
plus(0,2,2) plus(1,2,3) plus(2,2,0) plus(3,2,1)
plus(0,3,3) plus(1,3,0) plus(2,3,1) plus(3,3,2)
As with next, we avoid writing out the negative literals by writing a suitable functionality
axiom for plus.
8x .8y .8z .8w .( plus(x ,y ,z ) ^ :same(z ,w ) ) :plus(x ,y ,w ))
at’s one way to do things, but we can do better. Rather than writing out all of those
relational sentences, we can use Relational Logic to define plus in terms of same and next and
use that axiomatization to deduce the ground relational sentences. e definition is shown below.
First, we have an identity axiom. Adding 0 to any number results in the same number. Second
we have a successor axiom. If z is the sum of x and y , then the sum of the successor of x and y
is the successor of z . Finally, we have our functionality axiom once again.
8y .plus(0,y ,y )
8x .8y .8z .8x 2.8z 2.( plus(x ,y ,z ) ^ next (x ,x 2) ^ next (z ,z 2) ) plus(x 2,y ,z 2))
8x .8y .8z .8w .( plus(x ,y ,z ) ^ :same(z ,w ) ) :plus(x ,y ,w ))
One advantage of doing things this way is economy. With these sentences, we do not need
the ground relational sentences about plus given above. ey are all logically entailed by our sen-
tences about next and the definitional sentences. A second advantage is versatility. Our sentences
define plus in terms of next for arithmetic with any modulus, not just modulus 4.
9y .8x .q (x ,y ) |= 8x .9y .q (x ,y )
8x .8y .q (x ,y ) |= 8x .8y .q (y ,x )
Understanding logical entailment for Relational Logic is complicated by the fact that it is
possible to have free variables in Relational Logic sentences. Consider, for example, the premise
q (x ,y ) and the conclusion q (y ,x ). Does q (x ,y ) logically entail q (y ,x ) or not?
Our definition for logical entailment and the semantics of Relational Logic give a clear an-
swer to this question. Logical entailment holds if and only if every truth assignment that satisfies
the premise satisfies the conclusion. A truth assignment satisfies a sentence with free variables if
and only if it satisfies every instance. In other words, a sentence with free variables is equivalent
to the sentence in which all of the free variables are universally quantified. In other words, q (x ,y )
is satisfied if and only if 8x .8y.q (x ,y ) is satisfied, and similarly for q (y ,x ). So, the first sentence
here logically entails the second if and only if 8x .8y.q (x ,y ) logically entails 8x .8y.q (y ,x ); and,
as we just saw, this is, in fact, the case.
(2) If our sentence is of the form 8 .' [ ], we eliminate the sentence from i and replace it with
copies of the scope, one copy for each object constant in our language.
iC1 D i - {8 .' [ ]} [ {' [ ] | an object constant}
iC1 D i
(3) If our sentence of the form 9 .' [ ], we eliminate the sentence from i and replace it with a
disjunction, where each disjunct is a copy of the scope in which the quantified variable is replaced
by an object constant in our language.
iC1 D i - {9 .' [ ]} [ {' [ 1 ] _ ... _ ' [ n ]}
iC1 D i
e procedure halts when i becomes empty. e set i is the grounding of the input. It
is easy to see that i is logically equivalent to the input set.
Here is an example. Suppose we have a language with just two object constants a and b . And
suppose we have the set of sentences shown below. We have one ground sentence, one universally
quantified sentence, and one existentially quantified sentence. All are in prenex form.
{p (a), 8x .(p (x ) ) q (x )), 9x .:q (x )}
A trace of the procedure is shown below. e first sentence is ground, so we remove it from
add it to . e second sentence is universally quantified, so we replace it with a copy for each
of our two object constants. e resulting sentences are ground, and so we move them one by one
from to . Finally, we ground the existential sentence and add the result to and then move
the ground sentence to . At this point, since is empty, is our grounding.
3 D {p (b ) ) q (b ), 9x .:q (x )}
3 D {p (a), p (a) ) q (a)}
4 D {9x .:q (x )}
4 D {p (a), p (a) ) q (a), p (b ) ) q (b )}
5 D {:q (a) _ :q (b )}
5 D {p (a), p (a) ) q (a), p (b ) ) q (b )}
6 D { }
6 D {p (a), p (a) ) q (a), p (b ) ) q (b ), :q (a) _ :q (b )}
RECAP
Relational Logic is an alternative to Propositional Logic that includes some linguistic features, viz.
constants and variables and quantifiers. In Relational Logic, simple sentences have more struc-
ture than in Propositional Logic. Furthermore, using variables and quantifiers, we can express
information about multiple objects without enumerating those objects; and we can express the
existence of objects that satisfy specified conditions without saying which objects they are. e
syntax of Relational Logic begins with object constants and relation constants. Relational sen-
tences are the atomic elements from which more complex sentences are built. Logical sentences are
formed by combining simpler sentences with logical operators. In the version of Relational Logic
used here, there are five types of logical sentences - negations, conjunctions, disjunctions, impli-
cations, and equivalences. ere are two types of quantified sentences, viz. universal sentences and
existential sentences. e Herbrand base for a Relational Logic language is the set of all ground rela-
tional sentences in the language. A truth assignment for a Relational Logic language is a mapping
that assigns a truth value to each element of it Herbrand base. e truth or falsity of compound
sentences is determined from a truth assignment using rules based on the five logical operators
of the language. A truth assignment satisfies a sentence if and only if the sentences is true under
that truth assignment. A sentence is valid if and only if it is satisfied by every truth assignment.
A sentence is satisfiable if and only if it is satisfied by at least one truth assignment. A sentence
is falsifiable if and only if there is at least one truth assignment that makes it false. A sentence is
unsatisfiable if and only if it is not satisfied by any truth assignment. A sentence is contingent if
and only if it is both satisfiable and falsifiable, i.e., it is neither valid nor unsatisfiable. A set of
sentences logically entails a sentence ' (written |= ' ) if and only if every truth assignment
that satisfies also satisfies ' .
6.12 EXERCISES
6.1. Say whether each of the following expressions is a syntactically legal sentence of Re-
lational Logic. Assume that jim and molly are object constants; assume that person is a
unary relation constant; and assume that parent is a binary relation constant.
(a ) parent (jim, molly)
(b ) parent (molly, molly)
(c ) :person(jim)
(d ) person(jim, molly)
(e ) parent (molly, z )
(f ) 9x .parent (molly, x )
(g ) 9y .parent (molly, jim)
(h) 8z .(z (jim, molly) ) z (molly, jim))
6.2. Consider a language with n object constants and a single binary relation constant.
2 n
(a ) How many ground terms are there in this language - n, n2 , 2n , 2n , 22 ?
2
(b ) How many ground atomic sentences are there in this language - n, n2 , 2n , 2n ,
n
22 ?
(c ) How many distinct truth assignments are possible for this language - n, n2 , 2n ,
2 n
2n , 22 ?
6.3. Consider a language with object constants a and b and relation constants p and q where p
has arity 1 and q has arity 2. Imagine a truth assignment that makes p (a), q (a,b ), q (b ,a)
true and all other ground atoms false. Say whether each of the following sentences is true
or false under this truth assignment.
(a ) 8x .(p (x ) ) q (x ,x ))
(b ) 8x .9y .q (x ,y )
(c ) 9y .8x .q (x ,y )
(d ) 8x .(p (x ) )
(e ) 8x .p (x ) ) 9y .q (y ,y )
6.4. Consider a state of the Sorority World that satisfies the following sentences.
Say which of the following sentences is satisfied by this state of the world.
(a) likes(dana,cody)
(b) :likes(abby,dana)
(c) likes(bess,cody) _ likes(bess,dana)
(d ) 8y.(likes(bess,y) => likes(abby,y))
(e) 8y.(likes(y,cody) ) likes(cody,y))
(f ) 8x.:likes(x,x)
6.5. Consider a version of the Blocks World with just three blocks—a, b, and c. e on relation
is axiomatized below.
A sentence ' is consistent with a set of sentences if and only if there is a truth assign-
ment that satisfies all of the sentences in [ {' }. Say whether each of the following
sentences is consistent with the sentences about on and above shown above.
(a) above(a,c)
(b) above(a,a)
(c) above(c,a)
6.6. Say whether each of the following sentences is valid, contingent, or unsatisfiable.
(a) 8x.p(x) ) 9x.p(x)
(b) 9x.p(x) ) 8x.p(x)
(c) 8x.p(x) ) p(x)
(d ) 9x.p(x) ) p(x)
(e) p(x) ) 8x.p(x)
(f ) p(x) ) 9x.p(x)
(g ) 8x.9y.p(x,y) ) 9y.8x.p(x,y)
(h) 8x.(p(x) ) q(x)) ) 9x.(p(x) ^ q(x))
(i) 8x.(p(x) ) q(x)) ^ 9x.(p(x) ^ :q(x))
(j ) (9x.p(x) ) 8x.q(x)) _ (8x.q(x) ) 9x.r (x))
6.7. Let be a set of Relational Logic sentences, and let ' and be individual Relational
Logic sentences. For each of the following claims, state whether it is true or false.
(a) 8x.' |= '
(b) ' |= 8x.'
(c) If |= :' [ ] for some ground term , then |# 8x.' [x]
(d ) If |= ' [ ] for some ground term , then |= 9x.' [x]
(e) If |= ' [ ] for every ground term , then |= 8x.' [x]
CHAPTER 7
Relational Analysis
7.1 INTRODUCTION
In Relational Logic, it is possible to analyze the properties of sentences in much the same way
as in Propositional Logic. Given a sentence, we can determine its validity, satisfiability, and so
forth by looking at possible truth assignments. And we can confirm logical entailment or logical
equivalence of sentences by comparing the truth assignments that satisfy them and those that
don’t.
e main problem in doing this sort of analysis for Relational Logic is that the number of
possibilities is even larger than in Propositional Logic. For a language with n object constants and
m relation constants of arity k , the Herbrand base has m nk elements; and consequently, there
k
are 2mn possible truth assignments to consider. If we have 10 objects and 5 relation constants
of arity 2, this means 2500 possibilities.
Fortunately, as with Propositional Logic, there are some shortcuts that allow us to analyze
sentences in Relational Logic without examining all of these possibilities. In this chapter, we start
with the truth table method and then look at some of these more efficient methods.
As in Propositional Logic, it is in principle possible to build a truth table for any set of sentences
in Relational Logic. is truth table can then be used to determine validity, satisfiability, and so
forth or to determine logical entailment and logical equivalence.
As an example, let us assume we have a language with just two object constants a and b and
two relation constants p and q . Now consider the sentences shown below, and assume we want
to know whether these sentences logically entail 9x .q (x ).
p (a) _ p (b )
8x .(p (x ) ) q (x ))
A truth table for this problem is shown below. Each of the first four columns represents
one of the elements of the Herbrand base for this language. e two middle columns represent
our premises, and the final column represents the conclusion.
p (a ) p (b ) q (a) q (b ) p (a) _ p (b ) 8x .(p (x ) ) q (x )) 9x .q (x )
1 1 1 1 1 1 1
1 1 1 0 1 0 1
1 1 0 1 1 0 1
1 1 0 0 1 0 0
1 0 1 1 1 1 1
1 0 1 0 1 1 1
1 0 0 1 1 0 1
1 0 0 0 1 0 0
0 1 1 1 1 1 1
0 1 1 0 1 0 1
0 1 0 1 1 1 1
0 1 0 0 1 0 0
0 0 1 1 0 1 1
0 0 1 0 0 1 1
0 0 0 1 0 1 1
0 0 0 0 0 1 0
Looking at the table, we see that there are 12 truth assignments that make the first premise
true and nine that make the second premise true and five that make them both true (rows 1, 5,
6, 9, and 11). Note that every truth assignment that makes both premises true also makes the
conclusion true. Hence, the premises logically entail the conclusion.
In this particular case, it turns out that there is just one model that satisfies all of these
sentences. e first step in creating this model is to create an empty table for the likes relation.
Abby
Bess
Cody
Dana
e data we are given has three units—the fact that Dana likes Cody and the facts that
Abby does not like Dana and Dana does not like Abby. Using this information we can refine our
model by putting a one into the third box in the fourth row and putting zeros in the fourth box
of the first row and the first box of the fourth row.
Abby Bess Cody Dana
Abby 0
Bess
Cody
Dana 0 1
Now, we know that Abby likes everyone that Bess likes. If Bess likes Dana, then we could
conclude that Abby likes Dana as well. We already know that Abby does not like Dana, so Bess
must not like Dana either.
Abby 0
Bess 0
Cody
Dana 0 1
At the same time, we know that Bess likes Cody or Dana. Since Bess does not like Dana,
she must like Cody. Once again using the fact that Abby likes everyone whom Bess likes, we
know that Abby also likes Cody.
Abby Bess Cody Dana
Abby 1 0
Bess 1 0
Cody
Dana 0 1
Abby and Dana both dislike Bess. Using this fact we can add 0s to the first and last cells of
the second column.
Abby 0 1 0
Bess 1 0
Cody
Dana 0 0 1
On the other hand, Cody likes everyone who likes her. is allows us to put a 1 in every
column of the third row where there is a 1 in the corresponding rows of the third column.
Abby Bess Cody Dana
Abby 0 1 0
Bess 1 0
Cody 1 1 1
Dana 0 0 1
Since nobody likes herself, we can put a 0 in each cell on the diagonal.
Abby 0 0 1 0
Bess 0 1 0
Cody 1 1 0 1
Dana 0 0 1 0
Finally, using the fact that Abby likes everyone that Bess likes, we conclude that Bess does
not like Abby. (If she did then Abby would like herself, and we know that that is false.)
Abby Bess Cody Dana
Abby 0 0 1 0
Bess 0 0 1 0
Cody 1 1 0 1
Dana 0 0 1 0
At this point, we have a complete model, and we can check our conclusion to see that this
model satisfies the desired conclusion. In this case, it is easy to see that Dana indeed does like
everyone that Bess likes.
We motivated this method by talking about cases where the given sentences have a unique
model, as in this case. However, the method can also be of value even when there are multiple
possible models. For example, if we had left out the belief that Cody likes everyone who likes her,
we would still have eight models (corresponding to the eight possible combinations of feelings
Cody has for Abby, Bess, and Dana). Yet, even with this ambiguity, it would be possible to de-
termine whether Dana likes everyone Bess likes using just the portion of the table already filled
in.
We can formalize the rules of this puzzle in the language of Logic. Once we have done
that, we can use the techniques described here to find a solution.
In our formalization, we use the expression cell (1,2,3) to express the fact that the cell in the
first row and the second column contains the numeral 3. For example, we can describe the initial
board shown above with the following sentences.
cell (1,2,4)
cell (1,4,1)
cell (2,1,2)
cell (3,4,3)
cell (4,3,4)
We use the expression same(x ,y ) to say that x is the same as y . We can axiomatize same by
simply stating when it is true and where it is false. An abbreviated axiomatization is shown below.
same(1,1) :same(2,1) :same(3,1) :same(4,1)
:same(1,2) same(2,2) :same(3,2) :same(4,2)
:same(1,3) :same(2,3) same(3,3) :same(4,3)
:same(1,4) :same(2,4) :same(3,4) same(3,4)
Using this vocabulary, we can write the rules defining Sukoshi as shown below. e first
sentence expresses the constraint that two cells in that same row can contain the same value. e
second sentence expresses the constraint that two cells in that same column can contain the same
value. e third constraint expresses the fact that every cell must contain at least one value.
8x .8y .8z .8w .( cell (x ,y ,w ) ^ cell (x ,z ,w ) ) same(y ,z ))
8x .8y .8z .8w .( cell (x ,z ,w ) ^ cell (y ,z ,w ) ) same(x ,y ))
8x .8y .9w .cell (x ,z ,w )
As a first step in solving this problem, we start by focussing on the fourth column, since
two of the cells in that column are already filled. We know that there must be a 4 in one of the
cells. It cannot be the first, since that cell contains a 1, and it cannot be the third since that cell
contains a 3. It also cannot be the fourth, since there is already a 4 in the third cell of the fourth
row. By process of elimination, the 4 must go in the fourth cell of the second row, leading to the
board shown below.
At this point, there is a four in every row and every column except for the first column in
the third row. So, we can safely place a four in that cell.
Since there is just one empty cell in the fourth column, we know it must be filled with the
single remaining value, viz. 2. After adding this value, we have the following board.
Now, let’s turn our attention to the first column. We know that there must be a 1 in one of
the cells. It cannot be the first, since there is already a 1 in that row, and it cannot be the second
or third since those cell already contain values. Consequently, the 1 must go in the first cell of the
fourth row.
Once again, we have a column with all but one cell filled. Column 1 has a 2 in the second
cell, a 4 in the third, and a 1 in the fourth. So, we can place a 3 in the first cell of that column.
At this point, we can fill in the single empty cell in the first row, leading to the following
board.
And we can fill in the single empty cell in the fourth row as well.
Now, let’s consider the second column. We cannot put a 2 in the second cell, since there is
already a 2 in that row. Since the first and last cells are already full, the only option is to put the
2 into the third cell.
Finally, we can place a 1 in the second cell of the second row. And, with that, the board is
full. We have a distinct numeral in every row and every column, as required by the rules.
Given the initial assignment in this case, it is fairly easy to find a complete assignment
that satisfies the Sukoshi constraints. For other initial assignments, solving the problem is more
difficult. However, the techniques described here still work to cut down on the amount of work
necessary. In fact, virtually all Sukoshi puzzles can be solved using these techniques without any
form of trial and error.
7.6 EXERCISES
7.1. Mr. Red, Mr. White, and Mr. Blue meet for lunch. Each is wearing a red shirt, a white
shirt, or a blue shirt. No one is wearing more than one color, and no two are wearing
the same color. Mr. Blue tells one of his companions, “Did you notice we are all wearing
shirts with different color from our names?”, and the other man, who is wearing a white
shirt, says, “Wow, that’s right!” Use the Boolean model technique to figure out who is
wearing what color shirt.
7.2. Amy, Bob, Coe, and Dan are traveling to different places. One goes by train, one by car,
one by plane, and one by ship. Amy hates flying. Bob rented his vehicle. Coe tends to
get seasick. And Dan loves trains. Use the Boolean models method to figure out which
person, used which mode of transportation.
7.3. Sudoku is a puzzle consisting of a 9 9 board divided into nine 3 3 subboards. In a
typical puzzle, several of the squares are already filled, as in the example shown below.
e goal of the puzzle is to place the numerals 1 through 9 into the remaining squares
of the board in such a way that no numeral is repeated in any row or column or 3 3
subboard.
Use the techniques described in the Chapter to solve this puzzle.
CHAPTER 8
Relational Proofs
8.1 INTRODUCTION
As with Propositional Logic, we can demonstrate logical entailment in Relational Logic by writ-
ing proofs. As with Propositional Logic, it is possible to show that a set of Relational Logic
premises logically entails a Relational Logic conclusion if and only if there is a finite proof of the
conclusion from the premises. Moreover, it is possible to find such proofs in a finite time.
In this chapter, we start by extending the Fitch system from Propositional Logic to Rela-
tional Logic. We then illustrate the system with a few examples. Finally, we talk about soundness
and completeness.
8.2 PROOFS
Formal proofs in Relational Logic are analogous to formal proofs in Propositional Logic. e
major difference is that there are additional mechanisms to deal with quantified sentences.
e Fitch system for Relational Logic is an extension of the Fitch system for Propositional
Logic. In addition to the ten logical rules of inference, there are four ordinary rules of inference
for quantified sentences and one additional rule for finite languages. Let’s look at each of these in
turn. (If you’re like me, the prospect of going through a discussion of so many rules of inference
sounds a little repetitive and boring. However, it is not so bad. Each of the rules has its own quirks
and idiosyncrasies, its own personality. In fact, a couple of the rules suffer from a distinct excess
of personality. If we are to use the rules correctly, we need to understand these idiosyncrasies.)
Universal Introduction (UI) allows us to reason from arbitrary sentences to universally quantified
versions of those sentences.
Universal Introduction
'
8:'
where does not occur free in both ' and an active assumption
Typically, UI is used on sentences with free variables to make their quantification explicit.
For example, if we have the sentence hates(jane,y ), then, we can infer 8y .hates(jane,y ).
Note that we can also apply the rule to sentences that do not contain the variable that
is quantified in the conclusion. For example, from the sentence hates(jane,jill ), we can infer
8x .hates(jane,jill ). And, from the sentence hates(jane,y ), we can infer 8x .hates(jane,y ). ese
are not particularly sensible conclusions. However, the results are correct, and the deduction of
such results is necessary to ensure that our proof system is complete.
ere is one important restriction on the use of Universal Introduction. If the variable
being quantified appears in the sentence being quantified, it must not appear free in any active
assumption, i.e., an assumption in the current subproof or any superproof of that subproof. For
example, if there is a subproof with assumption p (x ) and from that we have managed to derive
q (x ), then we cannot just write 8x .q (x ).
If we want to quantify a sentence in this situation, we must first use Implication Introduc-
tion to discharge the assumption and then we can apply Universal Introduction. For example, in
the case just described, we can first apply Implication Introduction to derive the result (p (x ) )
q (x )) in the parent of the subproof containing our assumption, and we can then apply Universal
Introduction to derive 8x .(p (x ) ) q (x )).
Universal Elimination (UE) allows us to reason from the general to the particular. It states that,
whenever we believe a universally quantified sentence, we can infer a version of the target of that
sentence in which the universally quantified variable is replaced by an appropriate term.
Universal Elimination
8:' [ ]
' [ ]
where is substitutable for in '
For example, consider the sentence 8y .hates(jane,y ). From this premise, we can infer
that Jane hates Jill, i.e., hates(jane,jill ). We also can infer that Jane hates her mother, i.e.,
hates(jane,mother (jane)). We can even infer than Jane hates herself, i.e., hates(jane,jane).
In addition, we can use Universal Elimination to create conclusions with free variables. For
example, from 8x .hates(jane,x ), we can infer hates(jane,x ) or, equivalently, hates(jane,y ).
In using Universal Elimination, we have to be careful to avoid conflicts with other variables
and quantifiers in the quantified sentence. is is the reason for the constraint on the replace-
ment term. As an example of what can go wrong without this constraint, consider the sentence
8x .9y .hates(x ,y ), i.e., everybody hates somebody. From this sentence, it makes sense to infer
9y .hates(jane,y ), i.e., Jane hates somebody. However, we do not want to infer 9y .hates(y ,y ); i.e.,
there is someone who hates herself.
We can avoid this problem by obeying the restriction on the Universal Elimination rule.
We say that a term is free for a variable in a sentence ' if and only if no free occurrence of
occurs within the scope of a quantifier of some variable in . For example, the term x is free
for y in 9z .hates(y ,z ). However, the term z is not free for y , since y is being replaced by z and y
occurs within the scope of a quantifier of z . us, we cannot substitute z for y in this sentence,
and we avoid the problem we have just described.
Existential Introduction (EI) is easy. If we believe a sentence involving a ground term , then we
can infer an existentially quantified sentence in which one, some, or all occurrences of have been
replaced by the existentially quantified variable.
Existential Introduction
' [ ]
9:' [ ]
For example, from the sentence hates(jill,jill ), we can infer that there is someone who hates
herself, i.e., 9x .hates(x ,x ). We can also infer that there is someone Jill hates, i.e., 9x .hates(jill,x ),
and there is someone who hates Jill, i.e., 9y .hates(x ,jill ). And, by two applications of Existential
Introduction, we can infer that someone hates someone, i.e., 9x .9y .hates(x ,y ).
Note that, in Existential Introduction, it is important to avoid variables that appear in
the sentence being quantified. Without this restriction, starting from 9x .hates(jane,x ), we might
deduce 9x .9x .hates(x ,x ). It is an odd sentence since it contains nested quantifiers of the same
variable. However, it is a legal sentence, and it states that there is someone who hates himself,
which does not follow from the premise in this case.
Existential Elimination (EE). Suppose we have an existentially quantified sentence with target ' ;
and suppose we have a universally quantified implication in which the antecedent is the same as
the scope of our existentially quantified sentence and the conclusion does not contain any occur-
rences of the quantified variable. en, we can use Existential Elimination to infer the consequent.
Existential Elimination
9:' [ ]
8 .(' [ ] ) )
8.3 EXAMPLE
As an illustration of these concepts, consider the following problem. Suppose we believe that
everybody loves somebody. And suppose we believe that everyone loves a lover. Our job is to
prove that Jack loves Jill.
First, we need to formalize our premises. Everybody loves somebody. For all y , there exists
a z such that loves(y ,z ).
8y .9z .loves(y ,z )
Everybody loves a lover. If a person is a lover, then everyone loves him. If a person loves
another person, then everyone loves him. For all x and for all y and for all z , loves(y ,z ) implies
loves(x ,y ).
8x .8y .8z .(loves(y ,z ) ) loves(x ,y ))
Our goal is to show that Jack loves Jill. In other words, starting with the preceding sen-
tences, we want to derive the following sentence.
loves(jack,jill )
A proof of this result is shown below. Our premises appear on lines 1 and 2. e sentence
on line 3 is the result of applying Universal Elimination to the sentence on line 1, substituting jill
for y . e sentence on line 4 is the result of applying Universal Elimination to the sentence on line
2, substituting jack for x . e sentence on line 5 is the result of applying Universal Elimination to
the sentence on line 4, substituting jill for y . Finally, we apply Existential Elimination to produce
our conclusion on line 6.
1. 8y .9z .loves(y ,z ) Premise
2. 8x .8y .8z .(loves(y ,z ) ) loves(x ,y )) Premise
3. 9z .loves(jill,z ) UE: 1
4. 8y .8z .(loves(y ,z ) ) loves(jack,y )) UE: 2
5. 8z .(loves(jill,z ) ) loves(jack,jill )) UE: 4
6. loves(jack,jill ) EE: 3, 5
Now, let’s consider a slightly more interesting version of this problem. We start with the
same premises. However, our goal now is to prove the somewhat stronger result that everyone
loves everyone. For all x and for all y , x loves y .
8x .8y .loves(x ,y )
e proof shown below is analogous to the proof above. e only difference is that we
have free variables in place of object constants at various points in the proof. Once again, our
premises appear on lines 1 and 2. Once again, we use Universal Elimination to produce the result
on line 3; but this time the result contains a free variable. We get the results on lines 4 and 5 by
successive application of Universal Elimination to the sentence on line 2. We deduce the result on
line 6 using Existential Elimination. Finally, we use two applications of Universal Introduction
to generalize our result and produce the desired conclusion.
1. 8y .9z .loves(y ,z ) Premise
2. 8x .8y .8z .(loves(y ,z ) ) loves(x ,y )) Premise
3. 9z .loves(y ,z ) UE: 1
4. 8y .8z .(loves(y ,z ) ) loves(x ,y )) UE: 2
5. 8z .(loves(y ,z ) ) loves(x ,y )) UE: 4
6. loves(x ,y ) EE: 3, 5
7. 8y .loves(x ,y ) UI: 6
8. 8x .8y .loves(x ,y ) UI: 7
is second example illustrates the power of free variables. We can manipulate them as
though we are talking about specific individuals (though each one could be any object); and,
when we are done, we can universalize them to derive universally quantified conclusions.
8.4 EXAMPLE
As another illustration of Relational Logic proofs, consider the following problem. We know that
horses are faster than dogs and that there is a greyhound that is faster than every rabbit. We know
that Harry is a horse and that Ralph is a rabbit. Our job is to derive the fact that Harry is faster
than Ralph.
First, we need to formalize our premises. e relevant sentences follow. Note that we have
added two facts about the world not stated explicitly in the problem: that greyhounds are dogs
and that our faster than relationship is transitive.
8x .8y .(h(x ) ^ d (y ) ) f (x ,y ))
9y .(g (y ) ^ 8z .(r (z ) ) f (y ,z )))
8y .(g (y ) ) d (y ))
8x .8y .8z .(f (x ,y ) ^ f (y ,z ) ) f (x ,z ))
h(harry)
r (ralph)
Our goal is to show that Harry is faster than Ralph. In other words, starting with the
preceding sentences, we want to derive the following sentence.
f (harry,ralph)
e derivation of this conclusion goes as shown below. e first six lines correspond to the
premises just formalized. On line 7, we start a subproof with an assumption corresponding to the
scope of the existential on line 2, with the idea of using Existential Elimination later on in the
proof. Lines 8 and 9 come from And Elimination. Line 10 is the result of applying Universal
Elimination to the sentence on line 9. On line 11, we use Implication Elimination to infer that y
is faster than Ralph. Next, we instantiate the sentence about greyhounds and dogs and infer that
y is a dog. en, we instantiate the sentence about horses and dogs; we use And Introduction
to form a conjunction matching the antecedent of this instantiated sentence; and we infer that
Harry is faster than y . We then instantiate the transitivity sentence, again form the necessary con-
junction, and infer the desired conclusion. Finally, we use Implication Introduction to discharge
our subproof; we use Universal Introduction to universalize the results; and we use Existential
Elimination to produce our desired conclusion.
1. ∀x.∀y.(h(x) ˄ d(y) ⇒ f(x,y)) Premise
2. ∃y.(g(y) ˄ ∀z.(r(z) ⇒ f(y,z)) Premise
3. ∀y.(g(y) ⇒ d(y)) Premise
4. ∀x.∀y.∀z.f(x,y)) ˄ f(y,z) ⇒ f(x,z)) Premise
5. h(harry) Premise
6. r(ralph) Premise
7. g(y) ˄ ∀z.(r(z) ⇒ f(y,z)) Assumption
8. g(y) AE: 7
9. ∀z.(r(z) ⇒ f(y,z)) AE: 7
10. r(ralph) ⇒ f(y,ralph)) UE: 9
11. f(y,ralph)) IE: 10, 6
12. g(y) ⇒ d(y) UE: 3
13. d(y) IE: 12, 8
14. ∀y.(h(harry) ˄ d(y) ⇒ f(harry,y)) UE: 1
15. h(harry) ˄ d(y) ⇒ f(harry,y) UE: 14
16. h(harry) ˄ d(y) AI: 5. 13
17. f(harry,y) IE: 15, 16
18. ∀y.∀z.(f(harry,y) ˄ f(y,z) ⇒ f(harry,z)) UE: 4
19. ∀z.(f(harry,y) ˄ f(y,z) ⇒ f(harry,z)) UE: 18
20. f(harry,y) ˄ f(y,ralph) ⇒ f(harry,ralph) UE: 19
21. f(harry,y) ˄ f(y,ralph) AI: 17, 11
22. f(harry,ralph) IE: 20, 21
23. g(y) ˄ ∀z.(r(z) ⇒ f(y,z)) ⇒ f(harry,ralph) II: 7, 22
24. ∀y.(g(y) ˄ ∀z.(r(z) ⇒ f(y,z)) ⇒ f(harry,ralph)) UI: 23
25. f(harry,ralph) EE: 2, 24
is derivation is somewhat lengthy, but it is completely mechanical. Each conclusion fol-
lows from previous conclusions by a mechanical application of a rule of inference. On the other
hand, in producing this derivation, we rejected numerous alternative inferences. Making these
choices intelligently is one of the key problems in the process of inference.
8.5 EXAMPLE
In this section, we use our proof system to prove some basic results involving quantifiers.
Given 8x .8y .(p (x ,y ) ) q (x )), we know that 8x .(9y .p (x ,y ) ) q (x )). In general, given a
universally quantified implication, it is okay to drop a universal quantifier of a variable outside the
implication and apply an existential quantifier of that variable to the antecedent of the implication,
provided that the variable does not occur in the consequent of the implication.
Our proof is shown below. As usual, we start with our premise. We start a subproof with
an existential sentence as assumption. en, we use Universal Elimination to strip away the outer
quantifier from the premise. is allows us to derive q (x ) using Existential Elimination. Finally,
we create an implication with Implication Introduction, and we generalize using Universal Intro-
duction.
1. ∀x.∀y.(p(x,y) q(x)) Premise
2. ∃y.p(x,y) Assumption
3. ∀y.(p(x,y) q(x)) UE: 1
4. q(x) EE: 2, 3
5. y.p(x,y)
y. q(x) II: 4
6. x y.p(x,y)
x( y. q(x)) UI: 5
e relationship holds the other way around as well. Given 8x .(9y .p (x ,y ) ) q (x )), we
know that 8x .8y .(p (x ,y ) ) q (x )). We can convert an existential quantifier in the antecedent of
an implication into a universal quantifier outside the implication.
Our proof is shown below. As usual, we start with our premise. We start a subproof by
making an assumption. en we turn the assumption into an existential sentence to match the an-
tecedent of the premise. We use Universal Implication to strip away the quantifier in the premise
to expose the implication. en, we apply Implication Elimination to derive q (x ). Finally, we
create an implication with Implication Introduction, and we generalize using two applications of
Universal Introduction.
1. ∀x.(∃y.(p(x,y) ⇒ q(x)) Premise
2. p(x,y) Assumption
3. ∃y.p(x,y) EI: 2
4. ∃y.p(x,y) ⇒ q(x) UE: 1
5. q(x) IE: 4, 3
6. p(x,y) q(x) II: 5
7. x. y.(p(x,y)
y q(x)) 2 × UI: 6
RECAP
A Fitch system for Relational Logic can be obtained by extending the Fitch system for Propo-
sitional Logic with four additional rules to deal with quantifiers. e Universal Introduction rule
allows us to reason from arbitrary sentences to universally quantified versions of those sentences.
e Universal Elimination rule allows us to reason from a universally quantified sentence to a
version of the target of that sentence in which the universally quantified variable is replaced by an
appropriate term. e Existential Introduction rule allows us to reason from a sentence involving
a term to an existentially quantified sentence in which one, some, or all occurrences of have
been replaced by the existentially quantified variable. Finally, the Existential Elimination rule al-
lows us to reason from an existentially quantified sentence 9 .' [ ] and a universally quantified
implication 8 .(' [ ] ) ) to the consequent , under the condition that does not occur in
.
8.6 EXERCISES
8.1. Given 8x .(p (x ) ^ q (x )), use the Fitch System to prove 8x .p (x ) ^ 8x .q (x ).
8.2. Given 8x .(p (x ) ) q (x )), use the Fitch System to prove 8x .p (x ) ) 8x .q (x ).
8.3. Given the premises 8x .(p (x ) ) q (x )) and 8x .(q (x ) ) r (x )), use the Fitch system to
prove the conclusion 8x .(p (x ) ) r (x )).
8.4. Given 8x .8y .p (x ,y ), use the Fitch System to prove 8y .8x .p (x ,y ).
8.5. Given 8x .8y .p (x ,y ), use the Fitch System to prove 8x .8y .p (y ,x ).
8.6. Given 9y .8x .p (x ,y ), use the Fitch system to prove 8x .9y .p (x ,y ).
8.7. Given 9x .:p (x ), use the Fitch System to prove :8x .p (x ).
8.8. Given 8x .p (x ), use the Fitch System to prove :9x .:p (x ).
CHAPTER 9
Herbrand Logic
9.1 INTRODUCTION
Relational Logic, as defined in Chapter 6, allows us to axiomatize worlds with varying numbers
of objects. e main restriction is that the worlds must be finite (since we have only finitely many
constants to refer to these objects).
Often, we want to describe worlds with infinitely many objects. For example, it would be
nice to axiomatize arithmetic over the integers or to talk about sequences of objects of varying
lengths. Unfortunately, this is not possible due to the finiteness restriction of Relational Logic.
One way to get infinitely many terms is to allow our vocabulary to have infinitely many
object constants. While there is nothing wrong with this in principle, it makes the job of axiom-
atizing things effectively impossible, as we would have to write out infinitely many sentences in
many cases.
In this chapter, we explore an alternative to Relational Logic, called Herbrand Logic, in
which we can name infinitely many objects with a finite vocabulary. e trick is to expand our
language to include not just object constants but also complex terms that can be built from object
constants in infinitely many ways. By constructing terms in this way, we can get infinitely many
names for objects; and, because our vocabulary is still finite, we can finitely axiomatize some things
in a way that would not be possible with infinitely many object constants.
In this chapter, we proceed through the same stages as in the introduction to Relational
Logic. We start with syntax and semantics. We then discuss evaluation and satisfaction. We look
at some examples. And we conclude with a discussion of some of the properties of Herbrand
Logic.
A truth assignment for Herbrand Logic is a mapping that gives each ground relational
sentence in the Herbrand base a unique truth value. is is the same as for Relational Logic.
e main difference from Relational Logic is that, in this case, a truth assignment is necessarily
infinite, since there are infinitely many elements in the Herbrand Base.
Luckily, things are not always so bad. In some cases, only finitely many elements of the
Herbrand base are true. In such cases, we can describe a truth assignment in finite space by
writing out the elements that are true and assuming that all other elements are false. We shall see
some examples of this in the coming sections.
e rules defining the truth of logical sentences in Herbrand Logic are the same as those
for logical sentences in Propositional Logic and Relational Logic, and the rules for quantified
sentences in Herbrand Logic are exactly the same as those for Relational Logic.
9.3 EVALUATION AND SATISFACTION
e concept of evaluation for Herbrand Logic is the same as that for Relational Logic. Unfortu-
nately, evaluation is usually not practical in this case for two reasons. First of all, truth assignments
are infinite in size and so we cannot always write them down. Even when we can finitely char-
acterize a truth assignment (e.g., when the set of true sentences is finite), we may not be able
to evaluate quantified sentences mechanically in all cases. In the case of a universally quantified
formula, we need to check all instances of the scope, and there are infinitely many possibilities. In
the case of an existentially quantified sentence, we need to enumerate possibilities until we find
one that succeeds, and we may never find one if the existentially quantified sentence is false.
Satisfaction has similar difficulties. e truth tables for Herbrand Logic are infinitely large
and so we cannot write out or check all possibilities.
e good news is that, even though evaluation and satisfaction are not directly computable,
there are effective procedures for indirectly determining validity, contingency, unsatisfiability, log-
ical entailment, and so forth that work in many cases even when our usual direct methods fail. e
key is symbolic manipulation of various sorts, e.g., the generation of proofs, which we describe
in the next few chapters. But, first, in order to gain some intuitions about the power of Herbrand
Logic, we look at some examples.
proposition(p )
proposition(q )
proposition(r )
Next, we define the types of expressions involving our various logical operators.
8x .(sentence(x ) ) negation(not (x )))
8x .8y .(sentence(x ) ^ sentence(y ) ) conjunction(and (x ,y )))
8x .8y .(sentence(x ) ^ sentence(y ) ) disjunction(or (x ,y )))
8x .8y .(sentence(x ) ^ sentence(y ) ) implication(if (x ,y )))
8x .8y .(sentence(x ) ^ sentence(y ) ) biconditional (iff (x ,y )))
Finally, we define sentences as expressions of these types.
8x .(proposition(x ) ) sentence(x ))
8x .(negation(x ) ) sentence(x ))
8x .(conjunction(x ) ) sentence(x ))
8x .(disjunction(x ) ) sentence(x ))
8x .(implication(x ) ) sentence(x ))
8x .(biconditional (x ) ) sentence(x ))
Note that these sentences constrain the types of various expressions but do not define them
completely. For example, we have not said that not (p ) is not a conjunction. It is possible to make
our definitions more complete by writing negative sentences. However, they are a little messy, and
we do not need them for the purposes of this section.
With a solid characterization of syntax, we can formalize our rules of inference. We start by
representing each rule of inference as a relation constant. For example, we use the ternary relation
constant ai to represent And Introduction, and we use the binary relation constant ae to represent
And Elimination. With this vocabulary, we can define these relations as shown below.
8x .8y .(sentence(x ) ^ sentence(y ) ) ai(x ,y ,and (x ,y )))
8x .8y .(sentence(x ) ^ sentence(y ) ) ae(and (x ,y ),x ))
8x .8y .(sentence(x ) ^ sentence(y ) ) ae(and (x ,y ),y ))
In similar fashion, we can define proofs—both linear and structured. We can even define
truth assignments, satisfaction, and the properties of validity, satisfiability, and so forth. Hav-
ing done all of this, we can use the proof methods discussed in the next chapters to prove our
metatheorems about Propositional Logic.
We can use a similar approach to formalizing Relational Logic within Relational Logic.
However, in that case, we need to be very careful. If done incorrectly, we can write paradoxical
sentences, i.e., sentences that are neither true nor false. For example, a careless formalization
leads to formal versions of sentences like is sentence is false, which is self-contradictory, i.e., it
cannot be true and cannot be false. Fortunately, with care it is possible to avoid such paradoxes
and thereby get useful work done.
9.8 UNDECIDABILITY
e good news about Herbrand Logic is that it is highly expressive. We can formalize things
in Herbrand Logic that cannot be formalized (at least in finite form) in Relational Logic. For
example, we showed how to define addition and multiplication in finite form. is is not possible
with Relational Logic and in other logics (e.g., First-Order Logic).
e bad news is that the questions of unsatisfiability and logical entailment for Herbrand
Logic are not effectively computable. Explaining this in detail is beyond the scope of this course.
However, we can give a line of argument that suggests why it is true. e argument reduces a
problem that is generally accepted to be non-semidecidable to the question of unsatisfiability /
logical entailment for Herbrand Logic. If our logic were semidecidable, then this other question
would be semidecidable as well; and, since it is known not to be semidecidable, then Herbrand
Logic must not be semidecidable either.
As we know, Diophantine equations can be readily expressed as sentences in Herbrand
Logic. For example, we can represent the solvability of Diophantine equation 3x 2 D 1 with the
sentence shown below.
We can represent every Diophantine equation in an analogous way. We can express the
unsolvability of a Diophantine equation by negating the corresponding sentence. We can then
ask the question of whether the axioms of arithmetic logically entail this negation or, equivalently,
whether the axioms of Arithmetic together with the unnegated sentence are unsatisfiable.
e problem is that it is well known that determining whether Diophantine equations
are unsolvable is not semidecidable. If we could determine the unsatisfiability of our encoding
of a Diophantine equation, we could decide whether it is unsolvable, contradicting the non-
semidecidability of that problem.
Note that this does not mean Herbrand Logic is useless. In fact, it is great for expressing
such information; and we can prove many results, even though, in general, we cannot prove ev-
erything that follows from arbitrary sets of sentences in Herbrand Logic. We discuss this issue
further in later chapters.
RECAP
Herbrand Logic is an extended version of Relational Logic that includes functional expressions.
Since functional expressions can be composed with each other in infinitely many ways, the Her-
brand base for Herbrand Logic is infinite, allowing us to axiomatize infinite relations with a
finite vocabulary. Other than the addition of functional expressions, the syntax and semantics of
Herbrand Logic is the same as that of Relational Logic. Questions of unsatisfiability and logical
entailment can sometimes be computed in Herbrand Logic, though in general those questions
are not effectively computable.
9.9 EXERCISES
9.1. Say whether each of the following expressions is a syntactically legal sentence of Herbrand
Logic. Assume that a and b are object constants, f is a unary function constant, and p
is a unary relation constant.
(a ) p (a)
(b ) p (f (a))
(c ) f (f (a))
(d ) p (f (f (a)))
(e ) p (f (p (a)))
9.2. Say whether each of the following sentences is logically entailed by the sentences in Sec-
tion 9.4.
(a) same(s (0),s (s (s (0))))
(b ) plus(s (s (0)),s (s (s (0))),s (s (s (s (s (0))))))
(c ) times(s (s (0)),s (s (s (0))),s (s (s (s (s (0))))))
(d ) times(s (0),s (s (s (0))),s (s (s (0))))
9.3. Say whether each of the following sentences is logically entailed by the sentences in Sec-
tion 9.5.
(a) append (nil, nil, nil )
(b ) append (cons(a, nil ), nil, cons(a, nil ))
(c ) append (cons(a, nil ), cons(b , nil ), cons(a, b ))
(d ) append (cons(cons(a, nil ), nil ), cons(b , nil ), cons(a, cons(b , nil )))
9.4. Say whether each of the following sentences is a grammatical sentence of Pseudo English
according to the enhanced grammar presented at the end of Section 9.6.
(a ) Mary likes Pat and Quincy.
(b ) Mary likes Pat and Mary likes Quincy.
(c ) Mary likes Mary.
(d ) Mary likes herself.
9.5. Say whether each of the following sentences is logically entailed by the sentences in Sec-
tion 9.7.
(a) conjunction(and (not (p ), not (q )))
(b ) conjunction(not (or (not (p ), not (q ))))
(c ) ae(and (p , or (p , q )), or (p , q ))
(d ) ae(and (p , or (p , q )), and (p , q ))
CHAPTER 10
Herbrand Proofs
10.1 INTRODUCTION
Logical entailment for Herbrand Logic is defined the same as for Propositional Logic and Rela-
tional Logic. A set of premises logically entails a conclusion if and only if every truth assignment
that satisfies the premises also satisfies the conclusions. In the case of Propositional Logic and
Relational Logic, we can check logical entailment by examining a truth table for the language.
With finitely many proposition constants, the truth table is large but finite. For Herbrand Logic,
things are not so easy. It is possible to have Herbrand bases of infinite size; and, in such cases,
truth assignments are infinitely large and there are infinitely many of them, making it impossible
to check logical entailment using truth tables.
All is not lost. As with Propositional Logic and Relational Logic, we can establish logical
entailment in Herbrand Logic by writing proofs. In fact, it is possible to show that, with a few
simple restrictions, a set of premises logically entails a conclusions if and only if there is a finite
proof of the conclusion from the premises, even when the Herbrand base is infinite. Moreover,
it is possible to find such proofs in a finite time. at said, things are not perfect. If a set of
sentences does not logically entail a conclusion, then the process of searching for a proof might
go on forever. Moreover, if we remove the restrictions mentioned above, we lose the guarantee of
finite proofs. Still, the relationship between logical entailment and finite provability, given those
restrictions, is a very powerful result and has enormous practical benefits.
In this chapter, we talk about the non-compactness of Herbrand Logic and the loss of
completeness in our proof procedure. In the next chapter, we look at an extension to Fitch, called
Induction, that allows us to prove more results in Herbrand Logic.
Induction
11.1 INTRODUCTION
Induction is reasoning from the specific to the general. If various instances of a schema are true
and there are no counterexamples, we are tempted to conclude a universally quantified version of
the schema.
p (a) ) q (a)
p (b ) ) q (b ) ! 8x .p (x ) ) q (x )
p (c ) ) q (c )
Incomplete induction is induction where the set of instances is not exhaustive. From a reason-
able collection of instances, we sometimes leap to the conclusion that a schema is always true even
though we have not seen all instances. Consider, for example, the function f where f .1/ D 1,
and f .n C 1/ D f .n/ C 2n C 1. If we look at some values of this function, we notice a certain
regularity—the value of f always seems to be the square of its input. From this sample, we are
tempted to leap to the conclusion that f .n/ D n2 . Lucky guess. In this case, the conclusion hap-
pens to be true; and we can prove it.
n f (n) n2
1 1 1
2 4 22
3 9 32
4 16 42
5 25 52
Here is another example. is one is due to the mathematician Fermat (1601–1665). He
n
looked at values of the expression 22 C 1 for various values of n and noticed that they were all
prime. So, he concluded the value of the expression was prime number. Unfortunately, this was
not a lucky guess. His conjecture was ultimately disproved, in fact with the very next number in
the sequence. (Mercifully, the counterexample was found after his death.)
n
n 22 C 1 Prime?
1 5 Yes
2 17 Yes
3 257 Yes
4 65537 Yes
For us, this is not so good. In Logic, we are concerned with logical entailment. We want
to derive only conclusions that are guaranteed to be true when the premises are true. Guesses like
these are useful in suggesting possible conclusions, but they are not themselves proofs. In order
to be sure of universally quantified conclusions, we must be sure that all instances are true. is
is called complete induction. When applied to numbers, it is usually called mathematical induction.
e technique used for complete induction varies with the structure of the language to
which it is applied. We begin this chapter with a discussion of domain closure, a rule that applies
when the Herbrand base of our language is finite. We then move on to Linear Induction, i.e., the
special case in which the ground terms in the language form a linear sequence. We look at tree
induction, i.e., the special case in which the ground terms of the language form a tree. And we
look at Structural Induction, which applies to all languages. Finally, we look at two special cases
that make inductive reasoning more complicated—Multidimensional Induction and Embedded
Induction.
' [ 1 ]
...
' [ n ]
8 .' [ ]
Recall that, in our formalization of the Sorority World, we have just four constants—abby,
bess, cody, and dana. For this language, we would have the following Domain Closure rule.
e following proof shows how we can use this rule to derive an inductive conclusion. Given
the premises we considered earlier in this book, it is possible to infer that Abby likes someone,
Bess likes someone, Cody likes someone, and Dana likes someone. Taking these conclusions
as premises and using our Domain Closure rule, we can then derive the inductive conclusion
8x .9y .likes(x ,y ), i.e., everybody likes somebody.
1. 9y .likes(abby,y ) Premise
2. 9y .likes(bess,y ) Premise
3. 9y .likes(cody,y ) Premise
4. 9y .likes(dana,y ) Premise
5. 8x .9y .likes(x ,y ) Domain Closure: 1, 2, 3, 4
Unfortunately, this technique does not work when there are infinitely many ground terms.
Suppose, for example, we have a language with ground terms 1 , 2 , ... A direct generalization
of the Domain Closure rule is shown below.
' [ 1 ]
' [ 2 ]
...
8 .' [ ]
is rule is sound in the sense that the conclusion of the rule is logically entailed by the
premises of the rule. However, it does not help us produce a proof of this conclusion. To use the
rule, we would need to prove all of the rule’s premises. Unfortunately, there are infinitely many
premises. So, the rule cannot be used in generating a finite proof.
All is not lost. It is sometimes possible to write rules that cover all instances without enu-
merating them individually. e method depends on the structure of the language. e next
sections describe how this can be done for languages with different structures.
In this section, we concentrate on languages that have linear structure of this sort. Hereafter,
we call these linear languages. In all cases, there is a single object constant and a single unary
function constant. In talking about a linear language, we call the object constant the base element
of the language, and we call the unary function constant the successor function.
Although there are infinitely many ground terms in any linear language, we can still gen-
erate finite proofs that are guaranteed to be correct. e trick is to use the structure of the terms
in the language in expressing the premises of an inductive rule of inference known as Linear In-
duction. See below for a statement of the induction rule for the language introduced above. In
general, if we know that a schema holds of our base element and if we know that, whenever the
schema holds of an element, it also holds of the successor of that element, then we can conclude
that the schema holds of all elements.
Linear Induction
' [a]
8.(' [] ) ' [s ()]
8 .' [ ]
A bit of terminology before we go on. e first premise in this rule is called the base case
of the induction, because it refers to the base element of the language. e second premise is
called the inductive case. e antecedent of the inductive case is called the inductive hypothesis,
and the consequent is called, not surprisingly, the inductive conclusion. e conclusion of the rule
is sometimes called the overall conclusion to distinguish it from the inductive conclusion.
For the language introduced above, our rule of inference is sound. Suppose we know that
a schema is true of a and suppose that we know that, whenever the schema is true of an arbitrary
ground term , it is also true of the term s ( ). en, the schema must be true of everything, since
there are no other terms in the language.
e requirement that the signature consists of no other object constants or function con-
stants is crucial. If this were not the case, say there were another object constant b , then we would
have trouble. It would still be true that ' holds for every element in the set {a, s (a), s (s (a)),...}.
However, because there are other elements in the Herbrand universe, e.g., b and s (b ), 8x .' (x )
would no longer be guaranteed.
Here is an example of induction in action. Recall the formalization of Arithmetic intro-
duced in Chapter 9. Using the object constant 0 and the unary function constant s , we represent
each number n by applying the function constant to 0 exactly n times. For the purposes of this ex-
ample, let’s assume we have just one ternary relation constant, viz. plus, which we use to represent
the addition table.
e following axioms describe plus in terms of 0 and s . e first sentence here says that
adding 0 to any element produces that element. e second sentence states that adding the suc-
cessor of a number to another number yields the successor of their sum. e third sentence is a
functionality axiom for plus.
8y .plus(0,y ,y )
8x .8y .8z .(plus(x ,y ,z ) )plus(s (x ),y ,s (z )))
8x .8y .8z .8w .( plus(x ,y ,z ) ^ :same(z ,w ) ) :plus(x ,y ,w ))
It is easy to see that any table that satisfies these axioms includes all of the usual addition
facts. e first axiom ensures that all cases with 0 as first argument are included. From this fact
and the second axiom, we can see that all cases with s (0) as first argument are included. And so
forth.
e first axiom above tells us that 0 is a left identity for addition—0 added to any number
produces that number as result. As it turns out, given these definitions, 0 must also be a right
identity, i.e., it must be the case that 8x .plus(x ,0,x ).
We can use induction to prove this result as shown below. We start with our premises. We
use Universal Elimination on the first premise to derive the sentence on line 3. is takes care
of the base case of our induction. We then start a subproof and assume the antecedent of the
inductive case. We then use three applications of Universal Elimination on the second premise to
get the sentence on line 5. We use Implication Elimination on this sentence and our assumption
to derive the conclusion on line 6. We then discharge our assumption and form the implication
shown on line 7 and then universalize this to get the result on line 8. Finally, we use Linear
Induction to derive our overall conclusion.
1. ∀y.plus(0,y,y) Premise
2. ∀x.∀y.∀z.(plus(x,y,z) ⇒ plus(s(x),y,s(z))) Premise
3. plus(0,0,0) UE: 1
4. plus(x,0,x) Assumption
5. plus(x,0,x) ⇒ plus(s(x),0,s(x)) 3 × UE: 2
6. plus(s(x),0,s(x)) IE: 5, 4
7. plus(x,0,x) ⇒ plus(s(x),0,s(x)) II: 4, 6
8. x.(plus(x,0,x) ⇒ plus(s(x),0,s(x))) UI: 7
9. x.(plus(x,0,x) Ind: 3, 8
Most inductive proofs have this simple structure. We prove the base case. We assume the
inductive hypothesis; we prove the inductive conclusion; and, based on this proof, we have the
inductive case. From the base case and the inductive case, we infer the overall conclusion.
As with linear languages, we can write an inductive rule of inference for tree languages. e
tree induction rule of inference for the language just described is shown below. Suppose we know
that a schema ' holds of a. Suppose we know that, whenever the schema holds of any element, it
holds of the term formed by applying f to that element. And suppose we know that, whenever
the schema holds of any element, it holds of the term formed by applying g to that element. en,
we can conclude that the schema holds of every element.
Tree Induction
' [a]
8.(' [] ) ' [f ()])
8.(' [] ) ' [g ()])
8 .' [ ]
In order to see an example of tree induction in action, consider the ancestry tree for a
particular dog. We use the object constant rex to refer to the dog; we use the unary function
constant f to map an arbitrary dog to its father; and we use g map a dog to its mother. Finally,
we have a single unary relation constant purebred that is true of a dog if and only if it is purebred.
Now, we write down the fundamental rule of dog breeding—we say that a dog is purebred
if and only if both its father and its mother are purebred. See below. (is is a bit oversimplified
on several grounds. Properly, the father and mother should be of the same breed. Also, this for-
malization suggests that every dog has an ancestry tree that stretches back without end. However,
let’s ignore these imperfections for the purposes of our example.)
8x .(purebred (x ) , purebred (f (x )) ^ purebred (g (x )))
Suppose now that we discover the fact that our dog rex is purebred. en, we know that
every dog in his ancestry tree must be purebred. We can prove this by a simple application of tree
induction.
A proof of our conclusion is shown below. We start with the premise that Rex is purebred.
We also have our constraint on purebred animals as a premise. We use Universal Elimination to
instantiate the second premise, and then we use Biconditional Elimination on the biconditional
in line 3 to produce the implication on line 4. On line 5, we start a subproof with the assumption
the x is purebred. We use Implication Elimination to derive the conjunction on line 6, and then
we use And Elimination to pick out the first conjunct. We then use Implication Introduction to
discharge our assumption, and we Universal Introduction to produce the inductive case for f .
We then repeat this process to produce an analogous result for g on line 14. Finally, we use the
tree induction rule on the sentences on lines 1, 9, and 14 and thereby derive the desired overall
conclusion.
1. purebred(rex) Premise
2. ∀x.(purebred(x) ⟺ purebred(f(x)) ˄ purebred(g(x))) Premise
3. (purebred(x)⟺purebred(f(x)) ˄ purebred(g(x)) UE: 2
4. (purebred(x) ⇒ purebred(f(x)) ˄ purebred(g(x)) BE: 3
5. purebred(x) Assumption
6. purebred(f(x)) ˄ purebred(g(x)) IE: 4, 5
7. purebred(f(x)) AE: 6
8. purebred(x) ⇒ purebred(f(x)) II: 5, 7
9. ∀x.purebred(x) ⇒ purebred(f(x)) UI: 8
10. purebred(x) Assumption
11. purebred(f(x)) ˄ purebred(g(x)) IE: 4, 10
12. purebred(g(x)) AE: 11
13. purebred(x) ⇒ purebred(g(x)) II: 10, 12
14. x.
x.purebred(x) ⇒ purebred(g(x)) UI: 13
15. x.
x.purebred(x) Ind: 1, 9, 14
Structural Induction is the most general form of induction. In Structural Induction, we can have
multiple object constants, multiple function constants, and, unlike our other forms of induction,
we can have function constants with multiple arguments. Consider a language with two object
constants a and b and a single binary function constant c . See below for a list of some of the
terms in the language. We do not provide a graphical rendering in this case, as the structure is
more complicated than a line or a tree.
e Structural Induction rule for this language is shown below. If we know that ' holds
of our base elements a and b and if we know 8.8 .((' [] ^ ' [ ]) ) ' [c (, )]), then we can
conclude 8 .' [ ] in a single step.
Structural Induction
' [a]
' [b ]
8.8.((' [] ^ ' []) ) ' [c (,)])
8 .' [ ]
p (a ) q (a)
8u.8v .(p (u) ^ p (v ) ) p (c (u,v ))) 8u.8v .(q (u) ) q (c (u,v )))
:p (b ) 8u.8v .(q (v ) ) q (c (u,v )))
8u.8v .(p (c (u,v )) ) p (u)) :q (b )
8u.8v .(p (c (u,v )) ) p (v )) 8u.8v .(q (c (u,v )) ) q (u) _ q (v ))
Now, as an example of Structural Induction in action, let’s prove that every object that
satisfies p also satisfies q . In other words, we want to prove the conclusion 8x .(p (x ) ) q (x )). As
usual, we start with our premises.
1. p(a) Premise
2. ∀u.∀v.(p(u)) ˄ p(c(u,v))) Premise
3. p(b) Premise
4. ∀u.∀v.(p(c(u,v)) ⇒ p(u)) Premise
5. ∀u.∀v.(p(c(u,v)) ⇒ p(v)) Premise
6. q(a) Premise
7. ∀u.∀v.(q(u) ⇒ q(c(u,v)) Premise
8. ∀u.∀v.(q(v) ⇒ q(c(u,v)) Premise
9. q(b) Premise
10. u. v.(q(c(u,v)) q(u) ˅ q(v)) Premise
To start the induction, we first prove the base cases for the conclusion. In this world, with
two object constants, we need to show the result twice—once for each object constant in the
language.
Let’s start with a. e derivation is simple in this case. We assume p (a), reiterate q (a) from
line 6, then use Implication Introduction to prove (p (a) ) q (a)).
11. p(a) Assumption
12. q(a) Reiteration: 6
13. p(a) q(a) Implication Introduction
Now, let’s do the case for b . As before, we assume p (b ), and our goal is to derive q (b ). is
is a little strange. We know that q (b ) is false. Still, we should be able to derive it since we have
assumed p (b ), which is also false. e trick here is to generate contradictory conclusions from
the assumption :q (b ). To this end, we assume :q (b ) and first prove p (b ). Having done so, we
use Implication Introduction to get one implication. en, we assume :q (b ) again and this time
derive :p (b ) and get an implication. At this point, we can use Negation Introduction to derive
::q (b ) and Negation Elimination to get q (b ). Finally, we use Implication Introduction to prove
(p (b ) ) q (b )).
Having dealt with the base cases, the next step is to prove the inductive case. We need to
show that, if our conclusion holds of u and v , then it also holds of c (u,v ). To this end, we assume
the conjunction of our assumptions and then use And Elimination to split that conjunction into
its two conjuncts. Our inductive conclusion is also an implication; and, to prove it, we assume its
antecedent p (c (u,v )). From this, we derive p (u); from that, we derive q (u); and, from that, we
derive q (c (u,v )). We then use Implication Introduction to get the desired implication. A final use
of Implication Introduction and a couple of applications of Universal Introduction gives us the
inductive case for the induction.
24. (p(u) ⇒ q(u)) ˄ (p(v) ⇒ q(v)) Assumption
25. p(u) ⇒ q(u) And Elimination: 24
26. p(v) ⇒ q(v) And Elimination: 24
27. p(c(u,v)) Assumption
28. ∀v.(p(c(u,v)) ⇒ p(u)) Universal Elimination: 4
29. p(c(u,v)) ⇒ p(u) Universal Elimination: 28
30. p(u) Implication Elimination: 29, 27
31. q(u) Implication Elimination: 25, 30
32. ∀v.(q(u) ⇒ q(c(u,v))) Universal Elimination: 7
33. q(u) ⇒ q(c(u,v)) Universal Elimination: 32
34. q(c(u,v)) Implication Elimination: 33, 31
35. p(c(u,v)) ⇒ q(c(u,v)) Implication Elimination: 27, 34
36. (p(u) ⇒ q(u)) ˄ (p(v) ⇒ q(v)) ⇒ p(c(u,v)) ⇒ q(c(u,v)) Implication Elimination: 24, 35
37. ∀v.((p (u) ⇒ q(u)) ˄ (p(v) ⇒ q(v)) ⇒ p(c(u,v))) ⇒ Universal Introduction: 36
q(c(u,v)))
38. u. v.((p (u) q(u)) ˄ (p(v) q(v)) p(c(u,v))) Universal Introduction: 37
q(c(u,v)))
Finally, using the base case on lines 13 and 23 and the inductive case on line 38, we use
Structural Induction to give us the conclusion we set out to prove.
39. x.(p (x) q(x)) Induction: 13, 23, 38
Although the proof in this case is longer than in the previous examples, the basic inductive
structure is the same. Importantly, using induction, we can prove this result where otherwise it
would not be possible.
In our look at induction thus far, we have been concentrating on examples in which the conclu-
sion is a universally quantified sentence with just one variable. In many situations, we want to
use induction to prove a result with more than one universally quantified variable. is is called
multidimensional induction or, sometimes, multivariate induction.
In principle, multidimensional induction is straightforward. We simply use ordinary induc-
tion to prove the outermost universally quantified sentence. Of course, in the case of multidimen-
sional induction the base case and the inductive conclusion are themselves universally quantified
sentences; and, if necessary we use induction to prove these subsidiary results.
As an example, consider a language with a single object constant a, a unary function con-
stant s , and a binary relation constant e . e axioms shown below define e .
e (a,a)
8x .:e (a,s (x ))
8x .:e (s (x ),a)
8x .8y .(e (x ,y ) ) e (s (x ),s (y )))
8x .8y .(e (s (x ),s (y )) ) e (x ,y ))
In what follows, we use induction to prove the outer quantified formula and then use induc-
tion on each of the inner conclusions as well. is means we have two immediate subgoals—the
base case for the outer induction and the inductive case for the outer induction.
As usual, we start with our premises. We then prove the base case of the inner induction.
is is easy. We assume e (a,a) and then use Implication Introduction to prove the base case in
one step.
1. e(a, a) Premise
2. ∀x. e(a,s(x)) Premise
3. ∀x. e(s(x),a) Premise
4. ∀x.∀y.(e(x,y) ⇒ (e(s(x), s(y))) Premise
5. ∀x.∀y.(e(s(x), s(y)) ⇒ e(x, y)) Premise
6. e(a, a) Assumption
7. e(a, a) e(a, a) Implication Introduction: 6, 6
e next step is to prove the inductive case for the inner induction. To this end, we assume
the inductive hypothesis and try to prove the inductive conclusion. Since the conclusion is itself
an implication, we assume its antecedent and prove the consequent. As shown below, we do
this by assuming the consequent is false and proving a sentence and its negation. We then use
Negation Introduction and Negation Elimination to derives the consequent. We finish with two
applications of Implication Introduction and an application of Universal Introduction.
8. e(a, y) ⇒ e(y, a)) Assumption
9. e(a,s(y)) Assumption
10. e(s(y),a) Assumption
11. e(a,s(y)) Reiteration: 9
12. e(s(y),a) ⇒ e(a,s(y)) Implication Introduction: 10, 11
13. e(s(y),a) Assumption
14. e(a,s(y)) Universal Instantiation: 2
15. e(s(y),a) ⇒ e(a,s(y)) Implication Introduction: 13, 14
16. e(s(y),a) Negation Elimination: 12, 15
17. e(s(y),a) Negation Elimination: 16
18. e(a, s(y)) ⇒ e(s(y),a) Implication Introduction: 9, 17
19. e(a, y) ⇒ e(y, a)) ⇒ (e(a,s(y)) ⇒ e(s(y),a)) Implication Introduction: 8, 18
20. y.y.((e(a, y) e(y, a)) (e(a,s(y)) e(s(y),a))) Universal Introduction: 19
21. y.
y.(e(a, y) e(y, a)) Induction: 7, 20
at’s a lot of work just to prove the base case of the outer induction. e inductive case of
the outer induction is even more complex, and it is easy to make mistakes. e trick to avoiding
these mistakes is to be methodical.
In order to prove the inductive case for the outer induction, we assume the inductive hy-
pothesis 8y .(e (x ,y ) D> e (y ,x )); and we then prove the inductive conclusion 8y .(e (s (x ),y ) D>
e (y ,s (x )))). We prove this by induction on the variable y .
We start by proving the base case for this inner induction. We start with the inductive
hypothesis. We then assume the antecedent of the base case.
22. ∀y. e(x, y) ⇒ e(y, x)) Assumption
23. e(s(yx),a) Assumption
24. e(a,s(x)) Assumption
25. e(s(x),a) Reiteration: 23
26. e(a,s(x))) ⇒ e(s(x),a) Implication Introduction: 24, 25
27. e(a,s(x)) Assumption
28. e(s(x),a) Universal Elimination: 3
29. e(a,s(x))) ⇒ e(s(x),a) Implication Introduction: 27, 28
30. e(a,s(x))) Negation Elimination: 26, 29
31. e(a,s(x))) Negation Elimination: 30
32. e(s(x),a) e(a,s(x))) Implication Introduction: 23, 31
Next, we work on the inductive case for the second inner induction. We start by assuming
the inductive hypothesis. We then assume the antecedent of the inductive conclusion.
From the results on lines 32 and 45, we can conclude the inductive case for the outer in-
duction.
46. ∀y.(e(s(x),y) ⇒ e(y,s(x))) Induction: 32, 45
47. ∀y.(e(x,y) e(y,x)) ∀y.(e(s(x),y) e(y,s(x))) Implication Introduction: 22, 46
48. x.( yy.(e(x,y) e(y,x)) yy.(e(s(x),y) e(y,s(x))) Universal Introduction: 47
Finally, from the base case for the outer induction and this inductive case, we can conclude
our overall result.
49. x. yy.(e(x,y) e(y,x)) Induction: 7, 48
As this proof illustrates, the technique of using induction within induction works just fine.
Unfortunately, it is tedious and error-prone. for this reason, many people prefer to use specialized
forms of multidimensional induction.
A little thought reveals that these axioms logically entail the universal conclusion 8x .p (x ).
Unfortunately, we cannot derive this conclusion directly using Linear Induction. e base case is
easy enough. And, from p (x ) we can easily derive p (s (s (x ))). However, it is not so easy to derive
p (s (x )), which is what we need for the inductive case of Linear Induction.
e good news is that we can succeed in cases like this by proving a slightly more com-
plicated intermediate conclusion and then using that conclusion to prove the result. One way to
do this is shown below. In this case, we start by using Linear Induction to prove 8x .(p (x ) ^
p (s (x )). e base case p (a) ^ p (s (a)) is easy, since we are given the two conjuncts as axioms.
e inductive case is straightforward. We assume p (x ) ^ p (s (x )). From this hypothesis, we use
And Elimination to get p (x ) and p (s (x )). We then use Universal Elimination and Implication
Elimination to derive p (s (s (x ))). We then conjoin these results, use Implication Introduction and
Universal Introduction to get the inductive case for our induction. From the base case and the
inductive case, we get our intermediate conclusion. Finally, starting with this conclusion, we use
Universal Elimination, And Elimination, and Universal Introduction to get the overall result.
1. ∀y.(p(x) ⇒ p(s(s(x)))) Premise
2. p(a) Premise
3. p(s(a)) Premise
4. p(a) ˄ p(s(a)) And Introduction
5. p(x) ˄ p(s(x)) Assumption
6. p(x) And Elimination
7. p(s(x)) And Elimination
8. p(x) ⇒ p(s(s(x))) Universal Elimination: 1
9. p(s(s(x))) Implication Elimination: 8, 6
10. p(s(x)) ˄ p(s(s(x))) And Introduction: 7, 9
11. p(x) ˄ p(s(x)) ⇒ p(s(x)) ˄ p(s(s(x))) Implication Introduction: 5, 10
12. ∀x.(p(x) ˄ p(s(x))) ⇒ p(s(x)) ˄ p(s(s(x))) Universal Introduction: 11
13. ∀x.(p(x) ˄ p(s(x))) Induction: 4, 12
14. p(x) ˄ p(s(x)) Universal Elimination: 13
15. p(x) And Elimination: 14
16. p(s(x) And Elimination: 14
17. x.p(x) Universal Introduction: 16
In this case, we are lucky that there is a useful conclusion that we can prove with standard
Linear Induction. ings are not always so simple; and in some cases we need more complex
forms of induction. Unfortunately, there is no finite collection of approaches to induction that
covers all cases. If there were, we could build an algorithm for determining logical entailment for
Herbrand Logic in all cases; and, as we discussed in Chapter 10, there is no such algorithm.
RECAP
Induction is reasoning from the specific to the general. Complete induction is induction where the
set of instances is exhaustive. Incomplete induction is induction where the set of instances is not
exhaustive. Linear Induction is a type of complete induction for languages with a single object
constants and a single unary function constant. Tree Induction is a type of complete induction
for languages with a single object constants and multiple unary function constants. Structural
Induction is a generalization of both Linear Induction and Tree Induction that works even in the
presence of multiple object constants and multiple n-ary function constants.
11.8 EXERCISES
11.1. Assume a language with the object constants a and b and no function constants. Given
q (a) and q (b ), use the Fitch system with domain closure to prove 8x .(p (x ) ) q (x )).
11.2. Assume a language with the object constant a and the function constant s . Given r (a),
8x .(p (x ) ) r (s (x ))), 8x .(q (x ) ) r (s (x ))), and 8x .(r (x ) ) p (x ) _ q (x )), use the Fitch
system with Linear Induction to prove 8x .r (x ).
11.3. Assume a language with object constant a and unary function constants f and g . Given
p (a), 8x .(p (x ) ) p (f (x ))), and 8x .(p (f (x )) ) p (g (x ))), use the Fitch system with
Tree Induction to prove 8x .p (x ).
11.4. Consider a language with object constants a and b , binary function constant c , and unary
relation constants m and p and q . e definitions for the relations are shown below.
Relation m is true of a and only a. Relation p is true of a structured object if and only
if it is a linear list (as defined in Chapter 9) with a top-level element that satisfies m.
Relation q is true of a structured object if and only if there is an element anywhere in the
structure that satisfies m.
m(a) 8u.8v .(m(u) ) p (c (u,v ))) 8u.(m(u) ) q (u)))
:m(b ) 8u.8v .(p (v ) ) p (c (u,v ))) 8u.8v .(q (u)
) q (c (u,v )))
8u.8v .:m(c (u,v )) :p (a) 8u.8v .(q (v )
) q (c (u,v )))
:p (b ) :m(a) ) :q (a)
8u.8v .(p (c (u,v )) ) m(u) _ p (v )) :m(b ) ) :q (b )
8u.8v .(q (c (u,v ))
) q (u) _ q (v ))
Your job is to show that any object that satisfies p also satisfies q . Starting with the pre-
ceding axioms, use Fitch with Structural Induction to prove 8x .(p (x ) ) q (x )). Beware:
e proof requires more than 50 steps (including the premises). e good news is that it
is very similar to the proof in Section 11.5.
11.5. Starting with the axioms for e given in Section 11.6, it is possible to prove that e is
transitive, i.e., 8x .8y .8z .(e (x ,y ) ^ e (y ,z ) ) e (x ,z )). Doing this requires a three variable
induction, and it is quite messy. Your job in this problem is to prove just the base case for
the outermost induction, i.e., prove 8y .8z .(e (a,y ) ^ e (y ,z ) ) e (a,z )). Hint: Use the
strategy illustrated in Section 11.6. Extra credit: Do the full proof of transitivity.
11.6. Consider a language with a single object constant a, a single unary function constant s ,
and two unary relation constants p and q . We start with the premises shown below. We
know that p is true of s (a) and only s (a). We know that q is also true of s (a), but we do
not know whether it is true of anything else.
:p (a)
p (s (a))
8x .:p (s (s (x )))
q (s (a))
Prove 8x .(p (x ) ) q (x )). Hint: Break the problem into two parts—first prove the result
for s (x ), and then use that intermediate conclusion to prove the overall result.
CHAPTER 12
Resolution
12.1 INTRODUCTION
e Resolution Principle is a rule of inference for Relational Logic analogous to the Propositional
Resolution Principle for Propositional Logic. Using the Resolution Principle alone (without ax-
iom schemata or other rules of inference), it is possible to build a reasoning program that is sound
and complete for all of Relational Logic. e search space using the Resolution Principle is smaller
than the search space for generating Herbrand proofs.
In our tour of resolution, we look first at unification, which allows us to unify expressions
by substituting terms for variables. We then move on to a definition of clausal form extended to
handle variables. e Resolution Principle follows. We then look at some applications. Finally,
we examine strategies for making the procedure more efficient.
') ! :' _
'( ! '_:
', ! (:' _ ) ^ (' _ : )
In the second step (Negations in), negations are distributed over other logical operators and
quantifiers until each such operator applies to a single atomic sentence. e following replacement
rules do the job.
::' ! '
:(' ^ ) ! :' _ :
:(' _ ) ! :' ^ :
:8 .' ! 9 .:'
:9 .' ! 8 .:'
In the third step (Standardize variables), we rename variables so that each quantifier has a
unique variable, i.e., the same variable is not quantified more than once within the same sentence.
e following transformation is an example.
8x .(p (x ) ) 9x .q (x )) ! 8x .(p (x ) ) 9y .q (y ))
In the fourth step (Existentials out), we eliminate all existential quantifiers. e method
for doing this is a little complicated, and we describe it in two stages.
If an existential quantifier does not occur within the scope of a universal quantifier, we
simply drop the quantifier and replace all occurrences of the quantified variable by a new constant;
i.e., one that does not occur anywhere else in our database. e constant used to replace the
existential variable in this case is called a Skolem constant. e following example assumes that a
is not used anywhere else.
9x .p (x ) ! p (a)
If an existential quantifier is within the scope of any universal quantifiers, there is the pos-
sibility that the value of the existential variable depends on the values of the associated universal
variables. Consequently, we cannot replace the existential variable with a constant. Instead, the
general rule is to drop the existential quantifier and to replace the associated variable by a term
formed from a new function symbol applied to the variables associated with the enclosing univer-
sal quantifiers. Any function defined in this way is called a Skolem function. e following example
illustrates this transformation. It assumes that f is not used anywhere else.
8x .(p (x ) ^ 9z .q (x , y , z )) ! 8x .(p (x ) ^ q (x , y , f (x , y )))
In the fifth step (Alls out), we drop all universal quantifiers. Because the remaining variables
at this point are universally quantified, this does not introduce any ambiguities.
8x .(p (x ) ^ q (x , y , f (x , y ))) ! p (x ) ^ q (x , y , f (x , y ))
In the sixth step (Disjunctions in), we put the expression into conjunctive normal form, i.e.,
a conjunction of disjunctions of literals. is can be accomplished by repeated use of the following
rules.
' _ ( ^ ) ! (' _ ) ^ (' _ )
(' ^ ) _ ! (' _ ) ^ ( _ )
' _ (' 1 _ ... _ ' n ) ! ' _ ' 1 _ ... _ ' n
(' 1 _ ... _ ' n ) _ ' ! ' 1 _ ... _ ' n _ '
' ^ (' 1 ^ ... ^ ' n ) ! ' ^ ' 1 ^ ... ^ ' n
(' 1 ^ ... ^ ' n ) ^ ' ! ' 1 ^ ... ^ ' n ^ '
In the seventh step (Operators out), we eliminate operators by separating any conjunctions
into its conjuncts and writing each disjunction as a separate clause.
' 1 ^ ... ^ ' n ! '1
! ...
! 'n
' 1 _ ... _ ' n ! {' 1 , ... , ' n }
As an example of this conversion process, consider the problem of transforming the follow-
ing expression to clausal form. e initial expression appears on the top line, and the expressions
on the labeled lines are the results of the corresponding steps of the conversion procedure.
9y .(g (y ) ^ 8z .(r (z ) ) f (y , z )))
I 9y .(g (y ) ^ 8z .(:r (z ) _ f (y , z )))
N 9y .(g (y ) ^ 8z .(:r (z ) _ f (y , z )))
S 9y .(g (y ) ^ 8z .(:r (z ) _ f (y , z )))
E g (gary) ^ 8z .(:r (z ) _ f (gary, z ))
A g (gary) ^ (:r (z ) _ f (gary, z ))
D g (gary) ^ (:r (z ) _ f (gary, z ))
O {g (gary)}
{:r (z ), f (gary, z )}
Here is another example. In this case, the starting sentence is almost the same. e only
difference is the leading :, but the result looks quite different.
:9y .(g (y ) ^ 8z .(r (z ) ) f (y , z )))
I :9y .(g (y ) ^ 8z .(:r (z ) _ f (y , z )))
N 8y .(:(g (y ) ^ 8z .(:r (z ) _ f (y , z )))
8y .(:g (y ) _ :8z .(:r (z ) _ f (y , z )))
8y .(:g (y ) _ 9z .:(:r (z ) _ f (y , z )))
8y .(:g (y ) _ 9z .(::r (z ) ^ :f (y , z )))
8y .(:g (y ) _ 9z .(r (z ) ^ :f (y , z )))
S 8y .(:g (y ) _ 9z .(r (z ) ^ :f (y , z )))
E 8y .(:g (y ) _ (r (k (y )) ^ :f (y , k (y ))))
A :g (y ) _ (r (k (y )) ^ :f (y , k (y )))
D (:g (y ) _ r (k (y ))) ^ (:g (y ) _ :f (y , k (y )))
O {:g (y ) _ r (k (y ))}
{:g (y ) _ :f (y , k (y ))}
In Propositional Logic, the clause set corresponding to any sentence is logically equivalent
to that sentence. In Relational Logic, this is not necessarily the case. For example, the clausal
form of the sentence 9x .p (x ) is {p (a)}. is is not logically equivalent. It is not even in the same
language. Since the clause exists in a language with an additional object constant, there are truth
assignments that satisfy the sentence but not the clause. On the other hand, the converted clause
set has a special relationship to the original set of sentences: over the expanded language, the
clause set is satisfiable if and only if the original sentence is satisfiable (also over the expanded
language). As we shall see, in resolution, this equivalence of satisfiability is all we need to obtain
a proof method as powerful as the Fitch system presented in Chapter 7.
12.3 UNIFICATION
What differentiates Resolution from propositional resolution is unification. In propositional res-
olution, two clauses resolve if they contain complementary literals, i.e., the positive literal is iden-
tical to the target of the negative literal. e same idea underlies Resolution, except that the
criterion for complementarity is relaxed. e positive literal does not need to be identical to the
target of the negative literal; it is sufficient that the two can be made identical by substitutions for
their variables.
Unification is the process of determining whether two expressions can be unified, i.e., made
identical by appropriate substitutions for their variables. As we shall see, making this determina-
tion is an essential part of resolution.
A substitution is a finite mapping of variables to terms. In what follows, we write substitu-
tions as sets of replacement rules, like the one shown below. In each rule, the variable to which
the arrow is pointing is to be replaced by the term from which the arrow is pointing. In this case,
x is to be replaced by a, y is to be replaced by f (b ), and z is to be replaced by v .
{x a, y f (b ), z v}
e variables being replaced together constitute the domain of the substitution, and the
terms replacing them constitute the range. For example, in the preceding substitution, the domain
is {x , y , z }, and the range is {a, f (b ), v }.
A substitution is pure if and only if all replacement terms in the range are free of the variables
in the domain of the substitution. Otherwise, the substitution is impure. e substitution shown
above is pure whereas the one shown below is impure.
{x a, y f (b ), z x}
e result of applying a substitution to an expression ' is the expression ' obtained
from the original expression by replacing every occurrence of every variable in the domain of the
substitution by the term with which it is associated.
q (x , y ){x a, y f (b ), z v} D q (a, f (b ))
q (x , x ){x a, y f (b ), z v} D q (a, a)
q (x , w ){x a, y f (b ), z v} D q (a, w )
q (z , v ){x a, y f (b ), z v} D q (v , v )
Note that, if a substitution is pure, application is idempotent, i.e., applying a substitution
a second time has no effect.
q (x , x , y , w , z ){x a, y f (b ), z v} D q (a, a, f (b ), w , v )
q (a, a, f (b ), w , v ){x a, y f (b ), z v} D q (a, a, f (b ), w , v )
However, this is not the case for impure substitutions, as illustrated by the following ex-
ample. Applying the substitution once leads to an expression with an x , allowing for a different
answer when the substitution is applied a second time.
q (x , x , y , w , z ){x a, y f (b ), z x} D q (a, a, f (b ), w , x )
q (a, a, f (b ), w , x ){x a, y f (b ), z x} D q (a, a, f (b ), w , a)
Given two or more substitutions, it is possible to define a single substitution that has the
same effect as applying those substitutions in sequence. For example, the substitutions {x a,
y f (u), z v } and {u d , v e } can be combined to form the single substitution {x a,
y f (d ), z e , u d , v e }, which has the same effect as the first two substitutions when ap-
plied to any expression whatsoever.
Computing the composition of a substitution and a substitution is easy. ere are two
steps. (1) First, we apply to the range of . (2) en we adjoin to all pairs from with different
domain variables.
As an example, consider the composition shown below. In the right hand side of the first
equation, we have applied the second substitution to the replacements in the first substitution.
In the second equation, we have combined the rules from this new substitution with the non-
conflicting rules from the second substitution.
{x a, y f (u), z v }{u d , v e , z g }
D {x a, y f (d ), z e }{u d , v e , z g }
D {x a, y f (d ), z e , u d , v e }
It is noteworthy that composition does not necessarily preserve substitutional purity. e
composition of two impure substitutions may be pure, and the composition of two pure substitu-
tions may be impure.
is problem does not occur if the substitutions are composable. A substitution and a sub-
stitution are composable if and only if the domain of and the range of are disjoint. Otherwise,
they are noncomposable.
{x a, y b, z v }{x u, v b}
By contrast, the following substitutions are noncomposable. Here, x occurs in both the
domain of the first substitution and the range of the second substitution, violating the definition
of composability.
{x a, y b, z v }{x u, v x}
e importance of composability is that it ensures preservation of purity. e composition
of composable pure substitutions must be pure. In the sequel, we look only at compositions of
composable pure substitutions.
A substitution is a unifier for an expression ' and an expression if and only if ' = ,
i.e., the result of applying to ' is the same as the result of applying to . If two expressions
have a unifier, they are said to be unifiable. Otherwise, they are nonunifiable.
e expressions p (x , y ) and p (a,v ) have a unifier, e.g., {x a, y b , v b } and are, there-
fore, unifiable. e results of applying this substitution to the two expressions are shown below.
p (x , y ){x a, y b, v b }=p (a, b )
p (a, v ){x a, y b, v b }=p (a, b )
Note that, although this substitution unifies the two expressions, it is not the only unifier.
We do not have to substitute b for y and v to unify the two expressions. We can equally well
substitute c or d or f (c ) or f (w ). In fact, we can unify the expressions without changing v at all
by simply replacing y by v .
In considering these alternatives, it should be clear that some substitutions are more general
than others. We say that a substitution is as general as or more general than a substitution if
and only if there is another substitution ı such that ı D . For example, the substitution {x a,
y v } is more general than {x a, y f (c ), v f (c )} since there is a substitution {v f (c )}
that, when applied to the former, gives the latter.
{x a, y v }{v f (c )}D{x a, y f (c ), v f (c )}
In resolution, we are interested only in unifiers with maximum generality. A most general
unifier, or mgu, of two expressions has the property that it as general as or more general than
any other unifier.
Although it is possible for two expressions to have more than one most general unifier,
all of these most general unifiers are structurally the same, i.e., they are unique up to variable
renaming. For example, p (x ) and p (y ) can be unified by either the substitution {x y } or the
substitution {y x }; and either of these substitutions can be obtained from the other by applying
a third substitution. is is not true of the unifiers mentioned earlier.
One good thing about our language is that there is a simple and inexpensive procedure for
computing a most general unifier of any two expressions if it exists.
e procedure assumes a representation of expressions as sequences of subexpressions. For
example, the expression p (a, f (b ),z ) can be thought of as a sequence with four elements, viz. the
relation constant p , the object constant a, the term f (b ), and the variable z . e term f (b ) can
in turn be thought of as a sequence of two elements, viz. the function constant f and the object
constant b .
We start the procedure with two expressions and a substitution, which is initially the empty
substitution. We then recursively process the two expressions, comparing the subexpressions at
each point. Along the way, we expand the substitution with variable assignments as described
below. If, we fail to unify any pair of subexpression at any point in this process, the procedure as
a whole fails. If we finish this recursive comparison of the expressions, the procedure as a whole
succeeds, and the accumulated substitution at that point is the most general unifier.
In comparing two subexpressions, we first apply the substitution to each of the two expres-
sions; and we then execute the following procedure on the two modified expressions.
1. If two modified expressions being compared are identical, then nothing more needs to be done.
2. If two modified expressions are not identical and both expressions are constants, then we fail,
since there is no way to make them look alike.
3. If one of the modified expressions is a variable, we check whether the second expression con-
tains the variable. If the variable occurs within the expression, we fail; otherwise, we update our
substitution to the composition of the old substitution and a new substitution in which we bind
the variable to the second modified expression.
4. e only remaining possibility is that the two modified expressions are both sequences. In this
case, we simply iterate across the expressions, comparing as described above.
As an example, consider the computation of the most general unifier for the expressions
p (x ,b ) and p (a,y ) with the initial substitution {}. A trace of the execution of the procedure for
this case is shown below. We show the beginning of a comparison with a line labeled Compare
together with the expressions being compared and the input substitution. We show the result of
each comparison with a line labeled Result. e indentation shows the depth of recursion of the
procedure.
Compare: p (x ,b ), p (a,y ), { }
Compare: p , p , { }
Result: { }
Compare: x , a, { }
Result: {x a}
Compare: y , b , {x a}
Result: {x a, y b }
Result: {x a, y b }
As another example, consider the process of unifying the expression p (x ,x ) and the expres-
sion p (a,y ). A trace is shown below. e main interest in this example comes in comparing the
last argument in the two expressions, viz. x and y . By the time we reach this point, x is bound to
a, so we replace it by a before comparing. y has no binding so we leave it as is. Finally we compare
a and y , which results in a binding of y to a.
Compare: p (x ,x ), p (a,y ), { }
Compare: p , p , { }
Result: { }
Compare: x , a, { }
Result: {x a}
Compare: a, y , {x a}
Result: {x a, y a}
Result: {x a, y a}
One especially noteworthy part of the unification procedure is the test for whether a variable
occurs within an expression before the variable is bound to that expression. is test is called an
occur check since it is used to check whether or not the variable occurs within the term with which
it is being unified. Without this check, the algorithm would find that expressions such as p (x )
and p (f (x )) are unifiable, even though there is no substitution for x that, when applied to both,
makes them look alike.
12.6 UNSATISFIABILITY
One common use of resolution is in demonstrating unsatisfiability. In clausal form, a contradiction
takes the form of the empty clause, which is equivalent to a disjunction of no literals. us,
to automate the determination of unsatisfiability, all we need do is to use resolution to derive
consequences from the set to be tested, terminating whenever the empty clause is generated.
Let’s start with a simple example. See the derivation below. We have four premises. e
derivation in this case is particularly easy. We resolve the first clause with the second to get the
clause shown on line 5. Next, we resolve the result with the third clause to get the unit clause on
line 6. Note that r (a) is the remaining literal from clause 3 after the resolution, and r (a) is also
the remaining literal from clause 5 after the resolution. Since these two literals are identical, they
appear only once in the result. Finally, we resolve this result with the clause on 4 to produce the
empty clause.
1. {p (a,b ), q (a,c )} Premise
2. {:p (x ,y ), r (x )} Premise
3. {:q (x ,y ), r (x )} Premise
4. {:r (z )} Premise
5. {q (a,c ), r (a)} 1, 2
6. {r (a)} 5, 3
7. {} 6, 4
Here is a more complicated derivation, one that illustrates renaming and factoring. Again,
we have four premises. Line 5 results from resolution between the clauses on lines 1 and 3. is
one is easy. Line 6 results from resolution between the clauses on lines 2 and 4. In this case,
renaming is necessary in order for the unification to take place. Line 7 results from renaming and
factoring the clause on line 5 and resolving with the clause on line 6. Finally line 8 results from
factoring line 5 again and resolving with the clause on line 7. Note that we cannot just factor 5
and factor 6 and resolve the results in one step. Try it and see what happens.
1. {:p (x ,y ), q (x ,y ,f (x ,y ))} Premise
2. {r (y ,z ), :q (a,y ,z )} Premise
3. {p (x , g (x )), q (x ,g (x ),z )} Premise
4. {:r (x ,y ), :q (x ,w ,z )} Premise
5. {q (x ,g (x ),f (x ,g (x ))), q (x ,g (x ),z )} 1, 3
6. {:q (a,x ,y ), :q (x ,w ,z )} 2, 4
7. {:q (g (a),w ,z )} 5, 6 (factoring 5)
8. {} 5, 7 (factoring 5)
In demonstrating unsatisfiability, Resolution and Fitch without DC are equally powerful.
Given a set of sentences, Resolution can derive the empty clause from the clausal form of the
sentences if and only if Fitch can find a proof of a contradiction. e benefit of using Resolution
is that the search space is smaller.
In order to solve this problem, we add the negation of our desired conclusion to the premises
and convert to clausal form, leading to the clauses shown below. Note the use of a Skolem function
in the first clause and the use of Skolem constants in the clause derived from the negated goal.
{loves(x ,f (x ))}
{:loves(v ,w ), loves(u,v )}
{:loves(a,b )}
Starting from these initial clauses, we can use resolution to derive the empty clause and
thus prove the result.
As another example of resolution, once again consider the problem of Harry and Ralph
introduced in the preceding chapter. We know that every horse can outrun every dog. Some
greyhounds can outrun every rabbit. Greyhounds are dogs. e relationship of being faster is
transitive. Harry is a horse. Ralph is a rabbit.
8x .8y .(h(x ) ^ d (y ) ) f (x , y ))
9y .(g (y ) ^ 8z .(r (z ) ) f (y , z )))
8y .(g (y ) ) d (y ))
8x .8y .8z .(f (x , y ) ^ f (y , z ) ) f (x , z ))
h(harry)
r (ralph)
We desire to prove that Harry is faster than Ralph. In order to do this, we negate the desired
conclusion.
:f (harry, ralph)
To do the proof, we take the premises and the negated conclusion and convert to clausal
form. e resulting clauses are shown below. Note that the second premise has turned into two
clauses.
1. {:h(x ), :d (y ), f (x , y )} Premise
2. {g (gary)} Premise
3. {:r (z ), f (gary, z )} Premise
4. {:g (y ), d (y )} Premise
5. {:f (x , y ), :f (y , z ), f (x , z )} Premise
6. {h(harry)} Premise
7. {r (ralph)} Premise
8. {:f (harry, ralph)} Negated Goal
From these clauses, we can derive the empty clause, as shown in the following derivation.
9. {d (gary)} 2, 4
10. {:d (y ), f (harry, y )} 6, 1
11. {f (harry, gary)} 9, 10
12. {f (gary, ralph)} 7, 3
13. {:f (gary, z ), f (harry, z )} 11, 5
14. {f (harry, ralph)} 12, 13
15. {} 14, 8
Don’t be misled by the simplicity of these examples. Resolution can and has been used in
proving complex mathematical theorems, in proving the correctness of programs, and in various
other applications.
If this procedure produces only one answer literal, the terms it contains constitute the only
answer to the question. In some cases, the result of a fill-in-the-blank resolution depends on the
refutation by which it is produced. In general, several different refutations can result from the
same query, leading to multiple answers.
Suppose, for example, that we knew the identities of both the father and mother of Jon and
that we asked Who is one of Jon’s parents? e following resolution trace shows that we can derive
two answers to this question.
Unfortunately, we have no way of knowing whether or not the answer statement from a
given refutation exhausts the possibilities. We can continue to search for answers until we find
enough of them. However, due to the undecidability of logical entailment, we can never know in
general whether we have found all the possible answers.
Another interesting aspect of fill-in-the-blank resolution is that in some cases the procedure
can result in a clause containing more than one answer literal. e significance of this is that no
one answer is guaranteed to work, but one of the answers must be correct.
e following resolution trace illustrates this fact. e database in this case is a disjunction
asserting that either Art or Bob is the father of Jon, but we do not know which man is. e goal
is to find a parent of John. After resolving the goal clause with the sentence about fathers and
parents, we resolve the result with the database disjunction, obtaining a clause that can be resolved
a second time yielding a clause with two answer literals. is answers indicates not two answers
but rather uncertainty as to which is the correct answer.
1. {f (art, jon), f (bob, jon)} Premise
2. {:f (x , y ), p (x , y )} Premise
3. {:p (x , jon), goal (x )} Goal
4. {:f (x , jon), goal (x )} 2, 3
5. {f (art, jon), goal (bob)} 1, 4
6. {goal (art ), goal (bob)} 5, 4
In such situations, we can continue searching in hope of finding a more specific answer.
However, given the undecidability of logical entailment, we can never know in general whether
we can stop and say that no more specific answer exists.
12.9 STRATEGIES
One of the disadvantages of using the resolution rule in an unconstrained manner is that it leads
to many useless inferences. Some inferences are redundant in that their conclusions can be derived
in other ways. Some inferences are irrelevant in that they do not lead to derivations of the desired
result.
is section presents a number of strategies for eliminating useless work. In reading this
material, it is important to bear in mind that we are concerned here not with the order in which
inferences are done, but only with the size of a resolution graph and with ways of decreasing that
size by eliminating useless deductions.
{:p , :q , r }
{:p , s }
{:q , s }
{p }
{q }
{:r }
Note that, if a database contains no pure literals, there is no way we can derive any clauses
with pure literals using resolution. e upshot is that we do not need to apply the strategy to a
database more than once, and in particular we do not have to check each clause as it is generated.
TAUTOLOGY ELIMINATION
A tautology is a clause containing a pair of complementary literals. For example, the clause
{p (f (a)), :p (f (a))} is a tautology. e clause {p (x ), q (y ), :q (y ), r (z )} also is a tautology,
even though it contains additional literals.
As it turns out, the presence of tautologies in a set of clauses has no effect on that set’s
satisfiability. A satisfiable set of clauses remains satisfiable, no matter what tautologies we add. An
unsatisfiable set of clauses remains unsatisfiable, even if we remove all tautologies. erefore, we
can remove tautologies from a database, because we need never use them in subsequent inferences.
e corresponding deletion strategy is called tautology elimination.
Note that the literals in a clause must be exact complements for tautology elimination to
apply. We cannot remove non-identical literals, just because they are complements under unifi-
cation. For example, the clauses {:p (a), p (x )}, {p (a)}, and {:p (b )} are unsatisfiable. However,
if we were to remove the first clause, the remaining clauses would be satisfiable.
SUBSUMPTION ELIMINATION
In subsumption elimination, the deletion criterion depends on a relationship between two clauses
in a database. A clause ˆ subsumes a clause ‰ if and only if there exists a substitution such that
ˆ ‰ . For example, {p (x ), q (y )} subsumes {p (a), q (v ), r (w )}, since there is a substitution
{x a, y v } that makes the former clause a subset of the latter.
If one member in a set of clauses subsumes another member, then the set remaining after
eliminating the subsumed clause is satisfiable if and only if the original set is satisfiable. erefore,
subsumed clauses can be eliminated. Since the resolution process itself can produce tautologies
and subsuming clauses, we need to check for tautologies and subsumptions as we perform reso-
lutions.
UNIT RESOLUTION
A unit resolvent is one in which at least one of the parent clauses is a unit clause, i.e., one containing
a single literal. A unit derivation is one in which all derived clauses are unit resolvents. A unit
refutation is a unit derivation of the empty clause.
As an example of a unit refutation, consider the following proof. In the first two inferences,
unit clauses from the initial set are resolved with binary clauses to produce two new unit clauses.
ese are resolved with the first clause to produce two additional unit clauses. e elements in
these two sets of results are then resolved with each other to produce the contradiction.
1. {p , q } Premise
2. {:p , r } Premise
3. {:q , r } Premise
4. {:r } Premise
5. {:p } 2, 4
6. {:q } 3, 4
7. {q } 1, 5
8. {p } 1, 6
9. {r } 3, 7
10. {} 6, 7
Note that the proof contains only a subset of the possible uses of the resolution rule. For
example, clauses 1 and 2 can be resolved to derive the conclusion {q , r }. However, this conclusion
and its descendants are never generated, since neither of its parents is a unit clause.
Inference procedures based on unit resolution are easy to implement and are usually quite
efficient. It is worth noting that, whenever a clause is resolved with a unit clause, the conclusion
has fewer literals than the parent does. is helps to focus the search toward producing the empty
clause and thereby improves efficiency.
Unfortunately, inference procedures based on unit resolution generally are not complete.
For example, the clauses {p , q }, {:p , q }, {p ,:q }, and {:p , :q } are inconsistent. Using general
resolution, it is easy to derive the empty clause. However, unit resolution fails in this case, since
none of the initial clauses contains just one literal.
On the other hand, if we restrict our attention to Horn clauses (i.e., clauses with at most
one positive literal), the situation is much better. In fact, it can be shown that there is a unit
refutation of a set of Horn clauses if and only if it is unsatisfiable.
INPUT RESOLUTION
An input resolvent is one in which at least one of the two parent clauses is a member of the initial
(i.e., input) database. An input deduction is one in which all derived clauses are input resolvents.
An input refutation is an input deduction of the empty clause.
It can be shown that unit resolution and input resolution are equivalent in inferential power
in that there is a unit refutation from a set of sentences whenever there is an input refutation and
vice versa.
One consequence of this fact is that input resolution is complete for Horn clauses but
incomplete in general. e unsatisfiable set of clauses {p , q }, {:p , q }, {p ,:q }, and {:p , :q }
provides an example of a deduction on which input resolution fails. An input refutation must (in
particular) have one of the parents of {} be a member of the initial database. However, to produce
the empty clause in this case, we must resolve either two single literal clauses or two clauses having
single-literal factors. None of the members of the base set meet either of these criteria, so there
cannot be an input refutation for this set.
LINEAR RESOLUTION
Linear resolution (also called ancestry-filtered resolution) is a slight generalization of input resolu-
tion. A linear resolvent is one in which at least one of the parents is either in the initial database
or is an ancestor of the other parent. A linear deduction is one in which each derived clause is a
linear resolvent. A linear refutation is a linear deduction of the empty clause.
Linear resolution takes its name from the linear shape of the proofs it generates. A linear
deduction starts with a clause in the initial database (called the top clause) and produces a linear
chain of resolution. Each resolvent after the first one is obtained from the last resolvent (called
the near parent ) and some other clause (called the far parent ). In linear resolution, the far parent
must either be in the initial database or be an ancestor of the near parent.
Much of the redundancy in unconstrained resolution derives from the resolution of inter-
mediate conclusions with other intermediate conclusions. e advantage of linear resolution is
that it avoids many useless inferences by focusing deduction at each point on the ancestors of
each clause and on the elements of the initial database.
Linear resolution is known to be refutation complete. Furthermore, it is not necessary to
try every clause in the initial database as top clause. It can be shown that, if a set of clauses is
satisfiable and [{ˆ} is unsatisfiable, then there is a linear refutation with ˆ as top clause. So,
if we know that a particular set of clauses is consistent, we need not attempt refutations with the
elements of that set as top clauses.
A merge is a resolvent that inherits a literal from each parent such that this literal is collapsed
to a singleton by the most general unifier. e completeness of linear resolution is preserved even
if the ancestors that are used are limited to merges. Note that, in this example, the first resolvent
(i.e., clause {q }) is a merge.
RECAP
e Resolution Principle is a rule of inference for Relational Logic analogous to the Propositional
Resolution Principle for Propositional Logic. As with Propositional Resolution, Resolution works
only on expressions in clausal form. Unification is the process of determining whether two expres-
sions can be unified, i.e., made identical by appropriate substitutions for their variables. A substi-
tution is a finite mapping of variables to terms. e variables being replaced together constitute
the domain of the substitution, and the terms replacing them constitute the range. A substitution
is pure if and only if all replacement terms in the range are free of the variables in the domain
of the substitution. Otherwise, the substitution is impure. e result of applying a substitution
to an expression ' is the expression ' obtained from the original expression by replacing every
occurrence of every variable in the domain of the substitution by the term with which it is as-
sociated. e composition of two substitutions is a single substitution that has the same effect as
applying those substitutions in sequence. A substitution is a unifier for an expression ' and an
expression if and only if ' D , i.e., the result of applying to ' is the same as the result of
applying to . If two expressions have a unifier, they are said to be unifiable. Otherwise, they
are nonunifiable. A most general unifier, or mgu, of two expressions has the property that it is
as general as or more general than any other unifier. Although it is possible for two expressions
to have more than one most general unifier, all of these most general unifiers are structurally the
same, i.e., they are unique up to variable renaming. e Resolution Principle is analogous to that
of Propositional Resolution. e main difference is the use of unification to unify literals before
applying the rule. A resolution derivation of a conclusion from a set of premises is a finite sequence
of clauses terminating in the conclusion in which each clause is either a premise or the result of
applying the Resolution Principle to earlier members of the sequence. Resolution and Fitch with-
out DC are equally powerful. Given a set of sentences, Resolution can derive the empty clause
from the clausal form of the sentences if and only if Fitch can find a proof of a contradiction. e
benefit of using Resolution is that the search space is smaller.
12.10 EXERCISES
12.1. Consider a language with two object constants a and b and one function constant f .
Give the clausal form for each of the following sentences in this language.
(a ) 9y .8x .p (x ,y )
(b ) 8x .9y .p (x ,y )
(c ) 9x .9y .(p (x ,y ) ^ q (x ,y ))
(d ) 8x .8y .(p (x ,y ) ) q (x ))
(e ) 8x .(9y .p (x ,y ) ) q (x ))
12.2. For each of the following pairs of sentences, say whether the sentences are unifiable and
give a most general unifier for those that are unifiable.
(a ) p (x ,x ) and p (a,y )
(b ) p (x ,x ) and p (f (y ),z )
(c ) p (x ,x ) and p (f (y ),y )
(d ) p (f (x ,y),g (z ,z )) and p (f (f (w ,z ),v ),w )
12.3. Give all resolvents, if any, for each of the following pairs of clauses.
(a ) {p (x ,f (x )), q (x )} and {:p (a,y ), r (y )}
(b ) {p (x ,b ), q (x )} and {:p (a,x ), r (x )}
(c ) {p (x ), p (a), q (x )} and {:p (y ), r (y )}
(d ) {p (x ), p (a), q (x )} and {:p (y ), r (y )}
(e ) {p (a), q (y )} and {:p (x ), :q (b )}
(f ) {p (x ), q (x ,x )} and {:q (a, f (a))}
12.4. Given the clauses {p (a), q (a)}, {:p (x ), r (x )}, {:q (a)}, use Resolution to derive the clause
{r (a)}.
12.5. Given the premises 8x .(p (x ) ) q (x )) and 8x .(q (x ) ) r (x )), use Resolution to prove
the conclusion 8x .(p (x ) ) r (x )).
12.6. Given 8x .(p (x ) ) q (x )), use Resolution to prove 8x .p (x ) ) 8x .q (x ).
12.7. Use Resolution to prove 8x .(((p (x ) ) q (x )) ) p (x )) ) p (x )).
12.8. Given 8x .8y .8z .(p (x ,y ) ^ p (y ,z ) ) p (x ,z )), 8x .p (x ,a), and 8y .p (a,y ), use Resolu-
tion to prove 8x .8y .p (x ,y ).
12.9. Use resolution to show that the clauses {:p (x ,y ), q (x ,y ,f (x ,y ))}, {:r (y ,z ), q (a,y ,z )},
{r (y ,z ), :q (a,y ,z )}, {p (x ,g(x )), q (x ,g(x ),z )}, and {:r (x ,y ), :q (x ,w ,z )} are unsatisfiable.
is one is a little tricky. Be careful about factoring.
12.10. Given p (a) and 8x .(p (x ) ) q (x ) _ r (x )), use Answer Extraction to find a such that
(q ( ) _ r ( )) is true.
Bibliography
[1] David Barker-Plummer, Jon Barwise, and John Etchemendy. CSLI Publications, Stanford,
CA, 2nd ed.
[2] Armin Biere, Marijn J. H. Heule, Hans van Maaren, and Toby Walsh, Eds. Handbook of
Satisfiability, volume 185 of Frontiers in Artificial Intelligence and Applications. IOS Press,
Lansdale, PA, February 2009.
[3] Hans K. Buning and T. Letterman. Propositional Logic: Deduction and Algorithms. Cam-
bridge University Press, New York, NY, 1999.
[4] Chin-Liang Chang and Richard C. Lee. Symbolic Logic and Mechanical eorem Prov-
ing (Computer Science Classics). Academic Press, Salt Lake City, UT, May 1973. DOI:
10.1016/c2009-0-22103-9.
[5] Herbert B. Enderton. A Mathematical Introduction to Logic. Academic Press, Salt Lake City,
UT, 2nd ed., 2001.
[6] Timothy Hinrichs and Michael Genesereth. Herbrand Logic. Technical Report LG-2006-
02, Stanford University, Stanford, CA, 2006. http://logic.stanford.edu/reports/L
G-2006-02.pdf.
[7] John Alan Robinson and Andrei Voronkov, Eds. Handbook of Automated Reasoning, (in 2
volumes). MIT Press, Cambridge, MA, 2001.