formal systems
DESCRIPTION
Formal SystemsTRANSCRIPT
CogSci 131 Formal systems and propositional logic
Tom Griffiths
Admin
• Waitlist has been processed – if you are currently not admitted, you won’t
get into the class unless somebody drops
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
Part II: Rules and symbols
Outline
Formal systems
Break
Logic
thought string = ‘computation’;disp(string); ≈
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 Starting positions Formal rules
P, Q, ¬, ∧, ∨, ⇒, (, )
“well-formed formulas” e.g., P ⇒ Q
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
The meaning of symbols (semantics) is irrelevant to operation of the system
P ⇒ Q P Q
PushSwitch ⇒ Light PushSwitch Light
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…
• …that became the foundation for AI “good-old-fashioned AI”
Aristotle Leibniz Turing
thought string = ‘computation’;disp(string); ≈
Minds and computers are both formal systems
Break
Up next: Logic
Example 2: Formal logic Pieces Starting positions Formal rules
P, Q, ¬, ∧, ∨, ⇒, (, )
“well-formed formulas” e.g., P ⇒ Q
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”
• 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
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
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?
• 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…
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
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”
P ⇒ Q 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)
P ∧ Q P Q
P ⇒ Q ¬Q ¬P
“modus tollens”
P P ∨ Q
A proof
(P ∨ Q) ⇒ R P ∧ S P P ∧ S
P
P ∨ Q P P ∨ Q
R 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 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…
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
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
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
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
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
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