Вы находитесь на странице: 1из 48

CogSci 131

Formal systems and


propositional logic
Tom Griffiths

Admin
Waitlist has been processed
if you are currently not admitted, you wont
get into the class unless somebody drops

Marrs three levels


constrains

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?

constrains

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?

Part II: Rules and symbols

Outline
Formal systems
Break
Logic

string = computation;
disp(string);

thought

Minds and computers are both formal systems

Formal systems
(as defined by Haugeland)

Token manipulation
Digital
Medium independence

Formal systems
(as defined by Haugeland)

Token manipulation
Digital
Medium independence

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

Example 1: Chess
Pieces
Starting positions

Formal rules

Example 2: Formal logic


Pieces

P, Q, , , , , (, )

Starting positions

well-formed formulas
e.g., P Q

Formal rules

e.g., P Q
P
Q

Formal systems
(as defined by Haugeland)

Token manipulation
Digital
Medium independence

Digital systems
Possible states of the system are
discrete, and perfectly identifiable

Digital

Analog

Formal systems
(as defined by Haugeland)

Token manipulation
Digital
Medium independence

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

Formal systems
(as defined by Haugeland)

Token manipulation
Digital
Medium independence
Tokens need not have any underlying meaning

(Haugeland, p. 17)

tokens
become
symbols

All that matters is syntax


The interpretation of the system does not affect
the validity of moves
PQ
P
Q

PushSwitch Light
PushSwitch
Light

The meaning of symbols (semantics) is irrelevant


to operation of the system

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

The mind as a formal system


This is an old idea

Aristotle

Leibniz

Turing

that became the foundation for AI


good-old-fashioned AI

string = computation;
disp(string);

thought

Minds and computers are both formal systems

Break

Up next:
Logic

Example 2: Formal logic


Pieces

P, Q, , , , , (, )

Starting positions

well-formed formulas
e.g., P Q

Formal rules

e.g., P Q
P
Q

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

Propositional (Boolean) Logic

George Boole
(1816-1854)

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)

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

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
P
T
T
F
F

Q (PQ)
T
T
F
F
T
F
F
F

P Q (PQ)
T T
T
T F
T
F T
T
F F
F

P
T
T
F
F

Q (PQ) P P
T F
T
T
F T
F
F
T
T
F
T

An assignment of truth values to propositions


(a world) that results in a formula being true
is a model of that formula

Evaluating the truth of formulas


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

Possible worlds:
Work hard, get an A
Work hard, dont get an A
Dont work hard, get an A
Dont work hard, dont get an A

Q
P
T
T
F
F

Q (PQ)
T
T
F
F
T
T
F
T

Three models for this formula

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

Drawing conclusions
Say we know P Q is true, and P is true
What can we conclude from this?
P
T
T
F
F

Q (PQ)
T
T
Three worlds where P Q is true
F
F
P is true in only one of these worlds
T
T
In that world, Q must be true too
F
T

Any time we know P Q and P, conclude Q

Conclusions dont always follow


Say we know P Q is true, and Q is true
What can we conclude from this?
P
T
T
F
F

Q (PQ)
T
T
Three worlds where P Q is true
F
F
Q is true in two of these worlds
T
T
In those worlds, P is true or false
F
T

No further conclusions from P Q and Q

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

An inference rule
PQ
P
Q

modus ponens

Always works, no matter what P and Q mean

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

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)

PQ
P
Q

P
PQ

PQ
Q
P
modus tollens

A proof
(P Q) R
PS
P
PQ
R

PS
P
P
PQ

modus ponens

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

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 Leibnizs dream: an
algebra that yields valid inferences
inference rules are just like addition, division, etc.
Also a nice clean story about categorization, language, etc

Categorization

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!

Categorization
cat small furry domestic carnivore

Marrs three levels


constrains

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?

constrains

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?

Marrs three levels


Computation
How can rules
the representation
and to
algorithm
be
Inference
provide a way
discover
realized
physically?
the
true consequences
of a set of facts

Marrs three levels


Representation and algorithm
How
the representation
be
The
firstcan
automated
systemsand
foralgorithm
deductive
realized physically?
reasoning
were inspired by human cognition

Herb Simon and Allen Newell

Marrs three levels


Implementation
How
can the
representation
and algorithm
be
Early
formal
analyses
of neurons
stressed
realized physically?
connections
to Boolean logic

Walter Pitts

Warren McCulloch

John von Neumann

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

Вам также может понравиться