This document discusses propositional calculus and natural deduction proofs. It begins with an introduction to topics covered, including propositional calculus, terminologies, natural deduction proof system, inference rules, and soundness and completeness of propositional logic. Examples of natural deduction proofs are provided to demonstrate different inference rules. The concepts of sub-formulas and sub-propositions are explained. Finally, Gentzen sequent calculus is introduced as an alternative proof system for propositional logic, and examples of proofs in this system are shown.
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
Computational Logic Topics at SRM IST Chennai
1. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
COMPUTATIONAL LOGIC
Dr.J.Faritha Banu
SRM IST- Ramapuram
2. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Topics Covered in this Presentation are
Propositional Calculus Introduction
Terminologies
Natural Deduction proof system
Inference Rules
Example Problems
Sub Formula – Sub Proposition
Soundness of Propositional Logic
Completeness of Propositional Logic
Gentzen sequent calculus
Axiomatic System for PC
3. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
PROPOSITIONAL CALCULUS
A proof starts with some well known facts and proceeds towards the result using
the allowed inferences.
The accepted facts (proved theorems) are called axioms.
The allowed inferences(Valid consequences) are called the rules of inference,
which link one or more propositions to another.
A proof is then a sketch of how we reach the final proposition from the axioms by
means of the inference rules.
Propositional Calculus (PC): Branch of symbolic logic that deals with
propositions and the relations between them, without examination of their
content.
4. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
INFORMAL METHOD
Axiomatic systems are inconvenient as they insist on formality.
Informal methods can be developed from the axiomatic systems.
INFORMAL SYSTEM – PROOF
NATURAL DEDUCTION
Inference Rules: These are used in the Propositional natural deduction for
constructing proof. These rules are categorized to be either for introduction or for
elimination.
Propositional Natural Deduction system (PND), This system has only one axiom,
which is ⊤; PND has the following inference rules (read ‘ i ’ for introduction and ‘e
’ for elimination
5. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
NATURAL DEDUCTION - Inference Rules
Natural Deduction of Propositional Logic: Rules of Conjunction, Disjunction, Implication, Negation
Conjunction (Introduction) Conjunction (Elimination) or Simplification
p p ∧ q p ∧ q
q p q
p ∧ q
Modus Ponens Modus Tollens
p→q p→q
p ¬q
q ¬ p
6. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
NATURAL DEDUCTION - Inference Rules
Disjunction(Introduction)
p q
p ∨ q p ∨ q
Disjunction(Elimination)
p ∨ q
p
(where p → r)
r
q ( where q → r)
r
r
Can be written as (p…..r) (q…r) , p v q ( ….. Means conditional)
r
7. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
NATURAL DEDUCTION - - Inference Rules
Top –True (Introduction) Top (Elimination)
Bottom -False (Introduction) Bottom -False (Elimination)
8. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
NATURAL DEDUCTION - Inference Rules
Negation (Introduction) Negation (Elimination)
Double Negation (Introduction) Double Negation
(Elimination)
9. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
NATURAL DEDUCTION- - Inference Rules
Conditional (Implication ) → (Introduction) → (Elimination)
Biconditional (Equivalence) ↔ (Introduction) ↔ (Elimination)
10. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Proof 1 :
Premises ( p ∧ q ) ∧ ( r ∧ ( s ∧ t ))
Conclusion s
Deduction:
1. ( p ∧ q ) ∧ ( r ∧ ( s ∧ t )) Premise
2. ( r ∧ ( s ∧ t )) Conjunction Elimination (1)
3. s ∧ t Conjunction Elimination (2)
4. s Conjunction Elimination (2)
11. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Proof 2 :
Premises ( p ∧ ( q ∨ r )) ∧ ( r ∧ ( s ↔ t ))
Conclusion p ∧ r
Deduction:
1. ( p ∧ ( q ∨ r )) ∧ ( r ∧ ( s ↔ t )) Premise
2. p ∧ ( q ∨ r ) Conjunction Elimination(∧e)
(1)
3. p Conjunction Elimination(∧e)
(2)
4. r ∧ ( s ↔ t ) Conjunction Elimination (1)
5. r Conjunction Elimination (4)
12. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Proof 3 : Premises ( p ∧ q ) → r
p ∧ s
q
Conclusion r ∨ t
Deduction:
1. ( p ∧ q ) → r Premise
2. p ∧ s Premise
3. q Premise
4. p Conjunction Elimination (2)
5. s Conjunction Elimination (2)
6. p ∧ q Conjunction Introduction (4,3)
7. r Modus Ponens (1,6)
8. r ∨ t Disjunction (7)
13. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Proof 4 : Premises p → ( q ∧ r )
¬( q ∧ r)
Conclusion ¬ p ∧ ¬ ( q ∧ r)
Deduction:
1. p → ( q ∧ r ) Premise
2. ¬( q ∧ r) Premise
3. ¬ p Modus Tollens (1)
4. ¬ p ∧ ¬ ( q ∧ r) Conjunction Introduction (3,2)
14. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Proof 5 : Premises p → q
p → r
s → ¬( q ∨ r)
Conclusion ¬ s ∧ p
Deduction:
1. p → q Premise
2. p → r Premise
3. s → ¬( q ∨ r) Premise
4. p Conjuction elimination 2
5. q Modus ponens(4,1)
6. q ∨ r Disjunction introduction (5)
7. ¬ s Modus Tollens (3,6)
8. ¬ s ∧ p Conjuction introduction (4,7)
15. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Proof 6: A proof for ⊢ p→(q→ p) is as follows:
16. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Sub Formula – Sub Proposition:
A sub-proposition of w, is a proposition corresponding to any subtree of the
parse tree of w.
Immediate sub-proposition of a proposition w is any proposition
corresponding to a subtree of the parse tree Tw of w whose depth is one less
than Tw.
The set of appropriate nonlogical constants is called the signature of the
propositional language.
17. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Sub Formula – Sub Proposition:
The function sub(P ) giving the sub formulas of a formula P is defined by
structural induction as follows:
sub(pi) = {pi}, for all atomic formulas pi
sub(P ∧ Q) = {(P ∧ Q)} ∪ sub(P ) ∪ sub(Q)
sub(P ∨ Q) = {(P ∨ Q)} ∪ sub(P ) ∪ sub(Q)
sub(P → Q) = {(P → Q)} ∪ sub(P ) ∪ sub(Q)
sub(P ↔ Q) = {(P ↔ Q)} ∪ sub(P ) ∪ sub(Q)
sub(¬P ) = {¬P } ∪ sub(P ).
The set sub(P ) is called the set of sub formulas of P .
18. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Sub Formula – Sub Proposition:
Compute sub(P ) for P = ((p1 ∧ ¬p2) ∨ ¬p3).
sub(P ) = {P } ∪ sub(p1 ∧ ¬p2) ∪ sub(¬p3)
= {P } ∪ {(p1 ∧ ¬p2)} ∪ sub(p1) ∪ sub(¬p2) ∪ sub(¬p3)
= {P, (p1 ∧ ¬p2)} ∪ {p1} ∪ {¬p2} ∪ sub(p2) ∪ {¬p3} ∪ sub(p3)
= {P, (p1 ∧ ¬p2), p1, ¬p2, p2, ¬p3, p3}
Note : From the Parse tree write propositions for all the
subtree of the parse tree of w. A tree is subtree to itself,
so w also.
∨
∧ ¬
p1 ¬ p3
p2
Parse Tree
19. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Soundness of Propositional Logic:
soundness property: if and only if every formula that can be proved in the system
is logically valid (Tautology) with respect to the semantics of the system.
Theorem :
Let Σ be a set of propositions, and let w be a proposition.
(1) If Σ ⊢ w in PC, then Σ ⊨ w.
(2) If Σ is satisfiable, then Σ is PC-consistent.
Ex: Modus ponens Proof
p (p=1)
p → q (p → q =1)
Q q=1
20. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Completeness of Propositional Logic:
Completeness property: any formula that is true under all valuations is a theorem.
Theorem :
Let Σ be an infinite set of propositions, and let w be a proposition.
(1) Σ ⊨ w iff Σ has a finite subset Γ such that Γ ⊨ w.
(2) Σ is unsatisfiable iff Σ has a finite unsatisfiable subset.
(3) Σ is satisfiable iff each nonempty finite subset of Σ is satisfiable
Note:
Soundness means that you cannot prove anything that's wrong
Completeness means that you can prove anything that's right.
21. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Gentzen sequent calculus
Sequent calculus: Instead of constructing proofs, will prove that certain consequences
are provable. In a sequent calculus, one starts from a given sequent (consequence) and
goes on applying sequent rules to get newer sequents.
Gentzen Sequent calculus: identifies some of the sequents as correct or self-evident
and tries to reduce everything to the self-evident ones, which terminate a proof.
A sequent is of the form Σ ⊢ Γ, where Σ and Γ are sets of propositions. The empty sequent
‘⊢’ represents a consequence which never holds; and the universal sequent ⊤ represents
a valid consequence, which is used to terminate a proof.
This system is also known as GPC, Gentzen’s Propositional Calculus.
⊤ p, r ⊢ q, s, t p, r ⊢ q p ⊢ q p ⊢ ⊢ q ⊢
22. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Gentzen sequent calculus
Let Σ, Γ, Δ, Ω be generic sets of propositions, and let x, y be generic
propositions. The inference rules or the sequent rules of GPC, along with their
mnemonics, are as follows:
23. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Gentzen sequent calculus
24. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Gentzen sequent calculus
25. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Gentzen sequent calculus
A derivation (GPC-derivation) is a tree whose root is a sequent, and it is
generated by applications of sequent rules on the leaves recursively.
The new sequents are added as children of the original (leaf) node.
Rules that have a single denominator are called stacking rules, and the ones
with two denominators are called branching rules.
Sequents arising out of an application of a stacking rule are written one after
another from top to bottom, while those arising out of branching rules are written
with the help of slanted lines
A proof of a sequent (GPC-proof) is a derivation with the sequent at its root and ⊤ at
all its leaves
A set of propositions Σ is inconsistent in GPC iff Σ ⊢ ⊥.
26. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
GPC-proof for p → (q → p)
⊢ p → (q → p) ⊢ → (then x ⊢ y)
p ⊢ (q→p) ⊢ → (then x ⊢ y)
p , q ⊢ p
T
27. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
GPC-proof for ⊢ p→(¬q→¬(p→q))
⊢ p→ (¬q→¬(p→q)) ⊢ → (then x ⊢ y)
p ⊢ ¬q→¬(p→q) ⊢ → (then x ⊢ y)
p , ¬q ⊢ ¬(p→q) ⊢ ¬ ( then x ⊢
p, ¬q , (p→q) ⊢ ¬ ⊢ (then ⊢ x)
p, (p→q) ⊢ q
→ ⊢ then ⊢ x y ⊢
p ⊢ p, q p, q ⊢ q
T T
28. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
GPC-proof for ⊢ (p→(q→r))→((p→q)→(p→r))
⊢ (p→(q→r))→((p→q)→(p→r)) ⊢ → (then x ⊢ y)
p →(q→r) ⊢ ((p→q)→(p→r) ⊢ → (then x ⊢ y)
p→(q→r), p→q ⊢ p→r ⊢ → (then x ⊢ y)
p→(q→r), p→q, p ⊢ r → ⊢ then ⊢ x y ⊢
p→(q→r), p ⊢ p, r p→(q→r), q,p ⊢ r → ⊢ then ⊢ x y ⊢
T q,p ⊢ p,r q→r,q,p ⊢ r
T
q,p ⊢ q, r r,q,p ⊢ r
T T
29. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Show that the following sequent are provable or not using GPC
p, p→q ! ⊢ q
p, p→q ⊢ q → ⊢ then ⊢ x y ⊢
p ⊢p, q p, q ⊢ q
T T
30. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
AXIOMATIC SYSTEM PC
We choose the subset {¬,→} we ignore other connectives for simplicity.
We choose the subset {¬,→} we ignore other connectives for simplicity.
we use capital letters A,B,C, . . . as generic symbols for propositions.
The axiom schemes of PC are:
(A1) A→(B→A)
(A2) (A→(B→C))→((A→B)→(A→C))
(A3) (¬A→¬B)→((¬A→B)→A)
In addition to the axioms, PC has a inference rule - Modus Ponens:
{A, A→B} ⊨ B.
31. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Proof using axiomatic system
EX: Show that ⊢ q→(p→ p).
1. p→ p Theorem
2. (p→ p)→(q→(p→ p)) A1
3. q→(p→ p) MP 1, 2
EX: Show that ⊢ (¬q→q)→q.
1. ¬q→¬q Theorem
2. (¬q→¬q)→((¬q→q)→q) A3
3. (¬q→q)→q 1, 2,MP
32. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
Proof using axiomatic system
⊨ PC r→(p→(q→ p)).
1. (p→(q→ p)) → r→(p→(q→ p)). A1 , A := p→(q→ p), B := r
2. p→(q→ p) A1, A := p, B := q
3. r→(p→(q→ p)) MP 1, 2,
33. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM CAMPUS, CHENNAI-600 089
References
1. Arindama Singh," Logics for Computer Science", PHI Learning Private
Ltd,2nd Edition, 2018
2. Wasilewska & Anita, "Logics for computer science: classical and non-
classical", Springer, 2018
3. Huth M and Ryan M, Logic in Computer Science: Modeling and Reasoning
about systems‖, Cambridge University Press, 2005
4. Dana Richards & Henry Hamburger, "Logic And Language Models For
Computer Science", Third Edition, World Scientific Publishing Co. Pte.
Ltd,2018