ARTIFICIAL INTELLIGENCE
Networks and
Communication
Department
Lecture 5
Outline
Semantic network
Frames
Predicate logic
Rule-based system
Show how expert systems can be used when a human expert is not available.
agent
can
be
used
to
simulate
mundane
tasks
Show how expert systems and mundane systems can use different search
techniques to solve problems.
What is Artificial
Intelligence ?
Artificial intelligence is the study of programmed
systems that can simulate, to some extent, human
activities such as perceiving, thinking,
learning and acting.
Intelligent agents
An intelligent agent is a system that perceives its
environment, learns from it, and interacts with it
intelligently.
Intelligent agents can be divided into two broad
categories: software agents and physical agents.
Intelligent agents
Intelligent agents
Software agent
Software agents
A software agent is a set of programs that are designed to do
particular tasks.
For example, a software agent can check the contents of
received e-mails and classify them into different categories
(junk, less important, important, very important and so on).
Another example of a software agent is a search engine used
to search the World Wide Web and find sites that can provide
information about a requested subject.
Programming Languages
Although some all-purpose languages such as C, C++
and Java are used to create intelligent software, two
languages are specifically designed for AI: LISP and
PROLOG.
Programming Languages
(Cont.)
LISP
LISP (derives from LISt Programming) was
invented by John McCarthy in 1958.
As the name implies, LISP is a programming
language that manipulates lists.
It treats data as well as program as lists, which
means that a LISP program can change itself
It is slow if the list to be handled is long
Complexity of its syntax
Networks and Communication Department
Programming Languages
PROLOG
PROLOG (PROgramming in LOGic) is a language that
can build a database of facts and a knowledge base of rules.
A program in PROLOG can use logical reasoning to
answer questions that can be inferred from the knowledge
base.
Knowledge Representation
Knowledge Representation
If an artificial agent is supposed to solve some
problems related to the real world, it
somehow needs to be able to represent
knowledge.
Facts are represented as data structures that
can be manipulated by programs stored inside
the computer.
In this section, we describe four common
methods for representing knowledge:
semantic networks, frames, predicate logic
and rule-based systems. Networks and Communication Department
Semantic Representation
A semantic network uses directed graphs to
represent knowledge. A directed graph is made
of vertices (nodes) and edges (arcs).
In a directed graph each edge, which connect
two vertices, has a direction ( shown in the
figure by an arrowhead).
Semantic networks uses vertices to represent
concepts and edges (denoted by arrows) to
represent the relation between two concepts
Semantic Representation
(Cont.)
Semantic Representation
(Cont.)
Relations
In a semantic network, relations are shown by edges.
An edge can define:
a subclass relation, the edge is directed from the subclass to its superclass.
an instance relation, the edge is directed from the instance to the set to
which it belongs.
an attribute of an object (color, size, ),
or a property of an object (i.e. possessing another object)
Frames
Frames
Figure 18.2 A set of frames representing the semantic network in Figure 18.1
Frames
Objects
A node in a semantic network becomes an object in a set of
frames, so an object can define a class, a subclass or an
instance of a class. In Figure 18.2, reptile, mammal, dog,
Roxy and Ringo are objects.
Slots
Edges in semantic networks are translated into slotsfields
in the data structure. The name of the slot defines the type of
the relationship and the value of the slot completes the
relationship. In Figure 18.2, for example, animal is a slot in
the reptile object.
Exercise 1 (solution)
Blood vessel:
form: tubular
contain: blood
Artery:
subclass: Blood vessel
wall_type: muscular
diameter: 0.4cm
Vein:
subclass: Blood vessel
wall_type: fibrous
Aorta:
subclass: Artery
diameter: 2.5cm
26/46
Blood
Muscular
Blood vessel
Wall-type Subclass
Artery
0.4 cm
Form
Tubular
Subclass
Vein
Diameter
Subclass
Wall-type
Fibrous
Aorta
Diameter
2.5 cm
Networks and Communication Department
Predicate Logic
The most common knowledge representation is predicate
logic.
Predicate logic can be used to represent complex facts.
It is a well-defined language developed via a long history
of theoretical logic.
Although this section defines predicate logic, we first
introduce propositional logic, a simpler language.
We then discuss predicate logic, which employs
propositional logic.
Propositional Logic
Compound sentences:
It express logical relationships between the simpler
sentences of which they are composed.
The logical value (true or false) of each sentence
depends on the logical value of the atomic sentences
of which the compound sentence is made.
Propositional Logicoperators
(P
Propositional Logic
Example 18.1
The following are sentences in propositional language:
a. Today is Sunday (S).
b. It is raining (R).
c. Today is Sunday or Monday (S M).
d. It is not raining ( R).
e. If a dog is a mammal then a cat is a mammal (D C).
Deduction (Cont.)
In AI we need to create new facts from the
existing facts.
In propositional logic, the process is called
deduction.
Given two presumably true sentences, we can
deduce a new true sentence.
The first two sentences are called premises, the
deduced sentence is called the conclusion.
The whole is called an argument.
Deduction (Cont.)
For example 1:
Deduction (Cont.)
One way to find if an argument is valid is to create a truth
table for the premisses and the conclusion.
A conclusion is invalid if we can find a counterexample
case: a case in which both premisses are true, but the
conclusion is false.
An argument is valid if no counterexample can be found.
Deduction (Cont.)
Example 1
The validity of the argument {H O, H} | O can be proved
using the following truth table:
The only row to be checked is the second row. This row does not
show a counterexample, so the argument is valid.
Deduction (Cont.)
For example 2:
If she is rich, she has a car.
Premise1:
She has a car
Premise2:
she is rich.
canTherefore,
show
the
above argument
Conclusion
We
as { R C,C} | R, in
which R means She is rich, and C means She has a car
and the symbol | for the therefore.
Deduction (Cont.)
Example 2
The argument {R C, C} | R is not valid because a counter
example can be found:
Predicate Logic
In propositional logic, a symbol that represents a sentence is
atomic: it cannot be broken up to find information about its
components. For example, consider the sentences:
1.
2.
3.
4.
Predicate Logic
Example 18.4
1. The sentence John works for Anns sister can be written as:
Works [John, sister(Ann)] in which the function sister(Ann) is
used as an argument.
2. The sentence Johns father loves Anns sister can be written
as: loves[father(John), sister(Ann)]
Predicate Logic
Example 18.5
Predicate Logic
Example 18.5
Continued
or
Deduction
In predicate logic, if there is no quantifier, the verification of
an argument is the same as that which we discussed in
propositional logic. However, the verification becomes more
complicated if there are quantifiers. For example, the
following argument is completely valid.
Deduction
Since the first premise talks about all men, we can replace
one instance of the class man (Socrates) in that premise to
get the following argument:
Rule-based Systems
or
AB
Rule-based Systems
Components (Cont.)
knowledge base
Database of fact
Interpreter
Backward Chaining
Algorithm
To prove goal G:
If G is in the initial facts, it is proven.
Otherwise, find a rule which can be used to conclude
G, and try to prove each of that rules conditions.
Backward Chaining
Example
Rules:
R1: IF hot AND smoky THEN fire
R2: IF alarm_beeps THEN smoky
R3: If fire THEN switch_on_sprinklers
Facts:
F1: hot
F2: alarm_beeps
Goal:
Should I switch sprinklers on?
Networks and Communication Department
67
67
Any
Que
stio
ns ?
References