Brief Introduction to Logic. Outline Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs.

Slides:



Advertisements
Similar presentations
1 Knowledge Representation Introduction KR and Logic.
Advertisements

Brief Introduction to Logic. Outline Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs.
Introduction to Proofs
1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Deduction In addition to being able to represent facts, or real- world statements, as formulas, we want to be able to manipulate facts, e.g., derive new.
Copyright © Cengage Learning. All rights reserved.
CLASSICAL LOGIC and FUZZY LOGIC. CLASSICAL LOGIC In classical logic, a simple proposition P is a linguistic, or declarative, statement contained within.
Knoweldge Representation & Reasoning
Let remember from the previous lesson what is Knowledge representation
Propositional Calculus CS 680: Formal Methods in Verification Computer Systems Jeremy Johnson.
Adapted from Discrete Math
Introduction to Proofs
Intro. to Logic CS402 Fall Propositional Calculus - Semantics (2/3) Propositional Calculus - Semantics (2/3) Moonzoo Kim CS Division of EECS Dept.
Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우.
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
Boolean Algebra and Computer Logic Mathematical Structures for Computer Science Chapter 7.1 – 7.2 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Boolean.
Fall 98 Introduction to Artificial Intelligence LECTURE 7: Knowledge Representation and Logic Motivation Knowledge bases and inferences Logic as a representation.
CMPF144 FUNDAMENTALS OF COMPUTING THEORY Module 5: Classical Logic.
Pattern-directed inference systems
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
0 What logic is or should be Propositions Boolean operations The language of classical propositional logic Interpretation and truth Validity (tautologicity)
First Order Logic Lecture 2: Sep 9. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about.
SSK3003 DISCRETE STRUCTURES
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
CS6133 Software Specification and Verification
Artificial Intelligence “Introduction to Formal Logic” Jennifer J. Burg Department of Mathematics and Computer Science.
11 Artificial Intelligence CS 165A Thursday, October 25, 2007  Knowledge and reasoning (Ch 7) Propositional logic 1.
Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Lecture II – xx 2009 Propositional Logic Dieter Fensel and.
LDK R Logics for Data and Knowledge Representation Propositional Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
Propositional Logic Rather than jumping right into FOL, we begin with propositional logic A logic involves: §Language (with a syntax) §Semantics §Proof.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
Lecture 041 Predicate Calculus Learning outcomes Students are able to: 1. Evaluate predicate 2. Translate predicate into human language and vice versa.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Metalogic Soundness and Completeness. Two Notions of Logical Consequence Validity: If the premises are true, then the conclusion must be true. Provability:
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
Section 1.7. Section Summary Mathematical Proofs Forms of Theorems Direct Proofs Indirect Proofs Proof of the Contrapositive Proof by Contradiction.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Artificial Intelligence Logical Agents Chapter 7.
CS344 : Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 4- Logic.
Chapter 1 Logic and proofs
1 Satisfiability Checking Prof. Dr. Erika Ábrahám WS 08/09.
Formal Methods (Spring 2015) Lecture 2 Abid Rauf 1.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
Propositional Logic (a.k.a. Sentential Logic)
Logic.
Chapter 7. Propositional and Predicate Logic
Propositional Calculus: Boolean Functions and Expressions
Knowledge Representation and Reasoning
Propositional Calculus: Boolean Functions and Expressions
Lecture 2 Propositional Logic
Propositional Calculus: Boolean Algebra and Simplification
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
CS 270 Math Foundations of CS
Back to “Serious” Topics…
MA/CSSE 474 More Math Review Theory of Computation
Computer Security: Art and Science, 2nd Edition
Logics for Data and Knowledge Representation
Chapter 7. Propositional and Predicate Logic
Logic of Informatics Introduction.
Presentation transcript:

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 –Late 19 th to mid 20 th Century Logic in Computer Science

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.

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)

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.

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.

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

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.

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

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: (, ).

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

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

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

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))

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:  Afor (  (  A)),  A  B for ((  A )  B) A  B  C for ((A  B)  C), …

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

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

Satisfaction Relation Def 1) |= ⊆ (2 Prop 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

Satisfaction Relation {A,B} |= A  B –Iff {A,B} |= A and {A,B} |= B –Iff A  {A,B} and B  {A,B}

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

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

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

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

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

Algorithmic Perspective Truth Evaluation Problem –Given p  Form and   2 AP(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.

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

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

Semantic Classification A formula p is called valid if models(p) = 2 Prop. 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.

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)

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

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 p 1, p 2, p 3, … of the rule r we used to conclude p.

Proofs Natural Deduction: Rules. For each logical symbol o= , , , , and each formula p with 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.

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  ”.

Proofs Natural Deduction: assumptions of a proof p 1 p 2 p 3 … r p are inductively defined as: all assumptions of proofs of p 1, p 2, p 3, …, minus all assumptions we “ crossed ”.

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).

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

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

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

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.

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

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.

Soundness |- p then |= p

Completeness |= p then |- p