Docsity

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

Toggle sidebar
bg1
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, qTherefore, ¬pTherefore, p→r
Conjunction Addition Resolution Disjunctive Syllogism
p p p ∨q p ∨q
q¬p∨r¬p
Therefore, p∨q
Therefore, p∧qTherefore, q∨rTherefore, 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(p∧condition){S}q(p∧condition){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