Chapter 4 AI
Chapter 4 AI
ARTIFICIAL INTELLIGENCE
Introduction
Logical Agents
Propositional Logic
Predicate (First-Order) Logic
Inference in First-Order Logic
Knowledge Representation
Knowledge-based Systems
3 INTRODUCTION
A logical, knowledge-based agent begins with some knowledge of the world and of its own
actions.
It uses logical reasoning to maintain a description of the world as new percepts arrive, and to
deduce a course of action that will achieve its goals.
The knowledge-based approach is a particularly powerful way of constructing an agent
program.
It aims to implement a view of agents in which they can be seen as knowing about their world,
and reasoning about their possible courses of action.
4 INTRODUCTION
Knowledge-based agents are able to accept new tasks in the form of explicitly described goals;
They can achieve competence quickly by being told or learning new knowledge about the
environment;
And they can adapt to changes in the environment by updating the relevant knowledge.
A knowledge-based agent needs to know many things:
the current state of the world;
how to infer unseen properties of the world from percepts;
how the world evolves over time; what it wants to achieve;
and what its own actions do in various circumstances.
5 A KNOWLEDGE-BASED AGENT
Knowledge-based agents are agents that know about their world and reason about their courses
of action.
A knowledge-based agent consists of two parts:
A knowledge base and
An inference engine
Knowledge base domain-specific content
Inference engine domain-independent algorithms
We want to generate new sentences that are necessarily true, given that the old sentences are
true.
This relation between sentences is called entailment.
An inference procedure that generates only entailed sentences is called sound or truth-
preserving.
Once a sentence is given an interpretation by the semantics, the sentence says that the world is
this way and not that way.
Note that truth depends both on the interpretation of the sentence and on the actual state of the
world.
The terms "reasoning" and "inference" are generally used to cover any process by which
conclusions are reached.
12 REPRESENTATION, REASONING, AND LOGIC
symbols P1, P2
Two sentences are logically equivalent if they are true in the same models: α ≡ ß if α╞ β and
β╞ α.
16 PROPOSITIONAL LOGIC
Instead of enumerating truth tables, can do proof by successively applying sound inference
rules:
Inference is the processing of finding what sentences are entailed.
inference: deriving sentences from other sentences.
Modus Ponens:
Modus Tollens: The Modus Tollens rule state that if P→ Q is true and ¬ Q is true, then ¬ P
will also true. It can be represented as:
18 PROOF BY APPLYING INFERENCE RULES
Resolution works best when the formula is of the special form: it is an ∧ of ∨s of (possibly
negated, ¬) variables (called literals ).
Uses Conjunctive Normal Form (CNF) conjunction of disjunctions of
literals, e.g., (A B) (B C D)
Conjunctive normal form (CNF) is an important normal form for propositional logic. A logic
formula is in conjunctive normal form if it is a single conjunction of disjunctions of (possibly
negated) literals.
19 PROOF BY APPLYING INFERENCE RULES
Conversion to CNF.
B (P Q)
Eliminate , replacing A B with (A B) A)
B (P Q) (P Q) B
Eliminate , replacing A B with B
(P Q)) (P Q) B)
Move inwards using de Morgan's rules and double-negation
( P Q) P Q) B)
Apply distributive law ( over ):
( P Q) P B) Q B) IN CNF.
TRY This : (A∨B) (C D)