CSCI 189 - Assignment 2 Lab

The Problem set for this assignment is due 5:00pm September 19, 2005. Once you complete the tutorial below, you will be able to use the proof checker to answer some of the questions on this problem set.

Tutorial: Using A Proof Checker for Propositional Logic
Allen Tucker
September 2004

Proofs can be checked by computer for their logical consistency and correctness. This can be done by using any one of a number of on-line software tools. We will use one called "LogicDaemon," which is introduced in this tutorial and adapted to fit the notational style used in our textbook Mathematical Structures for Computer Science. Some of the examples are also taken from our book. If you open the LogicDaemon Web site http://logic.tamu.edu/daemon.html, you should see this window:

To use this proof checker, your theorems and their proofs must be written in a slightly different notation from our textbook. The differences are summarized below:

Textbook Symbol

LogicDaemon Symbol (s)

Meaning

'

~

not

^

&

and

v

v

or

Æ

->

implies

´

<->

if and only if

"

@

for all

$

$

for some

The operators appear in decreasing order of precedence, and so parentheses can be omitted in many cases. For instance, the expression P&QvR means (P&Q)vR, not P&(QvR). More infomration about writing correct logical expressions in LogicDaemon can be found in the on-line menus at the bottom of its on-line window:

The symbol |- is used to separate the assumptions from the conclusion in a rule of inference or a theorem; it's short for saying "can derive." For example, the theorem:

P,Q |- P&Q

means literally, "If P and Q are valid expressions, then the valid expression P&Q can be derived."

A proof is written as a series of numbered steps, with a justification on the right of each step, just like in our text. (An additional first column is required, where you must list the assumption set upon which that step depends.) The above theorem can be proved in three steps; the first two are assumptions and the third uses the conjunction inference rule. To do a proof in LogicDaemon, first type the steps in the window as shown below:

Now click "Check Proof." If your proof is good, you will get the following congratulatory message:

There are many kinds of errors that can crop up in a proof. For example, here is LogicDaemon's response to checking our proof when step 3 fails to provide an annotation (i.e., a justification is missing in column 4):

Of course, you can always correct the error by working in the box below the message Revise your proof here... Proof checking is an interactive activity... several tries may be needed before a proof is fully correct. Of course, it's always best to check a proof carefully by hand before submitting it to LogicDaemon.

The rules below can be used as annotations in a proof. See pp 23, 24, and 31 in our text for a list of all the inference and equivalence rules from which this list is taken. Each rule here shows its textbook abbreviation and its LogicDaemon abbreviation. When using LogicDaemon, be sure to use the abbreviations in the second column.

Rule

LogicDaemon

Text abbreviation When to use it
Hypothesis (assumption) A hyp to state a hypthesis
Conjunction &I con P, Q |- P&Q
Simplification
&E
sim

P & Q |- P or P & Q |- Q

Addition vI add

P |- P v Q or P |- Q v P

Modus ponens ->E mp P, P -> Q |- Q
Modus tollens MTT mt P -> Q, ~Q |- ~P
Hypothetical syllogism HS hs (P -> Q) & (Q -> R) |- P -> R
Disjunctive syllogism vE ds P v Q, ~P |- Q
Double negation DN dn ~~P -||- P
DeMorgan's laws DM deMorgan

~(P v Q) -||- ~P & ~Q

~(P & Q) -||- ~P v ~Q

Implication v-> imp ~P v Q -||- P -> Q
Equivalence <->E or <->I equ P <-> Q -||- (P -> Q) & (Q -> P)
Commutativity

&Comm

vComm

comm

P & Q -||- Q & P or

P v Q -||- Q V P

Associativity

&Assoc

vAssoc

assoc

(P & Q) & R -||- P & (Q & R) or

(P v Q) v R -||- P v (Q v R)

Distributivity Dist dist

(P & Q) v R -||- (P v R) & (Q v R) or

(P v Q) & R -||- (P & R) v (Q & R)

Universal instantiation (elimination) @E ui @xPx |- Pt, where t is a variable or constant.

Universal generalization (introduction)

@I ug Px |- @xPx, where Px has not been deduced earlier by ei.

Existential instantiation (elimination)

$E ei $xPx |- Pa, where a has not been introduced earlier.
Existential generalization (introduction) $I eg Pa |- $xPx, where x does not appear in Pa.
Several of these rules are equivalences (indicated by the symbol -||-) - that is, they are also valid when their premises and conclusions are reversed.

Below is a series of proofs that can be checked by LogicDaemon. Some of them are from your book and some of them contain errors. Try them out yourself to gain some experience with the proof checker before you use it with this week's problem set. Note: you can copy and paste a theorem and its proof directly from this Web page into LogicDaemon before checking it... that will save you a lot of typing!

Theorem 1. The following proof of A->(B&C), A |- B&C is taken from page 24 of your text.
1 (1) A -> (B & C) A
2 (2) A A
1,2 (3) B & C 1, 2 ->E


Theorem 2. P, Q |- P & R
This theorem is not valid because the conjunction P & R is not inferred by the hypotheses P and Q. Here is an attempt to prove it (note that the rule &I is used incorrectly). What message does LogicDaemon give you when you try this proof?
1 (1) P A
2 (2) Q A
1,2 (3) P & R 1, 2 &I


The next two theorems use the Simplification rule. Try them out. Are they valid? Are the proofs correct?

Theorem 3. P&Q |- P
1 (1) P&Q A
1 (2) P 1 &E


Theorem 4. (P v Q) & R |- (P v Q)
1 (1) (P v Q) & R A
1 (2) (P v Q) 1 &E


Below is an invalid proof. Check it using LogicDaemon. Notice the animation that appears to help you better understand the &E rule.

Theorem 5. P & Q |- P
1 (1) PvQ A
1 (2) P 1 &E

Here is a more lengthy proof.

Theorem 6. Q, P |- P -> P & Q
1 (1) Q A
2 (2) P A
1,2 (3) P&Q 1,2&I
1,2 (4) ~Pv(P&Q) 3vI
1,2 (5) P -> P&Q 4v->


The following proof has an extra (unused) assumption... does LogicDaemon notice that?

Theorem 7. P&Q, Q&R |- (P&Q) v (S&P)
1 (1) P&Q A
1 (2) (P&Q) v (S&P) 1 vI

Theorem 8. ~S |- P V ~S
1 (1) ~S A
1 (2) Pv~S 1 vI

Here is another theorem from Exercise 30 on p 32 in your text, and two proofs:

Theorem 9. ~A |- ~A -> (A -> B)
1 (1) ~A A
1 (2) ~A v B 1 vI
1 (3) A -> B 2 v->
1 (4) ~~A v (A -> B) 3 vI
1 (5) ~A -> (A -> B) 4, v->

The following proof is incorrect, because B -> A was used in line (4) where A -> B was needed.

1 (1) ~A A
1 (2) ~A v B 1 vI
1 (3) A -> B 2 v->
1 (4) ~~A v (B -> A) 3 vI
1 (5) ~A -> (A -> B) 4, v->


Here is the message that LogicDaemon delivers when you check this proof:

Error at next line:
>> 1 (4)   ~~A v (B -> A)  3 vI
Incorrect application of Wedge Intro. This rule may only be used to derive a disjunction with the sentence at the line cited in your annotation as one of the disjuncts.


The following proofs come from the starred exercises that appear on pages 30-33 of your text.

Theorem 10 (Exercise 10). A->(BvC), ~B, ~C |- ~A
1 (1) ~B A
2 (2) ~C A
1,2 (3) ~B & ~C 1,2 &I
1,2 (4) ~(BvC) 3 DM

5 (5) A->(BvC) A
1,2,5 (6) ~A 4,5MTT

This next proof will give you an interesting error message. Is it a proof of anything???

Theorem 11 (Exercise 13). A -> B, A -> (B -> C) |- A -> C

1 (1) A A
2 (2) A -> B A
1,2 (3) B 1,2->E
4 (4) B->C A

1,2,4 (5) C 3,4->E
1,2,4 (6) ~AvC 5vI

1,2,4 (7) A -> C 6v->

Here is the error message that LogicDaemon gives:

All of the proof lines you submitted are acceptable, however your proof is not finished: the last line depends on an assumption that is not one of the sequent's premises

Theorem 12 (Exercise 27). P, ~P |- Q

1 (1) P A
1 (2) Pv~~Q 1vI
1 (3) ~~QvP 2vComm
1 (4) ~Q -> P 3v->

5 (5) ~P A
1,5 (6) ~~Q 4,5MTT

1,5 (7) Q 6DN

When you have completed this tutorial, proceed to complete the Problem set. Some of the questions in the Problem set will require you to use the LogicDaemon proof checker.