Top Banner
Introduction to Logic Introduction Michael Genesereth Computer Science Department Stanford University Lecture will begin at ~1:35 PDT.
59

Introduction to Logic Introduction

Jan 26, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to Logic Introduction

Introduction to LogicIntroduction

Michael GeneserethComputer Science Department

Stanford University

Lecture will begin at ~1:35 PDT.

Page 2: Introduction to Logic Introduction

Greek Trivium

Page 3: Introduction to Logic Introduction

History

Page 4: Introduction to Logic Introduction

History of Logic

Page 5: Introduction to Logic Introduction

Uses of Logic

Page 6: Introduction to Logic Introduction

Mathematics

Page 7: Introduction to Logic Introduction

Hardware Engineering

Page 8: Introduction to Logic Introduction

Software Engineering

Page 9: Introduction to Logic Introduction

Rules and Regulations

Page 10: Introduction to Logic Introduction

Games

Page 11: Introduction to Logic Introduction

Debate

Page 12: Introduction to Logic Introduction

Communication

Page 13: Introduction to Logic Introduction
Page 14: Introduction to Logic Introduction

Logic and Computer Science

Logic is the mathematics of Computer Science as

Calculus is the mathematics of Physics.

Page 15: Introduction to Logic Introduction

Elements of Logic

Page 16: Introduction to Logic Introduction

Friends

Page 17: Introduction to Logic Introduction

Friends

Page 18: Introduction to Logic Introduction

Friends

Page 19: Introduction to Logic Introduction

Friends

... ... ... ... ... ... ... ...

Page 20: Introduction to Logic Introduction

Logical Language

Dana likes Cody.Abby does not like Dana.

Dana does not like Abby.Bess likes Cody or Dana.

Abby likes everyone that Bess likes.

Cody likes everyone who likes her.

Everyone likes herself.

Page 21: Introduction to Logic Introduction

Reasoning as Information Processing

Page 22: Introduction to Logic Introduction

Premises:Dana likes Cody.Abby does not like Dana.Everybody likes somebody.Bess likes Cody or Dana. Abby likes everyone that Bess likes.Cody likes everyone who likes her.Everyone likes herself.

True: False: Unknown:Bess likes Cody. Bess likes Dana. Dana likes Bess.Bess does not like Dana. Everybody likes everybody.Everybody likes someone.

Logical Reasoning

Page 23: Introduction to Logic Introduction

Model Checking

... ... ... ... ... ... ... ...

Page 24: Introduction to Logic Introduction

All of Abby's friends are Bess's friends.All of Bess's friends are Cody's friends.Therefore, all of Abby's friends are Cody's friends.

Symbolic Manipulation

Page 25: Introduction to Logic Introduction

All Accords are Hondas.All Hondas are Japanese.Therefore, all Accords are Japanese.

Sample Rule of Inference

Page 26: Introduction to Logic Introduction

Sample Rule of Inference

All borogoves are slithy toves.All slithy toves are mimsy.Therefore, all borogoves are mimsy.

Sample Rule of Inference

Page 27: Introduction to Logic Introduction

All x are y.All y are z.Therefore, all x are z.

General Rule of Inference

Page 28: Introduction to Logic Introduction

Bertrand Russell

Logic "may be defined as the subject in which we never know what we are talking about nor whether what we are saying is true.''

- Bertrand Russell

Page 29: Introduction to Logic Introduction

All x are y.Some y are z.Therefore, some x are z.

No! No!! No!!!

Unsound Rule of Inference

Page 30: Introduction to Logic Introduction

All Toyotas are Japanese cars.Some Japanese cars are made in America.Therefore, some Toyotas are made in America.

Sometimes produces a result that happens to be true.

Using Unsound Rule of Inference

Page 31: Introduction to Logic Introduction

All Toyotas are cars.Some cars are Porsches.Therefore, some Toyotas are Porsches.

Sometimes produces a result that happens to be false.

Using Unsound Rule of Inference

Page 32: Introduction to Logic Introduction

A rule of inference is sound if and only if the conclusion is true whenever the premises are true.

The application of sound rules of inference is called deduction.

Deduction

Page 33: Introduction to Logic Introduction

Incomplete Induction

Induction is reasoning from the specific to the general.

I have seen 1000 black ravens.I have never seen a raven that is not black.Therefore, every raven is black.

Induction is not necessarily sound (but it can be useful).Deduction is necessarily sound.

Induction is the basis for Science (and machine learning)Deduction is the subject matter of Logic.

Science aspires to discover new knowledge.Logic aspires to derive conclusions implied by premises.

Page 34: Introduction to Logic Introduction

Niels Bohr to Albert Einstein

“You are not thinking; you are just being logical.”

https://www.youtube.com/watch?v=Oseqh7SMIvo

Page 35: Introduction to Logic Introduction

Logical Language Definitions: A triangle is a polygon with three sides.  Constraints: Parents are older than their children. Partial Information: Abby likes one of Cody or Dana.

Logical Reasoning Model Checking - Truth Tables, Logic Grids Equivalence Transformations - Symbolic Manipulation Proofs

"Metalevel" Concepts and Analysis Validity, Contingency, Unsatisfiability Equivalence, Entailment, Consistency Soundness, Completeness, Decidability

Elements of Logic

Page 36: Introduction to Logic Introduction

Language Probabilities Metaknowledge - knowledge about knowledge Paradoxes, e.g. This sentence is false.

Reasoning Negation as Failure - knowing not versus not knowing Induction, Abduction, Analogical Reasoning Paraconsistent Reasoning (reasoning with inconsistency)

Logical Extensions

Page 37: Introduction to Logic Introduction

Symbolic Logic

Page 38: Introduction to Logic Introduction

Logical Sentences

Dana likes Cody.Abby does not like Dana.

Dana does not like Abby.Bess likes Cody or Dana.

Abby likes everyone that Bess likes.

Cody likes everyone who likes her.

Everyone likes herself.

Page 39: Introduction to Logic Introduction

One grammatically correct sentence:

The cherry blossoms in the spring.

Another grammatically correct sentence:

The cherry blossoms in the spring

Complexity of Natural Language

sank.

Page 40: Introduction to Logic Introduction

There’s a girl in the room with a telescope.

Grammatical Ambiguity

Page 41: Introduction to Logic Introduction

Crowds Rushing to See Pope Trample 6 to Death

Newseum Headlines

Page 42: Introduction to Logic Introduction

Crowds Rushing to See Pope Trample 6 to Death

Scientists Grow Frog Eyes and Ears

Newseum Headlines

Page 43: Introduction to Logic Introduction

Crowds Rushing to See Pope Trample 6 to Death

Scientists Grow Frog Eyes and Ears

Fried Chicken Cooked in Microwave Wins Trip

Newseum Headlines

Page 44: Introduction to Logic Introduction

Crowds Rushing to See Pope Trample 6 to Death

Scientists Grow Frog Eyes and Ears

Fried Chicken Cooked in Microwave Wins Trip

British Left Waffles on Falkland Islands

Newseum Headlines

Page 45: Introduction to Logic Introduction

Residents report that a hole was cut in the fence surrounding a nudist colony.

Misteaks in Print

Police are looking into it.

Page 46: Introduction to Logic Introduction

Champagne is better than beer.Beer is better than soda. Therefore, champagne is better than soda.

Doug Lenat's Logic

X is better than Y.Y is better than Z. Therefore, X is better than Z.

Bad sex is better than nothing.Nothing is better than good sex. Therefore, bad sex is better than good sex. Really?

Page 47: Introduction to Logic Introduction

Xavier is three times as old as Yolanda. Xavier's age and Yolanda's age add up to twelve. How old are Xavier and Yolanda?

x − 3y = 0x + y = 12−4y = −12

Symbolic Algebra

y = 3x = 9

Page 48: Introduction to Logic Introduction

If Mary loves Pat, then Mary loves Quincy. If it is Monday and raining, then Mary loves Pat or Quincy. If it is Monday and raining, does Mary love Quincy?

p ⇒ q m ∧ r ⇒ p ∨ q

m ∧ r ⇒ q ∨ q m ∧ r ⇒ q

Answer: Yes

Symbolic Logic

Page 49: Introduction to Logic Introduction

Logistics

Page 50: Introduction to Logic Introduction

Propositional Logic (logical operators)

If it is raining and cold, then the ground is wet.

Relational Logic (variables and quantifiers)

If x is a parent of y, then x is older than y.

Functional Logic (compound terms)

{a, b} is a subset of {a, b, c}.

Multiple Logics

Page 51: Introduction to Logic Introduction

Schedule

Page 52: Introduction to Logic Introduction

Numerical Grade 30% - quiz on Propositional Logic (Week 4) 30% - quiz on Relational Logic (Week 7) 30% - quiz on Herbrand Logic (Week 10) 10% - class attendance, discussion forum, puzzles, ...

Letter Grade Based on numerical grade (see above) *No* curve - i.e. independent of number of students A, B, C distributed uniformly over 70% - 100%

NB: We may / MAY offer an optional final exam for those wishing to improve their grades. This MAY not happen.

Grades

Page 53: Introduction to Logic Introduction

http://cs157.stanford.edu

Course Website

Page 54: Introduction to Logic Introduction

Materials of the Course Lectures Textbook / Lessons Exercises Puzzles Tools

Ed Discussion Read discussion Post questions Answer questions

Hints on How to Take the Course

Working in groups is okay /

recommended!!

Read the notes.Do the exercises.Do the exercises!Do the exercises!!

Learn actively.

Page 55: Introduction to Logic Introduction

Value of Practice

Page 56: Introduction to Logic Introduction

Value of Theory

Page 57: Introduction to Logic Introduction

We will frequently write sentences about sentences.

Sentence: When it rains, it pours.Metasentence: That sentence contains two verbs.

We will frequently prove things about proofs.

Proof: If it is Monday and raining, Mary loves Quincy.Metaproof: Our proof system is sound and complete.

Meta

Page 58: Introduction to Logic Introduction

Mike took it twice!

Page 59: Introduction to Logic Introduction