Professional Documents
Culture Documents
Formal Logic PDF
Formal Logic PDF
Formal Logic PDF
Because we understand the meaning of these statements - and because they are all true -
we may be convinced that this is a logical argument. But it isn't; these are just three
separate, true statements. The statement that Honolulu is the capital of Hawaii does not at
all follow in a logical fashion from the two previous statements.
A
B
Therefore C.
Then it is easy to see that the various parts have nothing to do with each other, and this
argument isn't logical reasoning at all. In a logical argument, the conclusion follows
because of the way it is structurally related to the hypotheses. Symbolic logic studies these
structural relationships in an abstract way in order to concentrate on their form.
In Chapter 1, we'll see how to represent a simple argument symbolically and determine
whether it is a logically sound argument. Section 1.1 starts out with simple statements
(sometimes called propositions) that are either true or false, and then discusses how
these simple statements can be combined using logical connectives that manipulate truth
values according to strict rules. The resulting statements are called propositional well-
formed formulas. Section 1.2 discusses derivation rules that can be used to generate a
valid argument involving propositional well-formed formulas.
The statement letters, equivalence rules and inference rules of propositional logic are not
sufficient to let us prove everything we would consider a logically valid argument. Instead
of simple statement letters, we introduce quantifiers that let us decide whether "some" or
"all" elements of some domain have a certain property. Using the existential quantifier,
(∃ x ) P(x) says that at least one element in the domain has property P. Using the
universal quantifier, (∀ x) P(x) says that every element in the domain has property P.
Combining expressions of this sort with logical connectives gives us predicate well-
formed formulas, introduced in Section 1.3.
where the Pis and the Q are predicate wffs. It is a valid argument if it is true in all possible
interpretations. To prove validity, we add additional inference rules to our formal logic
system that allow us to insert or strip off quantifiers. Like propositional logic, predicate
logic (Section 1.4) is a complete and correct formal system.
In addition to providing the underpinnings for logical thought, formal logic has two direct
applications to computer science - logic programming and proof of correctness. These are
discussed in Sections 1.5 and 1.6.
Formal logic systems seek to prove that certain implications of the form P Q are
inherently true. The conclusion Q must follow from the hypothesis P because of the way Q
and P are structurally related, not because of any particular meaning attached to P or Q.
(Recall this is the motivation behind symbolization.) So if the wffs in P and Q are
propositional wffs, then P Q must be true for all truth values, that is, P Q must be a
tautology. If the wffs in P and Q are predicate wffs, then P Q must be true for all
interpretations, that is, P Q must be valid. While we can test for a tautology by
constructing a truth table, there is no corresponding mechanical means to test for validity,
and we must depend on a system of derivation rules to prove that Q follows from P.
Logical Argument P Q
P Q is a tautology P Q is valid
The derivation rules should allow us to prove every P Q that is true (the system is
complete) and nothing that is not true (the system is correct). Again, "true" in
propositional logic means tautology, and in predicate logic it means valid.
Statements are sentences with truth values. A simple sentence can be represented
symbolically by a statement letter (A, B, etc.) Statement letters can be combined into
new statements using logical connectives of
conjunction
disjunction
implication
equivalence
negation
The truth value of the new statement is derived from the truth values of its components
according to the truth tables for the connectives. Truth tables define how each of the
connectives operate on truth values. The truth tables are relatively intuitive, except
perhaps for implication. The implication:
To find the truth value for a complex well-formed formula (wff), construct its truth table.
Build this up from the component parts of the wff, starting with the smallest pieces first.
Use the truth tables for each logical connective you encounter.
A wff that is true for any combination of truth values assigned to its statement letters is a
tautology. A wff that is false for any combination of truth values assigned to its statement
letters is a contradiction. You can identify tautologies and contradictions by doing a truth
table for the wff.
If the main connective of the wff is an implication, that is, if the wff at the "top level" looks
like:
you can also use Algorithm TautologyTest to decide if it is a tautology. This algorithm
works by assigning P the value T and Q the value F. You then follow the consequences of
this assignment down through the various components until every occurrence of a
statement letter has received a truth value assignment. If some letter has received two
different truth values by this process, then your original assignment of P-T and Q-F is
impossible, and the wff is a tautology. If not, then you found an assignment in which P-T
and Q-F is possible, and the wff is not a tautology.
Problem:
Solution:
Step 1. Construct the beginning of the truth table. Decide how many rows it will have and
give truth value assignments to the statement letters.
Problem:
is a tautology.
Solution:
W1
W2
.
.
.
Q
Equivalence rules: an equivalence rule states that wff R is equivalent to wff S. This
means if a wff containing R appears in a proof sequence, then the wff obtained from
this by substituting S for R can be added to the proof sequence.
Inference rules: an inference rule says that if wffs already in the proof sequence
match a certain pattern, then a certain new wff can be added to the proof sequence.
The derivation rules are simply patterns for transforming wffs, and we must be able to
recognize when some wff in the proof sequence matches all or part of one of these
patterns.
We can prove English language arguments valid by translating their components into
propositional logic and proving the resulting P1 ‚ P2 ‚ …‚ Pn ‚ Q implication.
Problem:
Solution:
We will construct a proof sequence. (A truth table would verify that the wff is a tautology,
which means - by completeness - that it is a theorem, but we want to actually construct the
proof.)
Either your car is damaged or you are not at fault. If your car was damaged, your
insurance will pay. You are at fault. Therefore your insurance will pay.
Solution:
We will represent the argument in propositional logic notation, then construct a proof.
Consider the statement "Every student loves discrete math." This is a true statement (or
maybe not!), but at any rate the wffs of Section 1.1 (called propositional wffs) cannot
represent what this statement says, namely that all objects from a certain collection
(students) have some property (they love discrete math). We need a new representation
for properties objects may have, and whether some or all of the objects have that property.
Notations such as P(x), Q(y), W(x, y) are used to mean that x has property P, y has
property Q, and x and y have property W. Quantifiers (the universal quantifier,
symbolized by , and the existential quantifier, symbolized by ) indicate how many
objects have some property. Predicate wffs are made up of quantifiers, predicate
symbols, and constant symbols, as well as logical connectives.
The truth value of a predicate wff depends on its interpretation, which consists of three
parts:
the domain - the collection of objects under discussion, of which there must be at
least one
the assignment of a property of objects in the domain to each predicate symbol
the assignment of a particular domain object to each constant symbol
is true in the interpretation where the domain is the integers greater than 10 and P(x)
means "x is positive," because every integer greater than 10 is positive. The wff
is true in the interpretation where the domain is all the integers, the constant symbol 0
means zero, and G(y, z) means y > z, because there is at least one positive integer.
Giving an interpretation to a predicate wff is like assigning truth values to the statement
letters in a propositional wff - it determines the truth value of the statement. Valid predicate
wffs are true in all interpretations, just as tautologies are true for all truth values. But while
we can test, using a truth table, whether a propositional wff is a tautology, there is no
algorithm to decide whether a predicate wff is valid.
Sample Problem Solutions
Problem:
Solution:
Step 1. Begin with wff (a). Translate the quantifiers and connectives into English.
Problem:
Solution:
Decide whether the following predicate wff is valid and justify your conclusion.
Solution:
Predicate logic works much like propositional logic. You construct a proof sequence using
the derivation rules of predicate logic. These include all the derivation rules for
propositional logic, except the well-formed formulas are now predicate wffs instead of
propositional wffs. Additional inference rules are added to handle quantifiers. These rules
have some restrictions on their use to insure that they are truth-preserving.
Predicate logic is complete and correct, so that all valid wffs and only valid wffs are
theorems, just as in propositional logic all tautologies and only tautologies are theorems.
But here's a big difference. You can test a propositional wff for whether it is a tautology by
building a truth table, so you never actually have to build a proof sequence (we did it for
practice). You cannot test a predicate wff for whether it is valid, so your only choice is to
build a proof sequence (that's why we practiced).
Problem:
Solution:
We will construct a proof sequence. First, note that the wff seems valid - if P is always true
and there are two values for which Q is true, then there are two values for which both P
and Q are true.
Solution:
We will represent the argument in predicate logic notation, then construct a proof.
Formal logic is not only a way to think about things in a logical manner, it has direct
applications in computer science. A programming language (Prolog) based on predicate
logic is extensively used in artificial intelligence, particularly in the area of expert systems.
A Prolog program (a database) consists of statements of which objects in the domain
satisfy certain predicates, or statements that are definitions for new predicates. Executing
a Prolog program consists of posing queries about the logical conclusions that may be
derived from these hypotheses. The derivation rules and the means to do the derivations
are built into the language itself.
Problem:
A Prolog database currently contains information about companies that are direct parent
companies of other companies. The current facts are:
Formulate a Prolog rule to define when one company owns another. Formulate a query as
to which companies are owned by Capital Corporation.
Solution:
First define the rule owns(x, y). This rule can become part of the Prolog database. Then
the query would be formulated during program execution.
Problem:
Verify the correctness of the following program segment with the assertions shown:
{x = 11}
y=x-1
{y = 10}
if y 0 then
z=y-1
else
z=y+3
end if
{z = 13}
Solution:
There are two program statements, the first an assignment statement and the second a
conditional statement. These must be handled separately.