Chapter 1
Chapter 1
Department of Computer
Engineering
Artificial Intelligence
[CoEg3262]
19-Mar-15
2
Course Objectives
On taking this course you should able to
Understand the role of basic
Knowledge representation,
Problem solving, and
Learning methods in AI
in intelligent engineering systems.
Evaluate the strengths and weaknesses of these
methods and their applicability to different tasks
Assess the role of AI in gaining insight into
intelligence and perception
19-Mar-15
3
Course Objectives
know classical examples of artificial intelligence
know characteristics of programs that can be considered
"intelligent" understand the use of heuristics in search
problems and games
know a variety of ways to represent and retrieve
knowledge and information
know the fundamentals of artificial intelligence
programming techniques in a modern programming
language
consider ideas and issues associated with social technical,
and ethical uses of machines that involve artificial
intelligence
19-Mar-15
4
Text Book and References
1. Stuart J. Russell & Peter Norvig: Artificial Intelligence: A Modern
Approach, 2nd edition, Prentice Hall, 2002-----Text book
2. G.F. Luger & W.A. Stubblefield, Artificial Intelligence: Structures
and Strategies for Complex Problem Solving, 3rd edition, Addison
Wesley, 1998.
3. Jones and Bartlett (2004), Artificial Intelligence Illuminated, Ben
Coppin, pub.
4. N. J. Nilsson, Artificial Intelligence: A New Synthesis, Morgan
Kaufmann Publishers, 1998.
5. P.H. Winston, Artificial Intelligence, 3rd edition, Addison Wesley,
1992.
6. E. Rich, K. Knight, Artificial Intelligence, 2nd edition, McGraw Hill,
1991.
7. E. Charniak, D. McDermott, Introduction to Artificial Intelligence,
19-Mar-15
5
Course Outline
CHAPTER 1: Introduction to AI
CHAPTER 2: Intelligent Agents
CHAPTER 3: Solving Problems by Searching and
Constraint Satisfaction Problem
CHAPTER 4: Knowledge and Reasoning
CHAPTER 5: Learning
CHAPTER 6: Natural Language Processing
19-Mar-15
Chapter One:
Introduction to AI
19-Mar-15
7
Outline
Objectives/Goals of AI
What is AI?
Approaches to AI – making computer:
Think like a human ( Thinking humanly)
Act like a human (Acting humanly)
Think rationally (Thinking rationally)
Act rationally (Acting rationally)
The Foundations of AI
Bits of History and the State of the Art
19-Mar-15
8
Objectives
Understand the different faculties involved with
intelligent behavior
Examine the different ways of approaching AI
Look at some example systems that use AI
Trace briefly the history of AI
Have a fair idea of the types of problems that can
be currently solved by computers and those that are
as yet beyond its ability.
19-Mar-15
9
What is Artificial intelligence (AI)?
There are no clear consensus on the definition of AI.
Here’s one from John McCarthy, who coined the term
Artificial Intelligence in 1956) - see http:// www. formal.
Stanford. EDU/ jmc/ whatisai/)
Q. What is artificial intelligence?
A. It is the science and engineering of making intelligent
machines.
Q. Yes, but what is intelligence?
A. Intelligence is the computational part of the ability to
achieve goals in the world. Varying kinds and degrees of
intelligence occur in people, many animals and some
machines.
19-Mar-15
10
What is AI?
Views of AI fall into four categories:
Human
Rationality
performance
Turing Test
Consider the following setting. There are two rooms, A and B.
One of the rooms contains a computer. The other contains a
human.
19-Mar-15
12
Acting humanly: Turing Test…
The interrogator is outside and does not know which
one is a computer. He can ask questions through a
teletype and receives answers from both A and B. The
interrogator needs to identify whether A or B are
humans.
To pass the Turing test, the machine has to fool the
interrogator into believing that it is human.
Turing predicted that by the year 2000, machines
would be able to fool 30% of human judges for five
minutes
Anticipated all major arguments against AI in
following 50 years
Suggested major components of AI: knowledge,
reasoning,
19-Mar-15
language understanding, learning
13
Thinking humanly: cognitive modeling
1960s "cognitive revolution": information-
processing psychology
Requires scientific theories of internal activities of
the brain
How to validate? Requires
1. Predicting and testing behavior of human subjects (top-
down) or
2. Direct identification from neurological data
(bottom-up)
Both approaches (roughly, Cognitive Science and
Cognitive Neuroscience) are now distinct from AI.
19-Mar-15
14
Thinking humanly: cognitive modeling…
Both share with AI the following characteristic:
the available theories do not explain (or engender)
anything resembling human-level general intelligence
Hence, all three fields share one principal direction!
19-Mar-15
15
Thinking rationally: "laws of thought"
Aristotle: what are correct arguments/thought processes?
Several Greek schools developed various forms of logic:
notation and rules of derivation for thoughts;
may or may not have proceeded to the idea of
mechanization
Direct line through mathematics and philosophy to
modern AI
Problems:
1. Not all intelligent behavior is mediated by logical
deliberation
2. What is the purpose of thinking? What thoughts should I
have?
19-Mar-15
16
Acting rationally: rational agent
Rational behavior: doing the right thing
19-Mar-15
17
Rational agents
An agent is an entity that perceives and acts
This course is about designing rational agents
Abstractly, an agent is a function from percept histories to
actions:
[f: P* A]
19-Mar-15
18
The Foundations of AI
Philosophy Logic, methods of reasoning, mind as
physical system foundations of learning,
language, rationality
Mathematics Formal representation and proof
algorithms, computation, (un)decidability,
(in)tractability, probability
Economics utility, decision theory
Neuroscience physical substrate for mental activity
Psychology phenomena of perception and motor
control, experimental techniques
Computer building fast computers
engineering
Control theory design systems that maximize an objective
function over time
Linguistics
19-Mar-15 knowledge representation, grammar
19
History of AI
1943 McCulloch & Pitts: Boolean circuit model of brain
1950 Turing's "Computing Machinery and Intelligence"
1956 Dartmouth meeting: "Artificial Intelligence" adopted
1952—69 Look, Ma, no hands!
1950s Early AI programs, including Samuel's checkers
program, Newell & Simon's Logic Theorist,
Gelernter's Geometry Engine
1965 Robinson's complete algorithm for logical reasoning
1966—73 AI discovers computational complexity
Neural network research almost disappears
1969—79 Early development of knowledge-based systems
1980-- AI becomes an industry
1986-- Neural networks return to popularity
1987-- AI becomes a science
1995-- The emergence of intelligent agents
19-Mar-15
20
State of the art
Deep Blue defeated the reigning world chess champion
Garry Kasparov in 1997
Proved a mathematical conjecture (Robbins conjecture)
unsolved for decades
No hands across America (driving autonomously 98% of
the time from Pittsburgh to San Diego)
During the 1991 Gulf War, US forces deployed an AI
logistics planning and scheduling program that involved up
to 50,000 vehicles, cargo, and people
NASA's on-board autonomous planning program
controlled the scheduling of operations for a spacecraft
Proverb solves crossword puzzles better than most humans
19-Mar-15
21
Prolog
(PROgramming in LOGic)
19-Mar-15
22
What is Prolog?
Prolog = Programming in Logic.
Prolog is a declarative programming language.
In a declarative language
the programmer specifies what the situation (rules and facts) and
a goal(query) to be achieved
the Prolog interpreter derives the solution.
Traditional programming languages are said to be
procedural
procedural programmer must specify in detail how to solve a
problem
In purely declarative languages, the programmer only
states what the problem is and leaves the rest to the
language system
Used in AI applications such as NLP, automated
reasoning systems, expert systems, …
19-Mar-15
23
What is Prolog?(Cont’d)
Prolog is based on facts, rules, queries, constants
and variables.
Facts and rules make up the database.
Constants and variables are used to construct facts,
rules and queries.
Queries drive the search processes
Prolog files are with extension .pl.
19-Mar-15
24
Defining Relationships by Facts
Facts are properties of objects, or relationships between
objects;
Example:-
When we tried to say
tom is a parent of bob
tom and bob are objects and
parent is a relation between object tom and bob
In prolog, we can write like
parent(tom,bob).
Notice that:
names of properties/relationships begin with lower case letters.
the relationship name appears as the first term
objects appear as comma-separated arguments within parentheses.
A period "." must end a fact. A comment lines start with %.
objects also begin with lower case letters.
19-Mar-15
25
Example: Family Tree
pam tom
parent(pam,bob). Instances or
parent(tom,bob). relationships
parent(tom,liz).
bob liz parent(bob, ann).
parent(bob,pat).
parent(pat,jim).
ann pat
A relation is defined as a
jim
set of all its instances
19-Mar-15
26
Defining Relationships by Facts
It is easy in Prolog to define a relation.
The user can easily query the Prolog system about
relations defined in the program.
A Prolog program consists of clauses. Each clause
terminates with a full stop.
The arguments of relations can be
Atoms: concrete objects or constants
Variables: general objects such as X and Y
Questions to the system consist of one or more goals.
An answer to a question can be either positive (succeeded)
or negative (failed).
If several answers satisfy the question then Prolog will find
as many of them as desired by the user.
19-Mar-15
27
Defining Relationships by Rules
Facts:
female( pam). % Pam is female
female( liz).
female( ann).
female( pat).
male( tom). % Tom is male
male( bob).
male( jim).
Define the “offspring()” relation:
Fact: offspring( liz, tom).
Rule: offspring( Y, X) :- parent( X, Y).
For all X and Y,
Y is an offspring of X if
X is a parent of Y.
19-Mar-15
28
Defining Relationships by Rules
combine facts to increase knowledge of the system.
Rules have:
A condition part (body)
o the right-hand side of the rule
A conclusion part (head)
o the left-hand side of the rule
Example:
o offspring( Y, X) :- parent( X, Y).
o The rule is general in the sense that it is applicable to any
objects X and Y.
oA special case of the general rule: X
offspring( liz, tom) :- parent( tom, liz).
parent offspring
o?- offspring( liz, tom).
o?-
19-Mar-15
offspring( X, Y). Y
29
Logical connectives
Predicate
English PROLOG
Calculus
and ^ ,
or v ;
if --> :-
not ~ not
19-Mar-15
30
Defining Relationships by Rules
Define the “mother” relation:
mother( X, Y) :- parent( X, Y), female( X).
For all X and Y,
X is the mother of Y if
X is a parent of Y and
X is a female.
female
X
parent mother
19-Mar-15
31
Defining Relationships by Rules
Define the “grandparent” relation:
grandparent( X, Z) :-
parent( X, Y), parent( Y, Z).
parent
Y
grandparent
parent
19-Mar-15
32
Defining Relationships by Rules
Define the “sister” relation:
sister( X, Y) :-
parent( Z, X), parent( Z, Y), female(X).
For any X and Y,
X is a sister of Y if
(1) both X and Y have the same parent, and
(2) X is female.
?- sister( ann, pat).
Z
?- sister( X, pat).
parent
?- sister( pat, pat). parent
Pat is a sister to herself?! X Y
female
sister
19-Mar-15
33
Defining Relationships by Rules
To correct the “sister” relation:
sister( X, Y) :-
parent( Z, X), parent( Z, Y), female(X),
different( X, Y).
different (X, Y) is satisfied if and only if X and Y are
not equal. (Please try to define this function)
parent parent
X Y
female
sister
19-Mar-15
34
Defining Relationships by Rules
Prolog clauses consist of
Head
Body: a list of goal separated by commas (,)
Prolog clauses are of three types:
Facts:
declare things that are always true
facts are clauses that have a head and the empty body
Rules:
declare things that are true depending on a given condition
rules have the head and the (non-empty) body
Questions:
the user can ask the program what things are true
questions only have the body
19-Mar-15
35
Defining Relationships by Rules
A variable can be substituted by another object.
Variables are assumed to be universally quantified and are
read as “for all”.
For example:
hasachild( X) :- parent( X, Y).
can be read in two way
(a) For all X and Y,
if X is a parent of Y then X has a child.
(b) For all X,
X has a child if there is some Y such that X is
a parent of Y.
19-Mar-15
36
Exercise
Exercise 1. Draw the family tree corresponding to the
following Prolog program:
female(mary).
female(sandra).
female(juliet).
female(lisa).
male(peter).
male(paul).
male(dick).
male(bob).
male(harry).
19-Mar-15
37
Exercise(Cont’d)
parent(bob, lisa).
parent(bob, paul).
parent(bob, mary).
parent(juliet, lisa).
parent(juliet, paul).
parent(juliet, mary).
parent(peter, harry).
parent(lisa, harry).
parent(mary, dick).
parent(mary, sandra).
19-Mar-15
38
Exercise(Cont’d)
After having copied the given program, dene new predicates
(in terms of rules using male/1, female/1 and parent/2) for the
following family relations:
(a) father
(b) sister
(c) grandmother
(d) cousin
You may want to use the operator \=, which is the opposite of
=.
A goal like X \= Y succeeds, if the two terms X and Y cannot
be matched.
19-Mar-15
39
Exercise(Cont’d)
Example: X is the brother of Y, if they have a parent Z in
common and if X is male and if X and Y don't represent
the same person. In Prolog this can be expressed through
the following rule:
brother(X, Y) :-
parent(Z, X),
parent(Z, Y),
male(X),
X \= Y.
19-Mar-15
40
THANK YOU!!!!
19-Mar-15