knowledge representation - comp.utm.my · knowledge representation and search introduction to ai...

48
Knowledge Representation (Topic 6)

Upload: vukhue

Post on 08-Sep-2018

233 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Knowledge

Representation

(Topic 6)

Page 2: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Course Contents

Again..Selected topics for our course. Covering all of AI is impossible!

Key topics include:

Introduction to Artificial Intelligence (AI)

Knowledge Representation and Search

Introduction to AI Programming

Problem Solving Using Search

Exhaustive Search Algorithm

Heuristic Search

Techniques and Mechanisms of Search Algorithm

Knowledge Representation Issues and Concepts

Strong Method Problem Solving

Soft Computing and Machine Learning

Page 3: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Knowledge Representation

• Definition

• Categories of AI Representation

• Issues in Knowledge Representation

• Semantic Network

• Frames

• Conceptual Graph

• Agent-based

Page 4: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Representation? • 'A representation is a set of conventions about how to

describe a class of things. A description makes use of

the conventions of a representation to describe some

particular thing.' (Winston 1992:16).

• 'Good representations make important objects and

relations explicit, expose natural constraints, and bring

objects and relations together' (ibid: 45)

• The representation principle:

– Once a problem is described using an appropriate

representation, the problem is almost solved.

Page 5: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

4 Categories of AI Representation

Mylopoulos and Levesque (1984)

• Logical representation schemes

– formal logic (covered)

• Procedural representation schemes

– Production rule system (covered)

• Network representation schemes

– Semantic network

• Structured representation schemes

– frames

Page 6: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Issues - Knowledge Representation

• You need to represent a problem to solve

it on a computer.

• Implement into intelligent systems thru :

– Representation scheme (like data structures,

explicit structure for knowledge

representation)

– Representation medium (like programming

languages, i.e. PROLOG, LISP,C++,Java)

Page 7: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

STRUCTURED REPRESENTATION

SCHEMES

SEMANTIC NETWORKS

Page 8: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

KR: Semantic Network

• Graph- explicitly representing relations using arcs

and nodes; formalizing knowledge

• Semantic network

– represents knowledge as a graph

– with nodes corresponding to facts or concepts

– and arcs correspond to relations between concepts

– Represented as pairs of object and value linked by

attribute

– Eg. Figure 1(canary-bird) and Figure 2(snow-ice)

Page 9: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Figure 1: Semantic network developed by Collins and Quillian in their research

on human information storage and response times (Harmon and King 1985).

•Knowledge

organization

•Inheritance

systems allow:-

-storing knowledge

at highest level of

abstraction

-reduce size of

knowledge base

-help prevents

update

inconsistencies

Page 10: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Figure 2: Network representation of properties of snow and ice

•Semantic network can

be used to:-

-answer questions

about snow,ice and

snowmen(with

appropriate inference

rules)

-References are made

by following links to

concept

-implement inheritance

i.e. frosty inherits all

properties of snowman

Page 11: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Construct a semantic network with this information, along

with exceptions (where necessary).

Mammals are warm-blooded. Mammals have 4 legs.

Tigers eat meat. Tigers are mammals. Tigers are dangerous.

Hobbs is a tiger. Hobbs is not dangerous.

Raja is a tiger. Raja has three legs.

Using this hierarchy, answer the following.

(a) Which are the dangerous tigers?

(b) How many legs does Raja have?

(c) How many links have to be traversed in the hierarchy to check

if Hobbs is warm-blooded?

(d) Are all mammals dangerous?

(e) What facts can you deduce about Raja from the hierarchy?

Page 12: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Three planes representing three definitions of the word “plant” (Quillian

1967).

•A program defined

English word

•Each definition leads to

other definition in

unstructured or circular

fashion

•Looking up a word, the

network is traversed until

the word is understood

•Knowledge-based is

organized into planes,

each explains single

word

•i.e. 3 planes capture

definitions of ‘plant’-living

organism,work place or

putting seed in ground

Page 13: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Intersection path between “cry” and “comfort” (Quillian 1967).

•Knowledge-based is used

to find relationships

between pairs of english

word

•Given two words, it would

search graphs outward

from each word in breadth-

first fashion, searching for

intersection-node

Page 14: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

STRUCTURED REPRESENTATION

SCHEMES

FRAMES

Page 15: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

KR:Frames

• Another representational scheme

• Implicit connection of information

• Static data structure to represent well-

understood stereotyped situations

• Organize our knowledge of the world

• We adjust to new situation by calling up

information structure by past experience

• We then revise details of past experiences to

represent differences in new situation

Page 16: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Frames : Features

Page 17: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

How frames are organised

• A frame system is a hierarchy of frames

• The idea of frame hierarchies is very similar to the

idea of class hierarchies found in object-orientated

programming.

• Each frame has: – a name.

– slots: these are the properties of the entity that has the name, and they have values. A particular value may be:

• a default value • an inherited value from a higher frame • a procedure, called a daemon, to find a value • a specific value, which might represent an exception.

Page 18: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Part of a frame description of a hotel room. “Specialization” indicates a

pointer to a superclass.

•Hotel room and its

components are described

by number of individual

frames

•Each frame may be seen

as data structure

•Contains info relevant to

stereotyped entities

•Frame systems support

class inheritance

Eg.

Procedural

attachment

Page 19: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Spatial frame for viewing a cube (Minsky 1975).

•This frame system

represents four of faces

of cube

•Broken line indicates

face out of view from

that perspective

•Links between frames

indicate relations

between views

represented by frames

•Each slot in one frame

could be a pointer to

another entire frame

•Since given information

can fill many different

slot (face E), No

redundancy in

information stored

•Frames allow complex objects to be represented as

a single frame rather than large network structure

Page 20: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

QUIZ:

Represent the following as a set of frames.

The aorta is a particular kind of artery which

has a diameter of 2.5cm. An artery is a kind of

blood vessel. An artery always has a muscular

wall, and generally has a diameter of 0.4cm. A

vein is a kind of blood vessel, but has a fibrous

wall. Blood vessels all have tubular form and

contain blood.

Page 21: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

MODERN REPRESENTATION

SCHEMES

CONCEPT GRAPHS and

AGENTS

Page 22: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Conceptual Graphs

• Example of a network representation language

• A finite, connected graph

• Nodes are either: – concepts or

– conceptual relations

– No labeled arcs

– Conceptual relation nodes=relations between concepts

– i.e. (dog and brown ~ concept nodes)

– i.e. (color ~ conceptual relation)

Page 23: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Conceptual relations of different arities.

Conceptual

nodes

Conceptual

relation

Parents is a 3-ary relation

•Each conceptual

graph represents a

single proposition

•A typical knowledge-

base contains several

graphs

•Graph must be finite

•i.e. a dog has a color

of brown

•Conceptual graphs are

used to model

semantics of natural

language

Page 24: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Graph of “Mary gave John the book.”

•The graph uses conceptual relations to represent cases of the verb ‘to give’

•Conceptual graphs used to model semantics of natural language

•Every concept is a unique individual of a particular type, separated by :

type ind

Page 25: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Conceptual graph indicating that the dog named emma is brown.

Conceptual graph indicating that a particular (but unnamed) dog is brown.

Conceptual graph indicating that a dog named emma is brown.

Graph

1= 3

Page 26: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Conceptual graph of a person with three names.

#

marker

# Marker

• is unique and different from names

•Individual has many names but one marker

•different individuals may have same name, but not same marker

Page 27: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Conceptual graph of the sentence “The dog scratches its

ear with its paw.”

•To summarize: each concept node indicates individual of specified type

•This individual is the referent of the concept

•Individual concept ~referent uses individual marker

•Generic concept ~ referent uses generic marker

*Generic marker

-Unspecified

individual

Page 28: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Generalization and Specialization:

Examples of restrict, join, and simplify operations

Conceptual graph

includes operations

creating new graphs

from existing ones:

-specializing or

generalizing existing

graph to represent

semantics of natural

language:-

1)Copy-exact copy of

graph

2)Restrict-replace

concept nodes with

specialized note:

• generic marker

replace individual

marker

•Replace type with

subtypes; animal ->

dog

Page 29: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

3)Join- combine 2 graphs into single one

• If concept node c1 and c2 identical, delete c2; c1 replace c2

• Specialization- produce less general graph

4)Simplify-if graph has duplicate relations, delete one together with its arcs

• Occur after join operation

Generalization and Specialization: Examples of restrict, join, and

simplify operations

Ж restrict ~ match two concepts

Ж join and restrict ~ allow

implementation of inheritance

Page 30: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Conceptual graph of the proposition “There are no pink dogs.”

To represent negation or disjunction-

variable quantification

(universal quantifier (for all) and

existential quantifier (there exist)

neg – takes argument as proposition

concept and assert that concept as false

In conceptual graph, generic concepts are

assumed to be existentially quantified

Eg. Translations

X Y (dog(X) color(X,Y) brown(Y)

==> existential quantifier

X Y ( (dog(X) color(X,Y) pink(Y)))

==> universal quantifier

Eg. Translation

X1 (dog(emma) color(emma, X1)

brown(X1))

There is straight mapping

from conceptual graph into

predicate calculus notation

(Sowa,1984)

Advantage of conceptual

graph – support some special-

purpose inferencing

mechanisms such as join and

restrict, not normally part of

predicate calculus

Page 31: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

On a piece of paper , answer the questions below and submit

•Translate the two conceptual graphs into English

• Translate the two conceptual graphs into predicate calculus

Page 32: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Agent-based Representation

• Definition:

Agent ~ agent-based-system ~ multi-agent

system

multi-agent :- a comp program with problem

solvers situated in interactive environments,

capable of flexible, autonomous and socially

organized actions.

Page 33: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Definition of agent

• An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators

• Human agent: eyes, ears, and other organs for sensors;

Hands,legs, mouth, and other body parts for actuators

• Robotic agent: cameras and infrared range finders for sensors;

various motors for actuators

Page 34: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Definition of agent in CS and AI

• Generally, an agent is one who acts for, or in the place of, another,

by authority from him; one entrusted with the business of another.

• Agent architecture, blueprint for software agents and intelligent

control systems, depicting the arrangement of components

• Agent-based model, computational model for simulating the actions

and interactions of autonomous individuals with a view to assessing

their effects on the system as a whole. It consists of agents that

interact within an environment.

• Intelligent agent, autonomous entity which observes and acts upon

an environment and directs its activity towards achieving goals

• Software agent, piece of software that acts for a user or other

program in a relationship of agency

– Forté Agent, email and Usenet news client used on the Windows

operating system

– User agent, the client application used with a particular network

protocol

Page 35: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Example of network agent

• The following example shows how to define a network agent workstation for

a remote network, Network A, that allows local network,Network B, to use

jobs and job streams in the remote network as internetwork dependencies.

• A network agent workstation named NetAgt, defined on MasterB to manage

internetwork dependencies on jobs or job streams defined inNetwork A

Master

A

Master

B Network

agent

A network agent workstation named NetAgt, defined on MasterB to manage internetwork dependencies on jobs or job streams defined inNetwork A

Remote network

Master A

Local Network

Master B

Page 36: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Agents and environments

• The agent function maps from percept histories to actions:

[f: P* A]

• The agent program runs on the physical architecture to produce f

• agent = architecture + program

Page 37: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Rational agents

• Rationality is distinct from omniscience (all-knowing with infinite knowledge)

• Agents can perform actions in order to modify future percepts so as to obtain useful information (information gathering, exploration)

• An agent is autonomous if its behavior is determined by its own experience (with ability to learn and adapt)

Page 38: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

PEAS

• Must first specify the setting for intelligent agent design

• Consider, e.g., the task of designing an automated taxi driver:

– Performance measure: Safe, fast, legal, comfortable trip, maximize profits

– Environment: Roads, other traffic, pedestrians, customers

– Actuators: Steering wheel, accelerator, brake, signal, horn

– Sensors: Cameras, sonar, speedometer, GPS, odometer, engine sensors, keyboard

Page 39: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Intelligent Agent

4 criteria of intelligent agent

Situated, autonomous, flexible and social

Page 40: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Criteria 1: Situatedness

Means agent receives input from environment

in which it is active and can also effect

changes within that environment

i.e. situations like internet, game playing,

robotic situation

i.e. ROBOCUP competition – agent interact

with ball and opponent

Agents : Criteria (1)

Page 41: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Agents : Criteria (2)

Criteria 2 – autonomous

Can interact with its environment without

direct intervention of other agents

Control over its own action

Can also learn from experience to improve

performance

i.e. ROBOCUP – agent pass the ball to a

teammate or kick on goal depending on its

situation

Page 42: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Agents : Criteria (3)

Criteria 3 – flexible

Intelligently responsive – receive stimuli from its environment and responds to them in an appropriate and timely fashion

proactive – not simply responsive but able to be opportunistic, goal directed and have appropriate alternatives for various situations

i.e. soccer agent –change its dribble depending on the challenge pattern of opponent

Page 43: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Agents : Criteria (4)

Criteria 4: social

Interact with other software or human-agent

towards the goal

social dimension address difficult situation

i.e. ROBOCUP – to score a goal, how one

agent support another agent’s goal?

Page 44: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Multi-Agents

4 characteristics of multi-agent problem

solving (Jenning et. Al 1998)

1st – each agent has incomplete information

and capabilities to solve entire problem

2nd – no global system controller for entire

problem solving

3rd – knowledge and input data for the

problem is decentralized

4th – the reasoning process are asynchronous

Page 45: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Agents vs. Objects

Differences between OBJECTs and AGENTs

OBJECT

invoke methods on one another

defined as computational systems

with encapsulated state

have methods associated with

state

communicate by message passing

rarely exhibit control over own

behavior

AGENT

request action to be

perfomed

designed to have flexible

have own thread of controls

Page 46: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Agents : Applications (1)

manufacturing – manage orders, inventory, production sequence, manufacturing operations

automated control – controlling transportation system, spacecraft control and air traffic control

telecommunication – require real-time monitoring and management, i.e. network control and management, transmission and switching

Page 47: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

Agents : Applications (2)

Transportation systems – distributed, situated and autonomous, i.e. coordinate carpooling and transport scheduling

Information management – i.e. internet , information filtering and info. Gathering like mail filtering

E-commerce – make buy and sell decisions i.e. shopping assistance, interactive catalogue

Interactive Games and Theater – i.e. war games, finance management scenarios or sport

Page 48: Knowledge Representation - comp.utm.my · Knowledge Representation and Search Introduction to AI Programming Problem Solving Using Search Exhaustive Search Algorithm ... LISP,C++,Java)

KR : Conclusion

• Intelligent software design skills are necessary to support agent prob solving technology in creating agent architecture, i.e.

– Representational requirements

– Search issues

– Planning

– Stochastic agents reasoning

– Learning..natural language understanding