Logik für Informatiker Logic for computer scientists

Similar documents
Logik für Informatiker Logic for computer scientists

Announcements For The Logic of Atomic Sentences Counterexamples & Formal Proofs. Logical Consequence & Validity The Definitions.

Logik für Informatiker Logic for computer scientists

Logik für Informatiker Formal proofs for propositional logic

Logik für Informatiker Logic for computer scientists. Multiple Quantifiers

Announcements For Formal Proofs & Boolean Logic I: Extending F with rules for and. Outline

Logik für Informatiker Proofs in propositional logic

PHIL12A Section answers, 28 Feb 2011

Phil 110, Spring 2007 / April 23, 2007 Practice Questions for the Final Exam on May 7, 2007 (9:00am 12:00noon)

Tautological equivalence. entence equivalence. Tautological vs logical equivalence

CMPSCI 601: Tarski s Truth Definition Lecture 15. where

Section 2.1: Introduction to the Logic of Quantified Statements

Symbolic Logic 3. For an inference to be deductively valid it is impossible for the conclusion to be false if the premises are true.

Syllogistic Logic and its Extensions

Final Exam Theory Quiz Answer Page

Propositional Logic Not Enough

cis32-ai lecture # 18 mon-3-apr-2006

COMP Intro to Logic for Computer Scientists. Lecture 6

FORMAL PROOFS DONU ARAPURA

The Logic of Compound Statements cont.

Solving Problems by Inductive Reasoning

The Logic of Quantifiers

PHIL12A Section answers, 14 February 2011

All psychiatrists are doctors All doctors are college graduates All psychiatrists are college graduates

Completeness for FOL

Propositional Logic Review

Logic. Propositional Logic: Syntax

Propositional Logic. Jason Filippou UMCP. ason Filippou UMCP) Propositional Logic / 38

Proseminar on Semantic Theory Fall 2013 Ling 720 Propositional Logic: Syntax and Natural Deduction 1

Logic Background (1A) Young W. Lim 12/14/15

First Order Logic: Syntax and Semantics

First Order Logic (1A) Young W. Lim 11/5/13

MAI0203 Lecture 7: Inference and Predicate Calculus

First-order Logic (Session 1) Anthony W. Lin Yale-nus College, Singapore

CPSC 121: Models of Computation

Propositional Logic: Syntax

Chapter 14: More on Quantification

Logic. Propositional Logic: Syntax. Wffs

Intelligent Agents. First Order Logic. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 19.

INTRODUCTION TO LOGIC 1 Sets, Relations, and Arguments. Why logic? Arguments

Foundation of proofs. Jim Hefferon.

2 nd Assignment Answer Key Phil 210 Fall 2013

Philosophy 220. Truth-Functional Equivalence and Consistency

Introduction to Metalogic

INF3170 Logikk Spring Homework #8 For Friday, March 18

PL: Truth Trees. Handout Truth Trees: The Setup

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

Natural deduction for truth-functional logic

First Order Logic (1A) Young W. Lim 11/18/13

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

INTRODUCTION. Tomoya Sato. Department of Philosophy University of California, San Diego. Phil120: Symbolic Logic Summer 2014

Phil Introductory Formal Logic

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

Logic (3A) Young W. Lim 11/2/13

PUZZLE. You meet A, B, and C in the land of knights and knaves. A says Either B and I are both knights or we are both knaves.

Logic (3A) Young W. Lim 10/29/13

Logic (3A) Young W. Lim 10/31/13

Propositional Logic Arguments (5A) Young W. Lim 11/30/16

Reasoning. Inference. Knowledge Representation 4/6/2018. User

Learning Goals of CS245 Logic and Computation

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic

Resolution (14A) Young W. Lim 8/15/14

Revisit summer... go to the Fitzwilliam Museum!

CS 2800: Logic and Computation Fall 2010 (Lecture 13)

Part Two: The Basic Components of the SOFL Specification Language

6. Conditional derivations

CS 2740 Knowledge Representation. Lecture 4. Propositional logic. CS 2740 Knowledge Representation. Administration

GS03/4023: Validation and Verification Predicate Logic Jonathan P. Bowen Anthony Hall

Logic: The Big Picture

Logik für Informatiker Logic for computer scientists. Induction

Natural Deduction for Propositional Logic

CS 730/730W/830: Intro AI

6. Conditional derivations

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

2.3. Chapter 3 Solutions

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

Propositional Logic: Review

Examples: P: it is not the case that P. P Q: P or Q P Q: P implies Q (if P then Q) Typical formula:

Artificial Intelligence Knowledge Representation I

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

Logic and Proofs. (A brief summary)

THE LANGUAGE OF FIRST-ORDER LOGIC (FOL) Sec2 Sec1(1-16)

Chapter 3. The Logic of Quantified Statements

Introduction to Logic

Logic for Computer Science - Week 4 Natural Deduction

Logical Structures in Natural Language: First order Logic (FoL)

Logic As Algebra COMP1600 / COMP6260. Dirk Pattinson Australian National University. Semester 2, 2017

THE LOGIC OF QUANTIFIED STATEMENTS. Predicates and Quantified Statements I. Predicates and Quantified Statements I CHAPTER 3 SECTION 3.

Maryam Al-Towailb (KSU) Discrete Mathematics and Its Applications Math. Rules Math. of1101 Inference 1 / 13

Introduction. Predicates and Quantifiers. Discrete Mathematics Andrei Bulatov

cse541 LOGIC FOR COMPUTER SCIENCE

Discrete Mathematics Exam File Spring Exam #1

(c) Establish the following claims by means of counterexamples.

Logic for Computer Science - Week 2 The Syntax of Propositional Logic

Proposi'onal Logic Not Enough

Propositional Logic Arguments (5A) Young W. Lim 11/8/16

a. ~p : if p is T, then ~p is F, and vice versa

A Little Deductive Logic

What is logic, the topic of this course? There are at least two answers to that question.

Propositional logic II.

Transcription:

Logik für Informatiker Logic for computer scientists Till Mossakowski WiSe 2013/14 Till Mossakowski Logic 1/ 29

The language of PL1 Till Mossakowski Logic 2/ 29

The language of PL1: individual constants Individual constants are symbols that denote a person, thing, object Examples: Numbers: 0, 1, 2, 3,... Names: Max, Claire Formal constants: a, b, c, d, e, f, n1, n2 Each individual constant must denote an existing object No individual constant can denote more than one object An object can have 0, 1, 2, 3... names Till Mossakowski Logic 3/ 29

The language of PL1: predicate symbols Predicate symbols denote a property of objects, or a relation between objects Each predicate symbol has an arity that tell us how many objects are related Examples: Arity 0: Gate0 is low, A, B,... Arity 1: Cube, Tet, Dodec, Small, Medium, Large Arity 2: Smaller, Larger, LeftOf, BackOf, SameSize, Adjoins... Arity 3: Between Till Mossakowski Logic 4/ 29

The interpretation of predicate symbols In Tarski s world, predicate symbols have a fixed interpretation, that not always completely coindices with the natural language interpretation In other PL1 languages, the interpretation of predicate symbols may vary. For example, may be an ordering of numbers, strings, trees etc. Usually, the binary symbol = has a fixed interpretation: equality Till Mossakowski Logic 5/ 29

Atomic sentences in propositional logic (Boole:) propositional symbols: Gate0 is low, A, B, C,... in PL1 (Tarski s world): application of predicate symbols to constants: Larger(a,b) the order of arguments matters: Larger(a,b) vs. Larger(b,a) Atomic sentences denote truth values (true, false) Till Mossakowski Logic 6/ 29

Logical arguments A (logical) argument states that a sentence, the conclusion, follows from other sentences, the premises. Examples: All men are mortal. Socrates is a man. So, Socrates is mortal. Lucretius is a man. After all, Lucretius is mortal and all men are mortal. An argument is valid (or a logical consequence), if truth is preserved, that is, all circumstances that make the premises true, also make the conclusion true. Till Mossakowski Logic 7/ 29

Logical consequence A sentence B is a logical consequence of A 1,..., A n, if all circumstances that make A 1,..., A n true also make B true. In symbols: A 1,..., A n = B. In this case, it is a valid argument to infer B from A 1,... A n. If also A 1,... A n are true, then the valid argument is sound. A 1,..., A n are called premises, B is called conclusion. Till Mossakowski Logic 8/ 29

Logical consequence examples All men are mortal. Socrates is a man. So, Socrates is mortal. (valid, sound) All rich actors are good actors. Brad Pitt is a rich actor. So he must be a good actor. (valid, but not sound) All rich actors are good actors. Brad Pitt is a good actor. So he must be a rich actor. (not valid) Till Mossakowski Logic 9/ 29

Fitch notation for logical consequence All men are mortal Socrates is a man So, Socrates is mortal A 1... A n B Premise 1... Premise n Conclusion Till Mossakowski Logic 10/ 29

Methods for showing (in)validity of arguments Till Mossakowski Logic 11/ 29

Methods for showing (in)validity of arguments Validity To show that an argument is valid, we must provide a proof. A proof consists of a sequence of proof steps, each of which must be valid. In propositional logic, we also can use truth tables to show validity. This is not possible in first-order logic. Invalidity An argument can shown to be invalid by finding a counterexample (model), i.e. a circumstance where the premises are true, but the conclusion is false. Till Mossakowski Logic 12/ 29

Informal and formal proofs informal reasoning is used in everyday life semi-formal reasoning is used in mathematics and theoretical computer science balance between readability and precision formal proofs: follow some specific rule system, and are entirely rigorous and can be checked by a computer Till Mossakowski Logic 13/ 29

An informal proof Since Socrates is a man and all men are mortal, it follows that Socrates is mortal. But all mortals will eventually die, since that is what it means to be mortal. So Socrates will eventually die. But we are given that everyone who will eventually die sometimes worries about it. Hence Socrates sometimes worries about dying. Till Mossakowski Logic 14/ 29

The need for formal proofs Till Mossakowski Logic 15/ 29

A formal proof The language of PL1 1. Cube(c) 2. c = b 3. Cube(b) =Elim: 1,2 Till Mossakowski Logic 16/ 29

Four principles for the identity relation 1 =Elim: If b = c, then whatever holds of b holds of c (indiscernibility of identicals). 2 =Intro: b = b is always true in FOL (reflexivity of identity). 3 Symmetry of Identity: If b = c, then c = b. 4 Transitivity of Identity: If a = b and b = c, then a = c. The latter two principles follow from the first two. Till Mossakowski Logic 17/ 29

Transitivity... The language of PL1 Till Mossakowski Logic 18/ 29

Informal proof of symmetry of identity Suppose that a = b. We know that a = a, by the reflexivity of identity. Now substitute the name b for the first use of the name a in a = a, using the indiscernibility of identicals. We come up with b = a, as desired. Till Mossakowski Logic 19/ 29

Till Mossakowski Logic 20/ 29

Formal proofs The language of PL1 P Q R S 1 Justification 1...... S n Justification n S Justification n+1 Till Mossakowski Logic 21/ 29

Formal proof of symmetry of identity 1. a = b 2. a = a =Intro: 3. b = a =Elim: 2,1 Till Mossakowski Logic 22/ 29

In the right hand margin of this proof you find a justification The language of PL1 below Formal the Fitch Proofs inbar. Fitch These are applications of rules we are about The numbers at the right of step 3 show that this step follows and 1 by means of the rule cited. The first rule we use in the above proof is Identity Introd rule allows you to introduce, for any name (or complex term) the proof, the assertion n = n. You are allowed to do this at an proof, and need not cite any earlier step as justification. We w our statement of this rule in the following way: Fitch rule: Identity introduction Identity Introduction (= Intro): n = n We have used an additional graphical device in stating this the symbol. We will use it in stating rules to indicate which licensed by the rule. In this example there is only one step men rule, but in other examples there will be several steps. The second rule of F is Identity Elimination. It tells us th proven a sentence containing n (which we indicate by writing sentence of the form n = m, then we are justified in asserting Till Mossakowski Logic 23/ 29

Fitch rule: Identity elimination When we apply this rule, it does not matter which of P(n) and first in the proof, as long as they both appear before P(m), the In justifying the step, we cite the name of the rule, followed b which P(n) and n = m occur, in that order. We could Till Mossakowski also introduce Logic rules justified by the meanings 24/ of 29ot he Logic of Atomic Sentences Identity Elimination (= Elim): P(n). n = m. P(m)

Fitch rule: Reiteration Reiteration We don t do this because there are just too many such them for a few predicates, but certainly not all of th encounter in first-order languages. There is one rule that is not technically necessary, some proofs look more natural. This rule is called Rei allows you to repeat an earlier step, if you so desire. Reiteration (Reit): P... P To use the Reiteration rule, just repeat the sentence in right, write Reit: x, where x is the number of the ear sentence. Till Mossakowski Logic 25/ 29

Example proof in fitch SameRow(a, b) b = a SameRow(b, a) Till Mossakowski Logic 26/ 29

Properties of predicates in Tarski s world Larger(a, b) Larger(b, c) Larger(a, c) RightOf(b, c) LeftOf(c, b) Such arguments can be proved in Fitch using the special rule Ana Con. This rule is only valid for reasoning about Tarski s world! Till Mossakowski Logic 27/ 29

Showing invalidity using counterexamples Al Gore is a politician Hardly any politicians are honest Al Gore is dishonest Imagine a situation where there are 10,000 politicians, and that Al Gore is the only honest one of the lot. In such circumstances both premises would be true but the conclusion would be false. This demonstrates that the argument is invalid. Till Mossakowski Logic 28/ 29

Are the following arguments valid? Small(a) Larger(b, a) Large(b) Small(a) Larger(a, b) Large(b) Till Mossakowski Logic 29/ 29