Logic & Program Proofs: Equivalences, Inference Rules, & Program Proofs, Exams of Logic

A comprehensive reference sheet for logical equivalences, inference rules, and program proofs. It covers various laws such as idempotent, demorgan's, distributive, and commutative laws. Additionally, it includes inference rules like simplification, modus ponens, modus tollens, and hypothetical syllogism. The document also covers program proofs with rules like composition, conditional, and conditional with else.

Typology: Exams

2021/2022

Uploaded on 08/05/2022

dirk88
dirk88 🇧🇪

4.4

(222)

3.1K documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Reference Sheet for Logic and Program Proofs
Logical Equivalences
Definition of Idempotent Laws DeMorgan’s Laws Distributive Laws
P ¬PF alse p pp¬(pq) ¬p ¬q p (qr)(pq)(pr)
PF alse F alse p pp¬(pq) ¬p ¬q p (qr)(pq)(pr)
PT rue P
Definition of Double Negation Absorption Laws Associative Laws
P ¬PT rue ¬(¬p)p p (pq)p(pq)rp(qr)
PF alse P p (pq)p(pq)rp(qr)
PT rue T rue
Commutative Laws Implication Laws Biconditional Laws
pqqp p q ¬pq p q(pq)(qp)
pqqp p q ¬q ¬p p q ¬q ¬p
Inference Rules
Simplification Modus Ponens Modus Tollens Hypothetical Syllogism
pq p ¬q p q
pq p q q r
Therefore, p
Therefore, qTherefore, ¬pTherefore, pr
Conjunction Addition Resolution Disjunctive Syllogism
p p p q p q
q¬pr¬p
Therefore, pq
Therefore, pqTherefore, qrTherefore, q
Universal Instantiation Universal Generalization Existential Instantiation Existential Generalization
xP (x)P(c)xP (x)P(c)
Therefore, P(c) Therefore, xP(x) Therefore, P(c) Therefore, xP (x)
Inference Rules For Program Proofs
Composition Rule Conditional Rule Conditional with Else Rule
p{S1}q(pcondition){S}q(pcondition){S1}q
q{S2}r(p ¬condition)q(p ¬condition){S2}q
p{S1;S2}r p{if condition S}q p{if condition S1else S2}q
1

Partial preview of the text

Download Logic & Program Proofs: Equivalences, Inference Rules, & Program Proofs and more Exams Logic in PDF only on Docsity!

Reference Sheet for Logic and Program Proofs

Logical Equivalences

Definition of ∧ Idempotent Laws DeMorgan’s Laws Distributive Laws P ∧ ¬P ≡ F alse p ∨ p ≡ p ¬(p ∧ q) ≡ ¬p ∨ ¬q p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r) P ∧ F alse ≡ F alse p ∧ p ≡ p ¬(p ∨ q) ≡ ¬p ∧ ¬q p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) P ∧ T rue ≡ P

Definition of ∨ Double Negation Absorption Laws Associative Laws P ∨ ¬P ≡ T rue ¬(¬p) ≡ p p ∨ (p ∧ q) ≡ p (p ∨ q) ∨ r ≡ p ∨ (q ∨ r) P ∨ F alse ≡ P p ∧ (p ∨ q) ≡ p (p ∧ q) ∧ r ≡ p ∧ (q ∧ r) P ∨ T rue ≡ T rue

Commutative Laws Implication Laws Biconditional Laws p ∨ q ≡ q ∨ p p → q ≡ ¬p ∨ q p ↔ q ≡ (p → q) ∧ (q → p) p ∧ q ≡ q ∧ p p → q ≡ ¬q → ¬p p ↔ q ≡ ¬q ↔ ¬p

Inference Rules

Simplification Modus Ponens Modus Tollens Hypothetical Syllogism p ∧ q p ¬q p → q p → q p → q q → r Therefore, p Therefore, q Therefore, ¬p Therefore, p → r

Conjunction Addition Resolution Disjunctive Syllogism p p p ∨ q p ∨ q q ¬p ∨ r ¬p Therefore, p ∨ q Therefore, p ∧ q Therefore, q ∨ r Therefore, q

Universal Instantiation Universal Generalization Existential Instantiation Existential Generalization ∀xP (x) P (c) ∃xP (x) P (c)

Therefore, P (c) Therefore, ∀xP (x) Therefore, P (c) Therefore, ∃xP (x)

Inference Rules For Program Proofs

Composition Rule Conditional Rule Conditional with Else Rule p{S 1 }q (p ∧ condition){S}q (p ∧ condition){S 1 }q q{S 2 }r (p ∧ ¬condition) → q (p ∧ ¬condition){S 2 }q

p{S 1 ; S 2 }r p{ if condition S}q p{ if condition S 1 else S 2 }q