Logik für Informatiker Logic for computer scientists

Similar documents
Logik für Informatiker Logic for computer scientists

Logik für Informatiker Logic for computer scientists

Logik für Informatiker Formal proofs for propositional logic

Logik für Informatiker Proofs in propositional logic

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

PHIL12A Section answers, 28 Feb 2011

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

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

Section 2.1: Introduction to the Logic of Quantified Statements

CMPSCI 601: Tarski s Truth Definition Lecture 15. where

Syllogistic Logic and its Extensions

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

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

Propositional Logic Not Enough

Completeness for FOL

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

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

The Logic of Compound Statements cont.

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

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

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

CPSC 121: Models of Computation

First Order Logic: Syntax and Semantics

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

Final Exam Theory Quiz Answer Page

FORMAL PROOFS DONU ARAPURA

Introduction. Predicates and Quantifiers. Discrete Mathematics Andrei Bulatov

COMP Intro to Logic for Computer Scientists. Lecture 6

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

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.

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

Phil Introductory Formal Logic

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

Propositional Logic Review

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

Solving Problems by Inductive Reasoning

Propositional Logic: Syntax

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

PHIL12A Section answers, 14 February 2011

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

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

Logic. Propositional Logic: Syntax. Wffs

Natural Deduction for Propositional Logic

INF3170 Logikk Spring Homework #8 For Friday, March 18

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

Logic. Propositional Logic: Syntax

Introduction to Metalogic

PL: Truth Trees. Handout Truth Trees: The Setup

Learning Goals of CS245 Logic and Computation

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

MAI0203 Lecture 7: Inference and Predicate Calculus

- a reversed conditional; if a conditional is p q, than its converse is q p

Logic: Propositional Logic Truth Tables

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

CS Lecture 19: Logic To Truth through Proof. Prof. Clarkson Fall Today s music: Theme from Sherlock

Part Two: The Basic Components of the SOFL Specification Language

CS 730/730W/830: Intro AI

Announcements For Methods of Proof for Boolean Logic Proof by Contradiction. Outline. The Big Picture Where is Today? William Starr

Foundation of proofs. Jim Hefferon.

EXERCISE 10 SOLUTIONS

Natural Logic Welcome to the Course!

First Order Logic (FOL) 1 znj/dm2017

Logic: The Big Picture

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

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

6. Conditional derivations

Logical Structures in Natural Language: Propositional Logic II (Truth Tables and Reasoning

Logic for Computer Science - Week 4 Natural Deduction

Logik für Informatiker Logic for computer scientists. Induction

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

6. Conditional derivations

Logic and Proofs. (A brief summary)

First Order Logic Semantics (3A) Young W. Lim 9/17/17

Propositional Logic George Belic

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

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

1. Propositions: Contrapositives and Converses

The Importance of Being Formal. Martin Henz. February 5, Propositional Logic

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

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

Introduction to Logic

Advanced Topics in LP and FP

Completeness for FOL

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

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

CSC242: Intro to AI. Lecture 12. Tuesday, February 26, 13

CITS2211 Discrete Structures Proofs

A Little Deductive Logic

cse541 LOGIC FOR COMPUTER SCIENCE

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

Overview. 1. Introduction to Propositional Logic. 2. Operations on Propositions. 3. Truth Tables. 4. Translating Sentences into Logical Expressions

Class 29 - November 3 Semantics for Predicate Logic

Revisit summer... go to the Fitzwilliam Museum!

Chapter 14: More on Quantification

2.3. Chapter 3 Solutions

1.5 MATHEMATICAL LANGUAGE

Discrete Structures for Computer Science

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

Logic. Lesson 3: Tables and Models. Flavio Zelazek. October 22, 2014

Deductive Systems. Lecture - 3

Transcription:

Logik für Informatiker for computer scientists WiSe 2009/10

Rooms Monday 12:00-14:00 MZH 1400 Thursday 14:00-16:00 MZH 5210 Exercises (bring your Laptops with you!) Wednesday 8:00-10:00 Sportturm C 5130 or within the course Web: www.informatik.uni-bremen.de/agbkb/lehre/ ws09-10/logik/

The formal language PL1 PL1 is the formal language of first-order predicate logic Why do we need a formal language? Slides from Prof. Barbara König, Universität Duisburg-Essen http://www.ti.inf.uni-due.de/teaching/ws0607/logik/folien/ einfuehrung.pdf

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

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

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

Atomic sentences in propositional logic (Boole): propositional symbols: 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)

Function symbols Function symbols lead to more complex terms that denote objects. Examples: father, mother +, -, *, / This leads to new terms denoting objects: father(max) 3*(4+2) mother(father(max)) This also leads to new atomic sentences: Larger(father(max),max) 2<3*(4+2)

al validity; satisfiability A sentence A is a logically valid, if it is true in all circumstances. A sentence A is a satisfiable, if it is true in at least one circumstance. A circumstance is in propositional logic: a valuation of the atomic formulas in the set { true, false } in Tarski s world: a block world

Consequences...

al 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. A 1,..., A n are called premises, B is called conclusion. 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.

al 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. A 1,..., A n are called premises, B is called conclusion. 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.

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

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

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

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

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

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

Fitch notation All men are mortal Socrates is a man So, Socrates is mortal A 1... A n B Premise 1... Premise n Conclusion

Methods for showing (in)validity of arguments

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

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

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

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

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.

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.

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.

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.

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.

The need for formal proofs

A formal proof 1. Cube(c) 2. c = b 3. Cube(b) =Elim: 1,2

A formal proof 1. Cube(c) 2. c = b 3. Cube(b) =Elim: 1,2

A formal proof 1. Cube(c) 2. c = b 3. Cube(b) =Elim: 1,2

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.

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.

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.

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.

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.

Transitivity...

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.

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.

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.

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.

Formal proofs P Q R S 1 Justification 1...... S n Justification n S Justification n+1

Formal proof of symmetry of identity 1. a = b 2. a = a =Intro: 3. b = a =Elim: 2,1

Formal proof of symmetry of identity 1. a = b 2. a = a =Intro: 3. b = a =Elim: 2,1

Formal proof of symmetry of identity 1. a = b 2. a = a =Intro: 3. b = a =Elim: 2,1

below the Fitch bar. These are applications of rules we are about Fitch rule: Identity The numbers introduction 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: 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 which results from P(n) by replacing some or all of the occurrenc

Fitch rule: Identity elimination he of Atomic Sentences Identity Elimination (= Elim): P(n). n = m. P(m) 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 also introduce rules justified by the meanings of ot

Fitch rule: Reiteration We don t do this because there are just too many such them for a few predicates, but certainly not all of th Reiteration 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. Chapter 2