0 What logic is or should be Propositions Boolean operations The language of classical propositional logic Interpretation and truth Validity (tautologicity)

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Brief Introduction to Logic. Outline Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs.
Introduction to Theorem Proving
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.
Semantics of SL and Review Part 1: What you need to know for test 2 Part 2: The structure of definitions of truth functional notions Part 3: Rules when.
Logic Concepts Lecture Module 11.
CLASSICAL LOGIC and FUZZY LOGIC. CLASSICAL LOGIC In classical logic, a simple proposition P is a linguistic, or declarative, statement contained within.
Goals Determine the true value of statements with AND, OR, IF..THEN. Negate statements with the connectives above Construct truth tables Understand when.
Truth Trees Intermediate Logic.
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
Brief Introduction to Logic. Outline Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
From Chapter 4 Formal Specification using Z David Lightfoot
Knoweldge Representation & Reasoning
Let remember from the previous lesson what is Knowledge representation
Chapter 3 Propositional Logic
Discrete Mathematics and its Applications
Copyright © Cengage Learning. All rights reserved.
Adapted from Discrete Math
Propositional Logic Review
Intro to Discrete Structures
Inference is a process of building a proof of a sentence, or put it differently inference is an implementation of the entailment relation between sentences.
Theoretical basis of GUHA Definition 1. A (simplified) observational predicate language L n consists of (i) (unary) predicates P 1,…,P n, and an infinite.
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
Discrete Mathematics, Part II CSE 2353 Fall 2007 Margaret H. Dunham Department of Computer Science and Engineering Southern Methodist University Some slides.
DECIDABILITY OF PRESBURGER ARITHMETIC USING FINITE AUTOMATA Presented by : Shubha Jain Reference : Paper by Alexandre Boudet and Hubert Comon.
1 Chapter 7 Propositional and Predicate Logic. 2 Chapter 7 Contents (1) l What is Logic? l Logical Operators l Translating between English and Logic l.
Logic CL4 Episode 16 0 The language of CL4 The rules of CL4 CL4 as a conservative extension of classical logic The soundness and completeness of CL4 The.
Pattern-directed inference systems
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
Great Theoretical Ideas in Computer Science about AWESOME Some Generating Functions Probability Infinity MATH Some Formal Logic (which is really.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
LOGIC AND ONTOLOGY Both logic and ontology are important areas of philosophy covering large, diverse, and active research projects. These two areas overlap.
Copyright © Curt Hill Mathematical Logic An Introduction.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
SSK3003 DISCRETE STRUCTURES
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
1 CA 208 Logic PQ PQPQPQPQPQPQPQPQ
CS6133 Software Specification and Verification
0 Propositional logic versus first-order (predicate) logic The universe of discourse Constants, variables, terms and valuations Predicates as generalized.
LOGIC AND QUANTIFIERS. INTRODUCTION Many algorithms and proofs use logical expressions such as: “IF p THEN q” or “If p1 AND p2, THEN q1 OR q2” Therefore.
Computer Science CPSC 322 Lecture 22 Logical Consequences, Proof Procedures (Ch 5.2.2)
NP-completeness Section 7.4 Giorgi Japaridze Theory of Computability.
Of 38 lecture 13: propositional logic – part II. of 38 propositional logic Gentzen system PROP_G design to be simple syntax and vocabulary the same as.
11 Artificial Intelligence CS 165A Thursday, October 25, 2007  Knowledge and reasoning (Ch 7) Propositional logic 1.
Propositional Logic Rather than jumping right into FOL, we begin with propositional logic A logic involves: §Language (with a syntax) §Semantics §Proof.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01: Boolean Logic Sections 1.1 and 1.2 Jarek Rossignac.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
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.
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)
Chapter 7. Propositional and Predicate Logic
Lecture 1 – Formal Logic.
Knowledge Representation and Reasoning
Propositional Calculus: Boolean Algebra and Simplification
Elementary Metamathematics
Cirquent calculus Episode 15 About cirquent calculus in general
CS 270 Math Foundations of CS
Back to “Serious” Topics…
Computer Security: Art and Science, 2nd Edition
Classical propositional logic (quick review)
Logical Entailment Computational Logic Lecture 3
Chapter 7. Propositional and Predicate Logic
Foundations of Discrete Mathematics
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
ece 720 intelligent web: ontology and beyond
Episode 14 Logic CL4 The language of CL4 The rules of CL4
Presentation transcript:

0 What logic is or should be Propositions Boolean operations The language of classical propositional logic Interpretation and truth Validity (tautologicity) Truth tables The NP-completeness of the nontautologicity problem Gentzen-style axiomatizations (sequent calculus systems) Giorgi Japaridze Logic Propositional Logic Episode 4

What logic is or should be Logic is the most basic, general-purpose, universal-utility tool for reasoning and acting rationally. 2. All intellectual activities (sciences, engineering, politics, everyday life) are or should be based on logic, while logic, in turn, is self-sufficient and needs none of those. 3. Logic makes no ontological commitments, and is focused on form rather than content. It is exactly this full abstraction from content that makes logic general-purpose and universal-utility. Below are a few theses about what your lecturer believes logic is or should be: 4. All other sciences can be seen as applications of logic to some particular domains. For this very reason, such sciences are special- rater than general-purpose tools, applicable only to limited parts of the world. 5. Logic is the same to (all other) intellectual activities as programming languages are to (all other) application programs.

Propositions 4.2 There are only two propositions: ⊤ (true) and ⊥ (false). Classical logic sees no difference between two true or two false propositions, so we have “2+2=4” = “snow is white” = ⊤ and “2+2=5” = “snow is black” = ⊥. If you find this strange or confusing, remember that, from the point of view of set theory, we similarly have {x | x>(x+1)} = {x | x is an elephant that can fly} = 

Boolean operations 4.3  Negation “Not” { ⊤, ⊥ }  { ⊤, ⊥ }  Conjunction “And” { ⊤, ⊥ }  { ⊤, ⊥ }  { ⊤, ⊥ }  Disjunction “Or” { ⊤, ⊥ }  { ⊤, ⊥ }  { ⊤, ⊥ }  Implication “If... then” { ⊤, ⊥ }  { ⊤, ⊥ }  { ⊤, ⊥ } Symbol Name Translation Type p  p ⊤ ⊥⊤ ⊥ p q p  q p  q p  q ⊤ ⊥ ⊤ ⊥ ⊤ ⊥ ⊤ ⊥ ⊥ ⊥ ⊥ ⊥ ⊥ ⊤ ⊤ ⊤ ⊤ ⊤ ⊤ ⊤ Note that:  p = p p  q =  p  q  (p  q) =  p  q  (p  q) =  p  q

The language of classical propositional logic 4.4 The language of classical propositional logic is built from: 1. Two logical atoms: ⊤ and ⊥. 2. Infinitely many nonlogical atoms: p, q, r, s, p 1, p 2, p 3, Propositional connectives: , , , . 4. Parentheses: (, ). Formulas are defined inductively by: 1. Atoms (logical or nonlogical) are formulas. 2. If F is a formula, then so is  (F). 3. If E and F are formulas, then so are (E)  (F), (E)  (F), (E)  (F). For readability, we will be typically omitting certain parentheses, whenever this does not create ambiguity.  has the highest precedence, so that, say,  p  q should be understood as (  p)  q rather than as  (p  q). And  has the lowest precedence, so that, say, p  q  r should be understood as (p  q)  r rather than as p  (q  r).

Interpretation and truth 4.5 An interpretation is a function * that assigns a particular proposition p* ( ⊤ or ⊥ ) to each nonlogical atom p. Synonyms of “interpretation” are model and truth assignment. Every interpretation * extends from nonlogical atoms to all formulas by stipulating that: ⊤ * = ⊤ ⊥ * = ⊥ (  F)* =  (F*) (E  F)* = (E*)  (F*) (E  F)* = (E*)  (F*) (E  F)* = (E*)  (F*) We say that formula F is true under interpretation *, or simply that F* is true, if F*= ⊤. Otherwise we say that it is false.

Validity; truth tables; NP-completeness of the nonvalidity problem 4.6 We say that a formula F is valid (or is a tautology) if F is true under every interpretation. Examples of tautologies: ⊤ ;  ⊥ ;  p  p; p  (q  p); ⊥  p. How about this one? [(p  q)  r]  [(p  q)  (p  r)] There is a brute force method, called the truth table method, that allows us to get answers to such questions. It consists of going through all possible interpretations to see if all of them make the formula true. p q r [(p  q)  r]  [ (p  q)  (p  r)] ⊥ ⊤ ⊥ ⊥ ⊥ ⊥ ⊥ ⊥ ⊥⊥⊤ ⊤ ⊤ ⊤ ⊤ ⊤ ⊥ ⊥ ⊥ ⊤ ⊤ ⊤ ⊤ ⊤ ⊥ ⊥ ⊥ ⊤ ⊤ ⊥ ⊥ ⊥ ⊥ ⊤ ⊤ ⊤ ⊤ ⊤ ⊤ ⊤ ⊥ ⊥ ⊤ ⊤ ⊤ ⊤ ⊤ ⊤ ⊥ ⊥ ⊤ ⊤ ⊤ ⊤ ⊤ ⊤ ⊥ ⊤ ⊤ ⊤ ⊤ ⊤ ⊤ ⊤⊤ ⊤ ⊤ ⊤ ⊤ ⊤ ⊤ ⊤ What is the trouble with the truth table method? Inefficiency. The truth table for a formula with a couple of hundred atoms would have more rows than the number of particles in the Universe! Deductive methods (the following slides) are more practical, even though, generally, we have: Theorem 4.1. The problem of telling whether a formula is tautological is coNP-complete, meaning that no truly efficient algorithms are known for it.

Deductive systems 4.7 There are various deductive systems for classical propositional logic. They can be divided into two major classes: Hilbert-style and Gentzen-style. Hilbert-style systems are axiom-based while Gentzen-style systems are rule-based. Gentzen-style systems have a number of advantages, including existence of straightforward proof search algorithms. In this course we will deal only with Gentzen-style systems. Another name for such systems is sequent calculi. From now on we will consider the version of the language of classical propositional logic where formulas are not allowed to contain logical atoms or implication. This does not mean diminishing the expressive power of the language, as ⊤ can be considered an abbreviation of p  p, ⊥ considered an abbreviation of p  p, and E  F an abbreviation of  E  F. Furthermore, officially  will only be allowed on atoms. When applied to non-atomic formulas,  is considered an abbreviation defined by:  E = E  (E  F) =  E  F  (E  F) =  E  F

A sequent calculus system for classical propositional logic 4.8 A sequent is any finite sequence of formulas (in the sense of Slide 4.7). Here are the rules of one of several equivalent sequent calculus systems for classical propositional logic. Let us call it G1. In the following rules, E,F stand for any formulas, and G,H stand for any sequents. Above the horizontal line is (are) the premise(s), and below the line is the conclusion. A proof in such a system is a tree of sequents, where each node is the conclusion of some rule, and the children of the node are the premises of that rule. Such a tree is a proof of the sequent at its root. A formula F is considered provable if the sequent F is provable (of course, “provable” means “has a proof”). Identity Exchange Weakening Contraction  -Introduction  -Introduction G,F,E,H G,E,F,HG G,E E  E,E IW G,E G,E,E C G, E  F G, E, F  G, H, E  F G, E H, F  [no premises]

An example of a proof in sequent calculus 4.9 Example. Find a proof of (p  q)  (r  s)  (p  r)  (q  s). First, we rewrite the formula as [(  p  q)  (  r  s)]  [(p  r)  (q  s)]. Next, we construct a proof of it in the bottom-up fashion as follows: [(  p  q)  (  r  s)]  [(p  r)  (q  s)]  (  p  q)  (  r  s), (p  r)  (q  s) (  p  q)  (  r  s), (p  r)  (q  s), (p  r)  (q  s) C (p  r)  (q  s), (p  r)  (q  s), (  p  q)  (  r  s) E (twice) (p  r)  (q  s),  p  q (p  r)  (q  s),  r  s  (p  r)  (q  s),  p,  q  (p  r)  (q  s),  r,  s   p,  q, (p  r)  (q  s) E (twice)  r,  s, (p  r)  (q  s) E (twice)  p, p  r   q, q  s  p, p, r   q, q, s   p, p W  q, q W II  r, p  r   s, q  s  r, r, p E  s, s, q E  r, r W  s, s W II  r, p, r   s, q, s 

Soundness and completeness 4.10 Theorem 4.2. For any formula F, we have: 1. (Soundness) If F is provable in G1, then F is a tautology. 2. (Completeness) If F is a tautology, then F is provable in G1. Provable formulas “Good” formulas Soundness: “Good” formulas Provable formulas Completeness: In our present case, “good” = “tautological”.

A sequent calculus system without structural rules 4.11 The Identity rule of G1 can be called an axiom, as it takes no premises. The rules  -Introduction and  -Introduction are called logical rules as they “explain” the logical meanings of connectives. The remaining rules of Exchange, Weakening and Contraction are called structural rules, as they only restructure sequents and otherwise are not related to any logical connectives. Below comes a simpler system --- let us call it G2 --- that has no structural rules at all. A significant change, however, is that in G2 sequents are seen as sets rather than sequences of formulas. G2 only has the following three rules, where E,F are any formulas and G is any “sequent”, i.e. any set of formulas. Axiom  -Introduction  -Introduction G, E  F G, E, F  G, E  F G, E G, F  G,  E,E A [no premises] In view of Theorems 4.2 and 4.4, system G2 is equivalent, in its deductive power, to our old friend G1.

Another example 4.12 Example. Find a proof of [(  p  q)  (  r  s)]  [(p  r)  (q  s)] in G2. We use a standard proof search method, which can be applied to any formula. The method is to start with the target formula, and keep applying, in the bottom-up sense, the two logical rules (in whatever order you like) as long as there are conjunctions or disjunctions in the sequent: [(  p  q)  (  r  s)]  [(p  r)  (q  s)]  (  p  q)  (  r  s), (p  r)  (q  s)  p  q, (p  r)  (q  s)   p,  q, (p  r)  (q  s)   A  p,  q, p  r  p,  q, q  s  p,  q, p, r   p,  q, q, s  A  r  s, (p  r)  (q  s)  r,  s, (p  r)  (q  s)   A  r,  s, p  r  r,  s, q  s  r,  s, p, r   r,  s, q, s  A You will end up with a tree where all leaves are sequents containing only atoms and negated atoms. Such a tree is a G2-proof if (and only if) every leaf contains some atom together with the negation of the same atom. One can show (see next slide) that the target formula is provable iff this method generates a proof tree.

Soundness and completeness proof 4.13 Lemma 4.3. (a) Every sequent which is (the conclusion of) an axiom of G2 is valid. (b) The two logical rules of G2 preserve validity in both top-down and bottom-up directions. That is, the premise(s) is (are) valid iff so is the conclusion. We extend the concepts of truth and validity (tautologicity) from formulas to sequents by understanding each sequent F 1,...,F n as the formula F 1 ...  F n. Proof: Obvious. Theorem 4.4. (Soundness and completeness of G2:) A sequent is provable in G2 iff it is valid (tautological). Proof. The Soundness of G2 is an immediate consequence of Lemma 4.3: Axioms are valid and the rules preserve validity, so every sequent in a proof tree will be valid. As for completeness, assume a given formula is valid. Apply to it the method of Slide In view of Lemma 4.3, all sequents in the tree generated by this method will be valid. This includes the leaves of the tree. But leaves only contain sequents where every formula is an atom or a negated atom. Obviously such a sequent is valid iff it is an axiom. Thus, the tree will be a proof tree.