formal systems

48
CogSci 131 Formal systems and propositional logic Tom Griffiths

Upload: brian

Post on 04-Dec-2015

220 views

Category:

Documents


1 download

DESCRIPTION

Formal Systems

TRANSCRIPT

Page 1: Formal Systems

CogSci 131 Formal systems and propositional logic

Tom Griffiths

Page 2: Formal Systems

Admin

•  Waitlist has been processed –  if you are currently not admitted, you won’t

get into the class unless somebody drops

Page 3: Formal Systems

Marr’s three levels

Computation “What is the goal of the computation, why is it

appropriate, and what is the logic of the strategy by which it can be carried out?”

Representation and algorithm “What is the representation for the input and

output, and the algorithm for the transformation?” Implementation

“How can the representation and algorithm be realized physically?”

cons

train

s co

nstra

ins

Page 4: Formal Systems

Part II: Rules and symbols

Page 5: Formal Systems

Outline

Formal systems

Break

Logic

Page 6: Formal Systems

thought string = ‘computation’;disp(string); ≈

Minds and computers are both formal systems

Page 7: Formal Systems

Formal systems (as defined by Haugeland)

•  Token manipulation

•  Digital

•  Medium independence

Page 8: Formal Systems

Formal systems (as defined by Haugeland)

•  Token manipulation

•  Digital

•  Medium independence

Page 9: Formal Systems

Token manipulation systems

•  System is defined fully by – a set of tokens – starting positions for those tokens –  formal rules stating how token positions can

be changed into other token positions •  Rules depend only on current positions,

and define only the next positions

Page 10: Formal Systems

Example 1: Chess Pieces Starting positions Formal rules

Page 11: Formal Systems

Example 2: Formal logic Pieces Starting positions Formal rules

P, Q, ¬, ∧, ∨, ⇒, (, )

“well-formed formulas” e.g., P ⇒ Q

e.g., P ⇒ Q P Q

Page 12: Formal Systems

Formal systems (as defined by Haugeland)

•  Token manipulation

•  Digital

•  Medium independence

Page 13: Formal Systems

Digital systems

Possible states of the system are discrete, and perfectly identifiable

Digital Analog

Page 14: Formal Systems

Formal systems (as defined by Haugeland)

•  Token manipulation

•  Digital

•  Medium independence

Page 15: Formal Systems

Medium independence

The system does not depend upon the medium in which it is implemented

Page 16: Formal Systems
Page 17: Formal Systems

Formal systems (as defined by Haugeland)

•  Token manipulation

•  Digital

•  Medium independence

Tokens need not have any underlying meaning

Page 18: Formal Systems

(Haugeland, p. 17)

tokens become symbols

Page 19: Formal Systems

All that matters is syntax…

The interpretation of the system does not affect the validity of moves

The meaning of symbols (semantics) is irrelevant to operation of the system

P ⇒ Q P Q

PushSwitch ⇒ Light PushSwitch Light

Page 20: Formal Systems

The mind as a formal system

•  People maintain a knowledge base of symbolic statements about the world

•  A set of rules describes valid moves between those statements

•  Thought is the process of applying those rules to achieve some goal

Page 21: Formal Systems

The mind as a formal system •  This is an old idea…

•  …that became the foundation for AI “good-old-fashioned AI”

Aristotle Leibniz Turing

Page 22: Formal Systems

thought string = ‘computation’;disp(string); ≈

Minds and computers are both formal systems

Page 23: Formal Systems

Break

Up next: Logic

Page 24: Formal Systems

Example 2: Formal logic Pieces Starting positions Formal rules

P, Q, ¬, ∧, ∨, ⇒, (, )

“well-formed formulas” e.g., P ⇒ Q

e.g., P ⇒ Q P Q

Page 25: Formal Systems

Four ingredients of formal logic •  Syntax

– definition of well-formed formulas •  Semantics

– evaluating meaning of formulas •  Entailment

– semantic relationship between formulas •  Inference

– syntactic procedure for deriving formulas

Page 26: Formal Systems

Propositional (Boolean) Logic

George Boole (1816-1854)

Page 27: Formal Systems

Propositional logic

•  For two propositions (=statements) P and Q – P ∧ Q means “P and Q” – P ∨ Q means “P or Q” (including P and Q) – P ⇒ Q means “if P then Q” – ¬P means “not P”

•  Build complex formulas by combining parts – e.g. P ⇒ ((Q ∧ R) ∨ S)

Page 28: Formal Systems

Syntax •  Atomic formulas: proposition symbols

(e.g. P, Q), True and False •  Complex formulas built out of simple

formulas via rules –  if α and β are okay, (α∧β) is okay –  if α and β are okay, (α∨β) is okay –  if α and β are okay, (α⇒β) is okay –  if α and β are okay, (α⇔β) is okay –  if α is okay, ¬α is okay

Page 29: Formal Systems

Evaluating the truth of formulas •  The truth of a formula depends on the truth of

its parts (e.g. P ⇒ ((Q ∧ R) ∨ S)) •  Each symbol has a “truth table”

•  An assignment of truth values to propositions (a “world”) that results in a formula being true is a “model” of that formula

P Q (P∧Q) T T T T F F F T F F F F

P Q (P∨Q) T T T T F T F T T F F F

P Q (P⇒Q) T T T T F F F T T F F T

P ¬P T F F T

Page 30: Formal Systems

Evaluating the truth of formulas

P Q (P⇒Q) T T T T F F F T T F F T

“if I work hard in class, I will get an A”

P Q ⇒

Possible worlds: Work hard, get an A

Work hard, don’t get an A Don’t work hard, get an A

Don’t work hard, don’t get an A

Three models for this formula

Page 31: Formal Systems

Semantics •  Truth values for complex formulas

follow rules paralleling syntax –  truth of (α∧β) depends on truth of α, β

α  β (α∧β) T T T T F F F T F F F F

Page 32: Formal Systems

Drawing conclusions

•  Say we know P ⇒ Q is true, and P is true •  What can we conclude from this?

•  Any time we know P ⇒ Q and P, conclude Q

P Q (P⇒Q) T T T T F F F T T F F T

Three worlds where P ⇒ Q is true P is true in only one of these worlds

In that world, Q must be true too…

Page 33: Formal Systems

Conclusions don’t always follow

•  Say we know P ⇒ Q is true, and Q is true •  What can we conclude from this?

•  No further conclusions from P ⇒ Q and Q

P Q (P⇒Q) T T T T F F F T T F F T

Three worlds where P ⇒ Q is true Q is true in two of these worlds

In those worlds, P is true or false

Page 34: Formal Systems

Entailment •  Using truth tables, we can just check all

possible worlds (models) to see if one formula entails another

•  This requires checking 2n possible worlds, where n is the number of proposition symbols

Page 35: Formal Systems

An “inference rule”

P ⇒ Q P Q

“modus ponens”

Always works, no matter what P and Q mean

Page 36: Formal Systems

Inference rules

•  Operations that depend only on syntax, but that have semantic implications

•  In modus ponens… – syntax: draw a conclusion based just on having

formulas of the right kinds (P ⇒ Q, P) – semantics: conclusion is guaranteed to be true in

the possible worlds described by those formulas

Page 37: Formal Systems

Other inference rules

(the validity of these rules is established by finding the worlds satisfying the premises and checking the conclusion has to be true)

P ∧ Q P Q

P ⇒ Q ¬Q ¬P

“modus tollens”

P P ∨ Q

Page 38: Formal Systems

A proof

(P ∨ Q) ⇒ R P ∧ S P P ∧ S

P

P ∨ Q P P ∨ Q

R modus ponens

Page 39: Formal Systems

Four ingredients of formal logic •  Syntax

– definition of well-formed formulas •  Semantics

– evaluating meaning of formulas •  Entailment

– semantic relationship between formulas •  Inference

– syntactic procedure for deriving formulas

Page 40: Formal Systems

The amazing power of logic… •  Take a world, and describe it with formulas

•  Using purely syntactic operations on those formulas, you can discover new things that are true about that world…

•  The satisfaction of Leibniz’s dream: an algebra that yields valid inferences –  inference rules are just like addition, division, etc.

Also a nice clean story about categorization, language, etc…

Page 41: Formal Systems

Categorization

Page 42: Formal Systems

Categorization

•  Categories are picked out by logical definitions… – e.g. cat ⇔ small ∧ furry ∧ domestic ∧ carnivore

•  Makes it clear what constitutes a cat

•  Also makes it easy to decide whether something actually is a cat… –  just check the definition!

Page 43: Formal Systems

Categorization

cat ⇔ small ∧ furry ∧ domestic ∧ carnivore

Page 44: Formal Systems

Marr’s three levels

Computation “What is the goal of the computation, why is it

appropriate, and what is the logic of the strategy by which it can be carried out?”

Representation and algorithm “What is the representation for the input and

output, and the algorithm for the transformation?” Implementation

“How can the representation and algorithm be realized physically?”

cons

train

s co

nstra

ins

Page 45: Formal Systems

Marr’s three levels

Computation “How can the representation and algorithm be

realized physically?” Inference rules provide a way to discover the true consequences of a set of facts

Page 46: Formal Systems

Marr’s three levels

Representation and algorithm “How can the representation and algorithm be

realized physically?” The first automated systems for deductive reasoning were inspired by human cognition

Herb Simon and Allen Newell

Page 47: Formal Systems

Marr’s three levels

Implementation “How can the representation and algorithm be

realized physically?” Early formal analyses of neurons stressed connections to Boolean logic

Walter Pitts Warren McCulloch John von Neumann

Page 48: Formal Systems

Next week…

•  Tuesday: more on representation and algorithm – how people have equated formal systems and

thought at this level of analysis –  read Anderson, Newell et al.

•  Thursday: formal systems and language