Foundations of AI: Ch. 12: Propositional Logic
Foundations of AI: Ch. 12: Propositional Logic
12
Propositional Logic
Logical entailment
07/2
Agents that Think Rationally
Until now, the focus has been on agents that act rationally.
Often, however, rational action requires rational (logical)
thought on the agent’s part.
To that purpose, portions of the world must be represented
in a knowledge base, or KB.
A KB is composed of sentences in a language with a truth
theory (logic), i.e. we (being external) can interpret sentences
as statements about the world. (semantics)
Through their form, the sentences themselves have a causal
influence on the agent’s behavior in a way that is correlated
with the contents of the sentences. (syntax)
Interaction with the KB through ASK and TELL (simplified):
ASK(KB,α) = yes exactly when α follows from the KB
TELL(KB,α) = KB’ so that α follows from KB’
FORGET(KB,α) = KB’ non-monotonic (will not be discussed)
07/3
3 Levels
In the context of knowledge representation, we can distinguish
three levels [Newell 1990]:
Knowledge level: Most abstract level. Concerns the total knowledge
contained in the KB. For example, the automated DB information
system knows that a trip from Freiburg to Basel costs 18€.
Logical level: Encoding of knowledge in a formal language.
Price(Freiburg, Basel, 18.00)
Implementation level: The internal representation of the sentences,
for example:
• As a string “Price(Freiburg, Basel, 18.00)”
• As a value in a matrix
When ASK and TELL are working correctly, it is possible to remain
on the knowledge level. Advantage: very comfortable user
interface. The user has his/her own mental model of the world
(statements about the world) and communicates it to the agent
(TELL). 07/4
A Knowledge-based Agent
07/5
The Wumpus World (1)
A 4 x 4 grid
In the square containing the wumpus and in the directly
adjacent squares, the agent perceives a stench.
In the squares adjacent to a pit, the agent perceives a
breeze.
In the square where the gold is, the agent perceives a
glitter.
When the agent walks into a wall, it perceives a bump.
When the wumpus is killed, its scream is heard
everywhere.
Percepts are represented as a 5-tuple, e.g.,
07/7
The Wumpus World (3):
A Sample Configuration
07/8
The Wumpus World (4)
07/9
The Wumpus World (5)
07/10
Declarative Languages
Before a system that is capable of learning, thinking,
planning, explaining, … can be built, one must find a way
to express knowledge.
We need a precise, declarative language.
• Declarative: System believes P iff it considers P to be
true (one cannot believe P without an idea of what it
means for the world to fulfill P).
• Precise: We must know,
– which symbols represent sentences,
– what it means for a sentence to be true, and
– when a sentence follows from other sentences.
One possibility: Propositional Logic
07/11
Basics of Propositional Logic (1)
07/12
Basics of Propositional Logic (2)
07/13
Syntax of Propositional Logic
Interpretation or of a formula :
07/16
Example
07/17
Terminology
07/23
Proof of the Deduction Theorem
(1)
(2)
Note:
(1) and (2) are applications of the deduction theorem.
07/25
Inference Rules, Calculi and Proofs
We can often derive new formulae from formulae in the
KB. These new formulae should follow logically from the
syntactical structure of the KB formulae.
Example: If the KB is
then is a logical consequence of KB
Æ Inference rules, e.g.,
Negation of a literal:
. . –
07/31
Completeness?
Is resolution also complete, i.e., is
07/32
Resolution: Overview
Resolution is a refutation-complete proof process.
There are others (Davis-Putnam Procedure,
Tableaux Procedure, …).
In order to implement the process, a strategy
must be developed to determine which resolution
steps will be executed and when.
In the worst case, a resolution proof can take
exponential time. This, however, very probably
holds for all other proof procedures.
For CNF formulae in propositional logic, the Davis-
Putnam Procedure (backtracking over all truth
values) is probably (in practice) the fastest
complete process that can also be taken as a type
of resolution process. 07/33
Where is the Wumpus?
The Situation
07/34
Where is the Wumpus?
Knowledge of the Situation
∨ ∨ ∨
07/35
Clausal Representation of the
Wumpus World
07/36
Resolution Proof for the Wumpus World
07/37
From Knowledge to Action
We can now infer new facts, but how do we
translate knowledge into action?
Negative selection: Excludes any provably
dangerous actions.
Differences?
From the suggestions, we must still select an
action. 07/38
Problems with Propositional Logic
Although propositional logic suffices to represent the wumpus world,
it is rather involved.