1 / 44

Brief Introduction to Logic

Brief Introduction to Logic. Outline. Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs. Historical view. Philosophical Logic 500 BC to 19th Century Symbolic Logic Mid to late 19th Century Mathematical Logic

irving
Download Presentation

Brief Introduction to Logic

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Brief Introduction to Logic

  2. Outline • Historical View • Propositional Logic : Syntax • Propositional Logic : Semantics • Satisfiability • Natural Deduction : Proofs.

  3. Historical view • Philosophical Logic • 500 BC to 19th Century • Symbolic Logic • Mid to late 19th Century • Mathematical Logic • Late 19th to mid 20th Century • Logic in Computer Science

  4. Philosophical Logic • 500 B.C – 19th Century • Logic dealt with arguments in the natural language used by humans. • Example • All men are motal. • Socrates is a man • Therefore, Socrates is mortal.

  5. Philosophical Logic • Natural language is very ambiguous. • Eric does not believe that Mary can pass any test. • I only borrowed your car. • Tom hates Jim and he likes Mary. • It led to many paradoxes. • “This sentence is a lie.” (The Liar’s Paradox)

  6. The Sophist’s Paradox • A Sophist is sued for his tuition by the school that educated him. He argued that he must win, since, if he loses, the school didn’t educated him well enough, and doesn’t deserve the money. The school argue that he must loss, since, if he win, he was educated well enough therefore should pay for it.

  7. Symbolic Logic • Mid to late 19th Century. • Attempted to formulate logic in terms of a mathematical language • Rules of inference were modeled after various laws for manipulating algebraic expressions.

  8. Mathematical Logic • Late 19th to mid 20th Century • Frege proposed logic as a language for mathematics in 1879. • With the rigor of this new foundation, Cantor was able to analyze the notion of infinity in ways that were previously impossible. (2N is strictly larger than N) • Russell’s Paradox T = { S | S ∉ S}

  9. Logic in Computer Science • In computer science, we design and study systems through the use of formal languages that can themselves be interpreted by a formal system. • Boolean circuits • Programming languages • Design Validation and verification • AI, Security. Etc.

  10. Logics in Computer Science • Propositional Logic • First Order Logic • Higher Order Logic • Theory of Construction • Real-time Logic, Temporal Logic • Process Algebras • Linear Logic

  11. Syntax • The symbol of the language. • Propositional symbols: A, B, C,… • Prop: set of propositional symbols • Connectives:  (and),  (or),  (not),  (implies),  (is equivalent to),  (false). • Parenthesis: (, ).

  12. Formulas • Backus-Naur Form • Form := Prop | (Form) | (Form o Form). • Context-Free Grammar • Form  Prop, • Form  ( Form), • Form  (Form o Form)

  13. Formulas (2) • The set of formulas, Form, is defined as the smallest set of expressions such that: • Prop  Form • pForm  (p)Form • p,q Form  (p o q)  Form

  14. Formulas (3) • Examples: • (A) • ((A)) • (A  (B  C)) • (A (B C)) • Correct expressions of Propositional Logic are full of unnecessary parenthesis.

  15. Formulas (4) • Abbreviations. Let o=, , . We write A o B o C o … • in the place of (A o (B o (C o …))) • Thus, we write A  B  C, ABC, … • in the place of (A  (B  C)), (A (B C))

  16. Formulas (5) • We omit parenthesis whenever we may restore them through operator precedence: •  binds more strictly than , , and ,  bind more strictly than , . • Thus, we write: A for ((A)), ABfor ((A)B) AB Cfor ((AB)  C), …

  17. Semantics • Def) A truth assignment, , is an elements of 2Prop(I.e.,   2Prop). • Two ways to think of truth assignment • 1) X ⊆ Prop • 2)  : Prop ↦ {0,1} • Note : These notions are equivalence.

  18. Philosopher’s view •  |= p means •  satisfies p or •  is true of p or • p holds at  or •  is a model of p

  19. Satisfaction Relation • Def 1) |= ⊆ (2Prop x Form) •  |= A if  (A) =1 (or, A  ) •  |= p if it is not the case  |= p. •  |= pq if  |= p and  |= q •  |= p  q if  |= p or  |= q •  |= p  q if  |= p implies  |= q •  |= p  q if  |= p iff  |= q

  20. Satisfaction Relation • {A,B} |= A  B • Iff {A,B} |= A and {A,B} |= B • Iff A  {A,B} and B  {A,B}

  21. Electrical Engineer’s view • A mapping of voltages on a wire  : Prop  {0,1} • : {0,1}  {0,1} • (0) = 1 and (1) = 0 • : {0,1}2  {0,1} • (0,0)= (0,1)= (1,0)=0 and (1,1)=1 •  : {0,1}2  {0,1} • (1,1)= (0,1)= (1,0)=1 and (0,0)=0

  22. Semantics • Def 2) • A() = (A) • (p)() = (p()) • (p o q)() = o(p(), q()) • Lemma) Let p  Form and   2Prop, then  |= p iff p() = 1.

  23. Software Engineer’s view • Intuition : a formula specifies a set of truth assignments. • Def 3) Function Models : From  22Prop • models(A) = { |(A) = 1}, A  Prop • models(p) = 2Prop– models(p) • models(pq) = models(p)  models(q) • models(pq) = models(p)  models(q) • models(pq) = (2Prop– models(p))  models(q)

  24. Theorem • Let p  Form and   2Prop, then the following statements are all true: • 1.  |= p • 2. p() = 1 • 3.   models(p)

  25. Relevance Lemma • Let’s use AP(p) to denote the set of all propositional symbols occurred in p. Let 1, 2  2Prop, pForm. • Lemma) if 1|AP(p) = 2|AP(p) , then 1|= p iff 2 |= p Corollary) |= p iff |AP(p) |= p

  26. Algorithmic Perspective • Truth Evaluation Problem • Given pForm and  2AP(p),does  |= p ? Does p() = 1 ? • Eval(p, ): • If p  A, return (A). • If p  (q), return (Eval(q, )) • If p  (q o r), return o(Eval(p), Eval(q)) • Eval uses polynomial time and space.

  27. Extension of |= • Let T  2Prop,  Form • Def) T |= p if T  models(p) • i.e., |=  22Prop X Form • Def) T |=  if T  models() • models() = p models(p) • I.e., |=  22Prop X 2Form

  28. Extension of |= • |=  2Form x 2Form • Def) 1 |= 2 iff models(1)  models(2) Iff for all   2Prop if  |= 1 then  |= 2

  29. Semantic Classification • A formula p is called valid if models(p) = 2Prop. We denote validity of the formula p by |=p • A formula p is called satisfiable if models(p) ≠ . • A formula is not satisfiable is called unsatisfiable or contradiction.

  30. Semantic Classification(II) • Lemma • A formula p is valid iff p is unsatifiable • p is satisfiable iff p is not valid • Lemma • p |= q iff |= (p  q)

  31. Satisfiability Problem • Given a p, is p satisfiable? • SAT(p) B:=0 for all   2AP(p) B = B  Eval(p,) end return B • NP-Complete

  32. Proofs • Formal Proofs. We introduce a notion of formal proof of a formula p: Natural Deduction. • A formal proof of p is a tree whose root is labeled p and whose children are assumptions p1, p2, p3, … of the rule r we used to conclude p.

  33. Proofs • Natural Deduction: Rules. For each logical symbol o=, , , , and each formula pwith outermost connective o, we give: • A set of Introduction rules for o, describing under which conditions p is true; • A set of Elimination rules for o, describing what we may infer from the truth of p.

  34. Proofs • Natural Deduction: notations for proofs. • Let p be any formula, and  be a set of formulas. We use the notation  … p • abbreviated by |- p, for: • “there is a proof of p whose assumptions are included in ”.

  35. Proofs • Natural Deduction: assumptions of a proof p1 p2 p3… r -------------------------------- p • are inductively defined as: • all assumptions of proofs of p1, p2, p3, …, minus all assumptions we “crossed”.

  36. Proofs • Identity Principle: The simplest proof is: p ----- p • having 1 assumption, p, and conclusion the same p. • We may express it by: |-p, for all p • We call this proof “The Identity Principle” (from p we derive p).

  37. Proofs • Rules for  • Introduction rules: none ( is always false). • Elimination rules: from the truth of  (a contradiction) we derive everything:  ---- p If |- , then |-p, for all p

  38. Proofs • Rules for  • Introduction rules: p q -------- p  q • If |- p and |- q then |- p  q

  39. Proofs • Elimination rules: p q p q -------- ------- p q • If |- p  q, then |- p and |- q

  40. Proofs • Rules for  Introduction rule: [p] … q -------- pq • If ,p |- q, then |-pq • We may drop any number of assumptions equal to p from the proof of q.

  41. Proofs • Elimination rule: pq p ---------------- q • If |-pq and |-p, then  |- q.

  42. Proofs • The only axiom not associated to a connective, nor justified by some Introduction rule, is Double Negation: [p] ….  --- p • If , p|- , then |-p • We may drop any number of assumptions equal to p from the proof of q.

  43. Soundness |- p then |= p

  44. Completeness |= p then |- p

More Related