Transcript 6 - Pages

Propositional Logic
Rather than jumping right into FOL, we begin
with propositional logic
A logic involves:
 Language (with a syntax)
 Semantics
 Proof (Inference) System
Example of k-rep in prop calc




R : “It is raining”
B : “Take the bus to class”
W : “Walk to class”
Some things to tell our agent


R  B (“If it is raining, (then) take the bus to
class”)
R  W (“If it is not raining, (then) walk to
class”)
 Ideally, we would like our agent to sense that it
is raining & then decide to take the bus
Alphabet
Non-Logical Symbols
(meaning given by interpretation)
 Propositions

P, Q, R,…
• atomic statements (facts) about the world
• R : it’s-raining-now
• needn’t be a single letter
Logical Symbols
(fixed meaning)
Alphabet
Logical Symbols
 Connectives:
not ()
and ()
or ()
implies ()
equivalent ()
 Punctuation Symbols: ( , )
 Truth symbols:
TRUE, FALSE
Well-formed formulae (wffs)
 Sentences


just like in a programming language, there are
rules (syntax) for legally creating compound
statements
remember: we’re always stating a truth about
the world, hence every wff is something that
has a Boolean value (it is either a true or a false
statement about the world)
Syntax rules




Propositions (P, Q, R, …) are wffs
Truth symbols (TRUE, FALSE) are wffs
If A is a wff, so is A
If A and B are wffs, so are
AB
A  B
A B
A  B

There are no other wffs.
 Language: set of all wffs
Are these WFFs?
 PQR
 (P  Q)  (R  S)
 P   (Q  R)
Semantics
 KB |= Q
KB - Set of wffs
Q- a wff
|= Entailment
 Compositional
 Two-Valued
What is an interpretation?
An interpretation gives meaning to the nonlogical symbols of the language.
An assignment of facts to atomic wffs
a fact is taken to be either true or false about the
world
 thus, by providing an interpretation, we also
provide the truth value of each of the atoms
example

• P : it-is-raining-here-now
• since this is either a true or false statement about the
world, the value of P is either true or false
a function that maps atomic formulas to truth
values
Truth tables
Connectives Semantics
How to evaluate a wff
 ((P  U)  R)  (S  V)
 First, we need an interpretation

P : T; U : F; R : T; S : F; V : T
 Then using this interpretation, evaluate
formula according to the fixed meanings of
the connectives




PU:T
(P  U)  R : T
SV:F
whole formula : F
Satisfiability and Models
 An interpretation I satisfies a wff iff I assigns
the wff the value T
 An interpretation I satisfies a set of S of wffs
iff I satisfies every wff in S.
 An interpretation that satisfies a (set of) wff is
said to be a model of it.
 A (set of) wff is satisfiable iff there exists some
interpretation that satisfies it
 Examples:

P is satisfiable
• simply let P be true

P  P is unsatisfiable
• if P is false, the formula is false
• if P is true, P is false, the formula is false

P  Q is satisfiable
• three ways: P is true, Q is true; etc.


A wff that is unsatisfiable is called a
contradiction
for example, a model for {A  B, B  C} is
• A : true, B : true, C : true
• note: there may be more than one model for a (set of)
wff
Entailment
(Logical Consequence)
KB |= Q iff for every interpretation I,
If I satisfies KB then I satisfies Q.
That is, if every model of KB is also a model of
Q.
For example:
A  B, A |= B
Validity
 A formula G is valid if it is true for every
interpretation
 P   P is valid
• if P is true, then the formula is true
• if P is false, then ~P is true and the formula is true

(P  Q)  (P  Q) isn’t valid
• when P is true & Q is true, the formula isn’t true
• in order to not be valid, there only need exist one
counter-example

also called a tautology
Some important Theorems
a) KB |= Q
iff KB U { Q} is unsatisfiable
b) KB , A |= B iff KB |= (A  B)
c) Monotonicity:
if
KB  KB’
then {Q | KB |= Q}  {Q | KB’ |= Q}