Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
Introduction
Greek Trivium
History
History of Logic
Logic in Human Affairs
Observations Abby likes Bess but Bess does not like Abby.
Definitions
A triangle is a polygon with three sides. Physical Laws
Pressure times volume is proportional to temperature.
Logical Sentences
Logical Reasoning
Logical Proofs
9
q(b,c)p(a,b)
∀x.∀y.(p(x,y) ⇒ q(x,y))
∃x.p(x,d)
¬p(b,d)
p(c,b)∨ p(c,d)
Computational Logic
Applications
Email Readers If the message is from “genesereth” and the topic is “logic”, Then the message goes in the “important” folder
eCommerce Systems If the product is a notebook and the customer is a student and the date is in December, Then the price is $5.99.
Logic-Enabled Computer Systems
init(cell(1,1,b))init(cell(1,2,b))init(cell(1,3,b))init(cell(2,1,b))init(cell(2,2,b))init(cell(2,3,b))init(cell(3,1,b))init(cell(3,2,b))init(cell(3,3,b))init(control(x))
legal(P,mark(X,Y)) :- true(cell(X,Y,b)) & true(control(P))
legal(x,noop) :- true(control(o))
legal(o,noop) :- true(control(x))
next(cell(M,N,P)) :- does(P,mark(M,N))
next(cell(M,N,Z)) :- does(P,mark(M,N)) & true(cell(M,N,Z)) & Z#b
next(cell(M,N,b)) :- does(P,mark(J,K)) & true(cell(M,N,b)) & (M#J | N#K)
next(control(x)) :- true(control(o))
next(control(o)) :- true(control(x))
terminal :- line(P)terminal :- ~open
goal(x,100) :- line(x)goal(x,50) :- drawgoal(x,0) :- line(o)
goal(o,100) :- line(o)goal(o,50) :- drawgoal(o,0) :- line(x)
row(M,P) :- true(cell(M,1,P)) & true(cell(M,2,P)) & true(cell(M,3,P))
column(N,P) :- true(cell(1,N,P)) & true(cell(2,N,P)) & true(cell(3,N,P))
diagonal(P) :- true(cell(1,1,P)) & true(cell(2,2,P)) & true(cell(3,3,P))
diagonal(P) :- true(cell(1,3,P)) & true(cell(2,2,P)) & true(cell(3,1,P))
line(P) :- row(M,P)line(P) :- column(N,P)line(P) :- diagonal(P)
open :- true(cell(M,N,b))
draw :- ~line(x) & ~line(o)
Logic Programming
Possible Worlds
Sorority World
Sorority World
Sorority World
Sorority World
Sorority World
Logical Sentences
Logical Sentences
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.
Nobody likes herself.
Sorority World
Sorority World
Sorority World
Logical Entailment
Possible Worlds
A set of premises logically entails a conclusion if and only if every world that satisfies the premises satisfies the conclusion.
Premises: Conclusions:Dana likes Cody. Bess likes Cody.Abby does not like Dana. Bess does not like Dana.Dana does not like Abby. Everybody likes somebody.Bess likes Cody or Dana. Everybody is liked by somebody.Abby likes everyone that Bess likes.Cody likes everyone who likes her.Nobody likes herself.
Logical Entailment
Checking All Possible Worlds
Proofs
Abby likes everyone that Bess likes.Abby does not like Dana.Therefore, Bess does not like Dana.
Bess likes Cody or Dana.Bess does not like DanaTherefore, Bess likes Cody.
Proofs
A rule of inference is a reasoning pattern consisting of some premises and some conclusions.
If we believe the premises, a rule of inference tell us that we should also believe the conclusions.
Rules of Inference
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.
Sample Rule of Inference
All Accords are Hondas.All Hondas are Japanese. Therefore, all Accords are Japanese.
Sample Rule of Inference
Sample Rule of Inference
All borogoves are slithy toves.All slithy toves are mimsy. Therefore, all borogoves are mimsy.
Sample Rule of Inference
All x are y.All y are z. Therefore, x are z.
Which patterns are correct?How many rules do we need?
Sound Rule of Inference
All x are y.Some y are z.Therefore, some x are z.
Unsound Rule of Inference
All Toyotas are Japanese cars.Some Japanese cars are made in America.Therefore, some Toyotas are made in America.
Using Unsound Rule of Inference
All Toyotas are cars.Some cars are Porsches.Therefore, some Toyotas are Porsches.
Using Unsound Rule of Inference
All of Abby's friends are Bess's friends.Some of Bess's friends are Abby's enemies.Therefore, some of Abby's friends are Abby's enemies.
Example: Abby likes Cody, and Bess likes Cody. Bess likes Dana, but Abby does not like Dana.
Using Unsound Rule of Inference
A conclusion is provable for a set of premises if and only if every there is a finite sequence of sentences in which every element is either a premise or the result of applying a sound rule of inference to earlier members in the sequence.
As we shall see, for well-behaved logics, logical entailment and provability are identical - a set of premises logically entails a conclusion if and only if the conclusion is provable from the premises. This is a very big deal.
Provability
Symbolic Logic
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.
Nobody likes herself.
One grammatically correct sentence:
The cherry blossoms in the spring.
Another grammatically correct sentence:
The cherry blossoms in the spring sank.
Complexity of Natural Language
The University may terminate this lease when the Lessee, having made application and executed this lease in advance of enrollment, is not eligible to enroll or fails to enroll in the University or leaves the University at any time prior to the expiration of this lease, or for violation of any provisions of this lease, or for violation of any University regulation relative to resident Halls, or for health reasons, by providing the student with written notice of this termination 30 days prior to the effective data of termination; unless life, limb, or property would be jeopardized, the Lessee engages in the sales of purchase of controlled substances in violation of federal, state or local law, or the Lessee is no longer enrolled as a student, or the Lessee engages in the use or possession of firearms, explosives, inflammable liquids, fireworks, or other dangerous weapons within the building, or turns in a false alarm, in which cases a maximum of 24 hours notice would be sufficient.
Michigan Lease Termination Clause
There’s a girl in the room with a telescope.
Grammatical Ambiguity
Crowds Rushing to See Pope Trample 6 to Death
British Left Waffles on Falkland Islands
Scientists Grow Frog Eyes and Ears
Food Stamp Recipients Turn to Plastic
Fried Chicken Cooked in Microwave Wins Trip
Indian Ocean Talks
Headlines
Champagne is better than beer.Beer is better than soda. Therefore, champagne is better than soda.
Good Reasoning
Champagne is better than beer.Beer is better than soda. Therefore, champagne is better than soda.
Bad sex is better than nothing.Nothing is better than good sex. Therefore, bad sex is better than good sex.
Bad Reasoning
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
Algebra
y = 3x = 9
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
Symbolic Logic
Study Guide
x − 3y = 0x + y = 12−4y = −12
Symbolic Manipulation
Sets{a, b, c} ∪ {b, c, d} = {a, b, c, d}
a ∈ {a, b, c}
{a, b, c} ⊆{a, b, c, d}
Functions and Relationsf(a, b) = c
r(a, b, c)
Mathematical Background
Materials of the Course Lectures Lecture Notes Additional Readings Exercises
Discussion Groups Read discussion Post questions Answer questions Work with others!
Hints on How to Take the Course
Propositional Logic
If it is raining, the ground is wet.
Relational LogicIf x is a parent of y, then y is a child of x.
Herbrand LogicThe father of a person is older than the person.
Multiple Logics
We frequently write sentences about sentences.
Sentence: When it rains, it pours.Metasentence: That sentence contains two verbs.
We will frequently prove things about proofs.
Proofs: formalMetaproofs: informal
Meta
Logic
“You are not thinking; you are just being logical.”- Niels Bohr to Albert Einstein
“Mathematics (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 RussellTranslation: “Garbage in, garbage out."Translation: “Treasure in, treasure out.”
Logic and Computer Science
Logic is the mathematics of Computer Science as Calculus is the mathematics of Physics.