Common Sense: Artificial Intelligence

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

fo

.in
rs
de
ea
yr
Common Sense : AI Course Lecture 42, notes, slides

.m
w
w
www.myreaders.info/ , RC Chakraborty, e-mail rcchak@gmail.com , June 01, 2010
,w
ty

www.myreaders.info/html/artificial_intelligence.html
or
ab

www.myreaders.info
kr
ha
C
C
R

Return to Website

Common Sense
Artificial Intelligence
Common sense, topics : Introduction, Common sense knowledge
and reasoning, how to teach commonsense to a computer;
Formalization of common sense reasoning - initial attempts of
late 60's and early, renewed attempts in late 70's and 80's to
recent time; Physical world - modeling the qualitative world,
reasoning with qualitative information; Common Sense
Ontologies - time, space, material; Memory organization - short
term memory (STM), long term memory (LTM).
fo
.in
rs
de
ea
Common Sense

yr
.m
w
w
,w

Artificial Intelligence
ty
or
ab
kr

Topics
ha
C
C

(Lecture 42 , 1 hours) Slides


R

1. Introduction 03-10

Common sense knowledge and reasoning, How to teach commonsense


to a computer.

2. Formalization of Common Sense Reasoning 11-13

Initial attempts of late 60's and early, Renewed attempts in late 70's
and 80's to recent time.

3. Physical World 18-17

Modeling the qualitative world, Reasoning with qualitative information.

4. Common Sense Ontologies 22-20

Time, Space, Material.

5. Memory Organization 25

Short term memory (STM), Long term memory (LTM).

6. References 26

02
fo
.in
rs
de
ea
yr
.m
w
w
,w
ty

Common Sense
or
ab
kr
ha
C
C
R

What is Common Sense ?

• Common sense is the mental skills that most people share.

• Common Sense is ability to analyze a situation based on its context,


using millions of integrated pieces of common knowledge.

• John McCarthy was the first to talk about commonsense reasoning in


his paper in 1959, explains that a program has commonsense if
it automatically deduces for itself sufficiently wide class of immediate
consequences of any thing it is told and what it already knows.

• Common sense is what people come to know in the process of growing


and living in the world (R.Elio, 2002).

• Common sense knowledge includes the basic facts about events and
their effects, facts about knowledge and how it is obtained, facts about
beliefs and desires. It includes the basic facts about material objects
and their properties (John McCarthy, 1990).

• Currently, computers lack common sense .


03
fo
.in
rs
de
AI - Common Sense: Introduction

ea
1. Introduction

yr
.m
w
w
Commonsense is ability to analyze a situation based on its context,
,w
ty
or

using millions of integrated pieces of common knowledge. Ability to use


ab
kr

common sense knowledge depends on being able to do commonsense reasoning.


ha
C
C

Commonsense Reasoning is a central part of intelligent behavior.


R

Formalizing the commonsense knowledge for even simple reasoning problem


is a huge task. The reason is that, the most commonsense knowledge is implicit
in contrast to expert/specialist knowledge, which is usually explicit. Therefore
making commonsense reasoning system is making this knowledge explicit.

Example : Everyone knows that dropping a glass of water, the glass will
break and water will spill on podium. However, this information is not obtained
by formula or equation for a falling body or equations governing fluid flow.

The goal of the formal commonsense reasoning community is to encode this


implicit knowledge using formal logic.

Computers and ordinary real life - issues ?


Computers do many remarkable things. Computer programs can play chess
at the level of best players. But no computer program match the capabilities
of a three year old child at recognizing objects or can draw simple conclusions
about ordinary life. Building machines that can think the way any average
person can is a distant reality.

Why computers can not think about the world as any person can ?
Where the problem lies ?
There are two basic types of knowledge. One is the specialist's knowledge
which mathematicians, scientists and engineers possess. The other type is
the commonsense knowledge which every one has, even a small 6-year–old
child. The need is to teach the computer to reason about the world
(commonsense knowledge). The researchers have not yet reached to any
consensus on many related issues. McCarthy suggested to use logic to
represent the knowledge. Understanding common sense capability is an active
area of research in artificial intelligence.
04
fo
.in
rs
de
AI - Common Sense: Introduction

ea
1.1 Commonsense Knowledge and Reasoning

yr
.m
w
w
Common sense facts and methods are very little understood today.
,w
ty
or

Extending this understanding is the key problem the AI researchers are


ab
kr

facing. John McCarthy (1984) identified as common sense as :


ha
C
C

Common sense knowledge - what every one knows.


R

Common sense reasoning - ability to use common sense knowledge.

• Common Sense Knowledge


What one can express as a fact using a richer ontology.
Examples
‡ Every person is younger than the person's mother

‡ People do not like being repeatedly interrupted

‡ If you hold a knife by its blade then the blade may cut you

‡ If you drop paper into a flame then the paper will burn

‡ You start getting hungry again a few hours after eating a meal

‡ People go to parties to meet new people

‡ People generally sleep at night

Here the problem is , how to give computers these millions of ordinary


pieces of knowledge that every person learns by adulthood.
05
fo
.in
rs
de
AI - Common Sense: Introduction

ea
• Common Sense Reasoning

yr
.m
w What one builds as a reasoning method into his program.
w
,w
ty

Examples
or
ab

‡ If you have a problem, think of a past situation where you solved


kr
ha
C

a similar problem.
C
R

‡ If you take an action, anticipate what might happen next


‡ If you fail at something, imagine how you might have done things
differently .
‡ If you observe an event, try to infer what prior event might have
caused it.
‡ If you see an object, wonder if anyone owns it
‡ If someone does something, ask yourself what the person's purpose
was in doing that.
Here the problem is, how to give computers the capacity for
commonsense reasoning, the ways to use the commonsense knowledge
to solve the various problems we encounter every day.
06
fo
.in
rs
de
AI - Common Sense: Introduction

ea
1.2 How to Teach Commonsense to a Computer

yr
.m
w
w
There is no clear answer for to this question.
,w
ty
or

Presently, there is no program that can match the common sense


ab
kr

reasoning powers of a 5 year old child. The problem was noticed long
ha
C
C

ago by John McCarthy. We do not yet have enough ideas about how
R

to represent, organize, and use much of commonsense knowledge, let


alone build a machine that could learn automatically on its own".
ƒ Some believe that, prior understanding is not necessary to build a
machine, and intelligence can be made to emerge from some generic
learning.
ƒ Others feel that, unless we can acquire some experience in manually
engineering systems with common sense, we will not be able to build
learning machines that can automatically learn common sense.
07
fo
.in
rs
de
AI - Common Sense: Introduction

ea
• Building Human Commonsense Knowledge Base

yr
.m
w
w
Stated below, the two ongoing AI projects for assembling
,w
ty
or

comprehensive ontology and knowledge base of everyday common


ab
kr

sense knowledge with the goal of enabling AI applications to


ha
C
C

perform human-like reasoning.


R

Project CYC : A commonsense knowledge base, building since


two decades, has collected 1.5 million pieces of commonsense
knowledge, still far away from several hundred million required; the
project faces a challenge because such a large database cannot
be engineered by any one group.

Project Open Mind : A common sense knowledge base, building since


1999, has accumulated more than 700,000 facts from over 15,000
contributors; the knowledge collected by has enabled many research
projects at MIT and elsewhere.

[Continued in next slide]


08
fo
.in
rs
de
AI - Common Sense: Introduction

ea
[Continued from previous slide]

yr
.m
w
w The CYC and Open Mind projects are ensuring enough commonsense
,w

knowledge so as to work in a given environment enabling AI


ty
or
ab

applications to perform human-like reasoning.


kr
ha
C

Next comes the Common Sense Reasoning :


C
R

It is what one builds as a reasoning method into his program, a very


complex task. We want computer to do reasoning as human does.
Human does reasoning in different ways and the one which is
Logic Reasoning (deductive, inductive, abductive), is of main concern
in AI reasoning system. The logic reasoning can accomplish the task
of common sense reasoning. For instance :

‡ Predicate logic can represent knowledge about objects, facts, rules,

‡ Frames can describe everyday objects


‡ Scripts can describe typical sequences of events
‡ Non-monotonic logics can support default reasoning,
09
fo
.in
rs
de
AI - Common Sense: Introduction

ea
• Example of Commonsense System Architecture (Mueller, 2004)

yr
.m
w The system takes as input a template produced by information
w
,w
ty

extraction system about certain aspects of a scenario.


or
ab
kr
ha

Template
C
C
R

Script classifier

Template, script

Reasoning problem
builder for script

Reasoning problem
Common
Commonsense
sense
reasoner
KB

Model

Commonsense System Architecture


‡ The template is a frame with slots and slots fillers
‡ The template is fed to a script classifier, which classifies what script is
active in the template.
‡ The template and the script are passed to a reasoning problem builder
specific to the script, which converts the template into a commonsense
reasoning problem.
‡ The problem and a commonsense knowledge base are passed to a
commonsense reasoner. It infers and fills in missing details to produce a
model of the input text.
‡ The model provides a deeper representation of the input, than is
provided by the template alone.
10
fo
.in
rs
de
AI - Common Sense: Formalization of reasoning

ea
2. Formalization of Common Sense Reasoning

yr
.m
w
w
Commonsense reasoning is a central part of human behavior; no real
,w
ty
or

intelligence is possible without it. The ultimate goal of artificially intelligent


ab
kr

systems is that they exhibit commonsense behavior.


ha
C
C

For the computers, the commonsense reasoning is not an easy task,


R

indeed a very complex task, we all perform about every day world.
Example : There are chess-playing programs that beat champions, and
there are expert systems that assist in clinical diagnosis, but there is no
program that reason about how far one must bend over to put on
one’s socks.
The reason is expert knowledge is usually explicit, but most
commonsense knowledge is implicit. Therefore, one of the prerequisites
for developing commonsense reasoning systems is making this
knowledge explicit.

John McCarthy (1990) identified commonsense reasoning as human


ability to use common sense knowledge.

Mueller (2006) defines commonsense reasoning as a process, taking


information about certain aspects of a scenario in the world and
making inference about other aspects of the scenario based on our
commonsense knowledge or knowledge about how the world works.

[Continued in next slide]


11
fo
.in
rs
de
AI - Common Sense: Formalization of reasoning

ea
[Continued from previous slide]

yr
.m
w To formalize commonsense reasoning, we need to construct
w
,w
ty

representations for commonsense knowledge and inference algorithms


or
ab
kr

to manipulate that knowledge. McCarthy in 1959 was first to put


ha
C

forward the idea of using a formal logic as the representation language


C
R

for a commonsense reasoning system, with the reasoning done by


deductive inference.

Robert C. Moore in his article, "Automatic Deduction for


Commonsense Reasoning: An Overview", explained the issues involved
in drawing conclusions by means of deductive inference from bodies
of commonsense knowledge represented by logical formulas. This article
contains first a review of initial attempts of late 60's and early
70's – failures and disappointments, and then the renewed attempts in
late 70's and 80's to recent time - how domain-specific control
information can offer a solution to the difficulties, the relationship of
automatic deduction to the new field of "logic programming" and issues
that arise while extending automatic-deduction techniques to
nonstandard logic.

Note : Just to complete this section, the issues, arguments and the
solutions offered his article (Robert C. Moore, technical note 239, april
1981, Sri International Menlo park CA Artificial intelligence center) are put
very briefly in next three slides.

12
fo
.in
rs
de
AI - Common Sense: Formalization of reasoning

ea
2.1 Initial attempts of late 60's and early 70's

yr
.m
w failures and disappointments
w
,w
ty

Many researchers, (Black, Robinson, Green and others) made serious


or
ab

attempt to implement McCarthy's idea, but faced difficulties because :


kr
ha
C

ƒ search space generated by the resolution method was


C
R

growing exponentially with the number of formulas used to


describe a problem; the problems of moderate complexity could
not be solved in reasonable time.
ƒ several domain-independent heuristics proposed to deal with this
search space issue, proved too week to produce satisfactory results.

The failures resulted from two constraints the researchers had imposed:
(a) attempted to use only uniform, domain-independent, proof
procedures; and (b) tried to force all reasoning and problem -
solving behavior into the framework of logical deduction.
There were widespread condemnation of any use of logic or deduction
in commonsense reasoning or problem solving.

However, the interest in deduction-based approaches to commonsense


reasoning did not go away, rather revived in late 70's.

13
fo
.in
rs
de
AI - Common Sense: Formalization of reasoning

ea
2.2 Renewed attempts in late 70's and 80's to recent time

yr
.m
w
w
The revival of interest in deduction-based approaches to commonsense
,w
ty
or

reasoning, is noticed since late 70's, from the work of many


ab
kr

researchers (McDermott, Doyle, Moore, Bobrow and others), because,


ha
C
C

the recognition of some important class of problems resist solution by


R

any other method. The understanding came from following issues :

• Representation Formalism based on Logic


■ If one decides to use a representation formalism based on logic, it
may not be necessary to use general deductive methods to manipulate
expressions in the formalism. If the description (object, properties,
relations) of a problem situation is complete the we can answer any
question by evaluation; deduction is unnecessary.

■ Representation formalism based on logic gives us the ability to


express many kind of generalization, even when we do not have a
complete description of the problem situation. Using deduction to
manipulate expression in the representation formalism allows us to ask
logically complex queries of a knowledge base containing such
generalization, even when we cannot "evaluate" a query directly.

■ AI inference systems, not based on automatic deduction technique,


but has a knowledge representation formalism that is capable
of handling the kinds of incomplete information, that people can
understand, must at least be able to say that something has a
certain property without saying which thing has that property.

Thus, any representation formalism that has these capabilities will be


an extension of classical first-order logic, and any inference system that
can deal adequately with these kinds of generalization will have to have
at least the capabilities of an automatic-deduction system.
14
fo
.in
rs
de
AI - Common Sense: Formalization of reasoning

ea
• Need for Specific Control Information

yr
.m
w
w
■ The difficulties with domain-independent problem solver on
,w
ty
or

automatic-deduction techniques is that many possible inferences


ab
kr

can be drawn at any one time. Finding relevant inferences to a


ha
C
C

particular problem can be impossible, unless domain-specific guidance


R

is supplied to control the deductive process.


■ In search processes, information about whether to use facts
in a forward-chaining or back-chaining manner for efficient system
performance. The deductive process can be bidirectional, partly
working forward from facts to new one, partly working backward
from goals to sub-goals, and meeting somewhere in between.
Early theorem-proving systems used every facts both ways,
leading to highly redundant searches. More sophisticated methods
can eliminated these redundancies.

15
fo
.in
rs
de
AI - Common Sense: Formalization of reasoning

ea
• Logic Programming

yr
.m
w
w
■ One factor that can greatly affect the efficiency of deductive
,w
ty
or

reasoning is the way in which a body of knowledge is formalized.


ab
kr

Logically equivalent formalization can have radically different


ha
C
C

behavior when used with standard deduction techniques. This led


R

to the development of Logic programming and the creation of


a new languages such as Prolog.
■ Prolog combines the use of logic as a representation language
with efficient deduction technique, based on backward inference
process (goal directed) which allows to consider a set of formulas
as program. Prolog is now most widely used logic programming
language. Originally logic programming was conceived as a subset
of classical logic, it was soon extended with some non-classical
features, in particular negation as failure. Prolog tries to prove p;
if p can not be proved , then the goal not p succeeds, and
vice versa. This simple feature of Prolog has been used to achieve
non-monotonic behavior.

• Automatic deduction in nonstandard logics


■ The classical first-order logic is the most general logic for which

automatic-deduction techniques are well developed. However,


many commonsense concepts, are treated in nonstandard,
either higher-order or non-classical logics. This presents a problem
and require reformulating representation in nonstandard logics in
terms of logically equivalent representations in classical first-order
logic. One type of nonstandard logic that has received much attention
is non-monotonic logic.

16
fo
.in
rs
de
AI - Common Sense: Formalization of reasoning

ea
[Continued from previous slide]

yr
.m
w
w
Note : The approaches to the representation formalism for
,w
ty

commonsense reasoning are mentioned in the previous few slides.


or
ab
kr

However, in our previous lectures on "Knowledge Representation"


ha
C
C

and "Reasoning System", the slides illustrated with example each of


R

these approaches. The following were covered :


- Logic as a KR Language for Reasoning - a formal system in which the

formulas or sentences have true or false values.


- Propositional Logic (PL) - a declarative sentence either TRUE or FALSE.

- Predicate Logic Quantifiers - to make a statement about a collection


of objects and to state that an object does exist without naming it.
- Resolution – a procedure, produces proofs by refutation or
contradiction.
- KR Using Rules - production rules, semantic net and frames; forward
and backward reasoning - ways to generate new knowledge.
- Logic Programming - a formalism for specifying a computation in
terms of logical relations, Prolog program,
- Non-monotonic logic – where the truth of a proposition may change

when new information (axioms) are added.


17
fo
.in
rs
de
AI - Common Sense: Physical world

ea
3. Physical World

yr
.m
w
w
People know a great deal about how the physical world works.
,w
ty
or

Most people, have no notion of the "laws of physics" that govern


ab
kr
ha

this world, yet they


C
C
R

- can predict that a falling ball will bounce many times before come to halt.

- can predict the projection of cricket ball and even catch it.

- know a pendulum swings back and fore finally coming to rest in the middle.

How can we build a computer program to do such reasoning ?

One answer is to program the equations governing the physical motion


of the objects. But most people do not know these equations and also
do not have exact numerical measures, yet they can predict what will
happen in physical situations. This means people seem to reason more
abstractly that the equations would. Here comes qualitative physics,
to understand how to build and reason with abstract, number
less representation.

Researchers are therefore motivated towards :


ƒ Modeling the qualitative World and
ƒ Reasoning with qualitative information

18
fo
.in
rs
de
AI - Common Sense: Physical world

ea
• Modeling the Qualitative World

yr
.m
w Qualitative physics seeks to understand physical processes by building
w
,w
ty

models that may have following entities:


or
ab
kr
ha

Variables A restricted set of values,


C
C
R

e.g. temperature as { frozen, between, boiling }.

Quantity Spaces A small set of discreet values.

Rate of Change Values at different times, modeled qualitatively,


e.g. { decreasing, steady, increasing }.

Expressions Combination of variables.

Equations Assignment of expression to variables.

States Sets of variables, whose values change over time.

19
fo
.in
rs
de
AI - Common Sense: Physical world

ea
• Example : Qualitative Algebra - addition

yr
.m
w
w
Describe the volume of glass as {empty, between, full } .
,w
ty
or

When two qualitative values are added together then :


ab
kr

empty + empty = empty


ha
C
C
R

empty + between = between

empty + full = full

between + between = { between, full, overflow }

between + full = { between, over flow }

full + full = { full, over flow }

20
fo
.in
rs
de
AI - Common Sense: Physical world

ea
• Reasoning with Qualitative Information

yr
.m
w
w
Reasoning with qualitative information is often called qualitative
,w
ty
or

simulation. The basic idea is :


ab
kr
ha
C

‡ Construct a sequence of discrete episodes that occur as qualitative


C
R

variable.

‡ States are linked by qualitative rules that may be general.

‡ Rules may be applied to many objects simultaneously as they may


all influence each other.

‡ Ambiguity may arise so split outcomes into different paths.

‡ A network of all possible states and transitions for a qualitative


system is called an envisionment (mental images). There are
often many paths through an envisionment. Each path is called history.

‡ Programs must know how to represent the behavior of many kinds


of processes, materials and the world in which they act.
21
fo
.in
rs
de
AI - Common Sense: Ontologies

ea
4. Common Sense Ontologies

yr
.m
w
w
Some concepts are fundamental to common sense reasoning.
,w
ty
or

A computer program that interacts with the real world must be able
ab
kr

to reason about things like time, space and materials. On each of these,
ha
C
C

here some thought is presented. [Details with examples are available in the text
R

book - “Artificial Intelligence", by Elaine Rich and Kevin Knight]

• Time
The most basic notion of time is events. Events occur during intervals
over continuous spaces of time. An interval has a start and end point
and a duration between them.

Intervals can be related to one another as :


is-before, is-after, meets, is-met-by, starts, is-started-by,
during, contains, ends, is-ended-by and equals.

We can build a axioms with intervals to describe events in time.


22
fo
.in
rs
de
AI - Common Sense: Ontologies

ea
• Space

yr
.m
w The Blocks World is a simple example of what we can model and
w
,w
ty

describe space. However common sense notions such as :


or
ab

place object x near object y


kr
ha
C

are not accommodated.


C
R

Objects have a spatial extent while events have a temporal extent.


We may try to extend of common sense theory of time. But, space
is 3D and has many more relationships than those for time so it is
not a good idea.

Another approach is view objects and space at various levels of


abstraction. For example, we can view most printed circuit boards
as being a 2D object.

Choosing a representation means selecting relevant properties at


particular levels of granularity. For instance we can define relations
over spaces such as inside, adjacent etc. We can also define relations
for curves, lines, surfaces, planes and volumes. e.g. along, across,
perpendicular etc.
23
fo
.in
rs
de
AI - Common Sense: Ontologies

ea
• Material

yr
.m
w Describe the properties of materials as :
w
,w
ty

‡ You cannot walk on water.


or
ab
kr

‡ If you knock a cup of coffee over what happens?


ha
C
C
R

‡ If you pour a full kettle into a cup what happens?

‡ You can squeeze a sponge but not a brick.

The Liquids provide many interesting points, such as, the space
occupied by them. Thus we can define their properties such as:
‡ Capacity - a bound to an amount of liquid.

‡ Amount - volume occupied by a liquid.

‡ Full - if amount equals capacity.

Other properties that materials can posses include:


‡ Free - if a space is not wholly contained inside another object.

‡ Surround - if enclosed by a very thin free space.

‡ Rigid

‡ Flexible

‡ Particulate - e.g. sand

24
fo
.in
rs
de
AI - Common Sense: Memory

ea
5. Memory Organization

yr
.m
w
w
Memory is central to common sense behavior and also the basis for
,w
ty
or

learning. Human memory is still not fully understood however


ab
kr

psychologists have proposed several ideas.


ha
C
C
R

■ Short term memory (STM) :


Only a few items at a time can be held here;
perceptual information are stored directly here.

■ Long term memory (LTM) :


Capacity for storage is very large and fairly permanent;
LTM is often divided further as :

‡ Episodic memory :
Contains information about personal experiences.

‡ Semantic memory :
General facts with no personal meaning, e.g. Birds fly;
useful in natural language understanding.
25
fo
.in
rs
de
ea
yr
.m
AI - Common Sense - References
w
w
6. References : Textbooks
,w
ty
or

1. "Artificial Intelligence", by Elaine Rich and Kevin Knight, (2006), McGraw Hill
ab
kr

companies Inc., Chapter 19, page 529-545.


ha
C
C

2. "AI: A New Synthesis", by Nils J. Nilsson, (1998), Morgan Kaufmann Inc., Chapter
R

18, Page 301-314.

3. Related documents from open source, mainly internet. An exhaustive list is


being prepared for inclusion at a later date.

26

You might also like