knowledge representation - university of babylon representation knowledge representation is an...

45
Knowledge Representation Dr. Asaad Sabah Hadi 1

Upload: ngoxuyen

Post on 01-Apr-2018

236 views

Category:

Documents


2 download

TRANSCRIPT

Knowledge Representation

Dr. Asaad Sabah Hadi

1

Knowledge Representation

Knowledge representation is an essential problem of symbolic-based artificial intelligence

In symbolic functionalism we represent intelligence via manipulation of our beliefs about the surrounding world and knowledge we know.

Therefore we have to address two fundamental issues

– How to represent knowledge ?

– How to implement the process of reasoning ?

State space is a space of possible courses of inference when

combining

– actual beliefs about current world

– general knowledge

– rules of inference

The Knowledge Level

Three levels of the Knowledge-based System conceptualization:

- system engineering level – physical realization of the

system

- symbol level – symbol system (program ) specification

- knowledge level – knowledge (to be represented)

specification

Knowledge Level Hypothesis

– There is a distinct computer level lying immediately above

the program (symbol level), which is characterized by

knowledge as the medium and principle of rationality as the

law of behavior.

AI research × Software

Engineering

Knowledge Level

Symbol Level System Level

Intelligent Behaviour

Requirements Specification

Functional Specification

System Implementation

What is Knowledge?

data – primitive verifiable facts, of any representation. Data

reflects current world,often voluminous frequently changing.

information – interpreted data

knowledge – relation among sets of data (information), that is

very often used for further information deduction. Knowledge is

(unlike data) general. Knowledge contains information about

behavior of abstract models of the world.

Knowledge Classification:

– according to source: empirical, theoretical

– according to orientation: domain, heuristic, inference

– according to type: declarative, procedural

Knowledge Representation

Schemas

Logic based representation – first order predicate

logic, Prolog

Procedural representation – rules, production

system

Network representation – semantic networks,

conceptual graphs

Structural representation – scripts, frames, objects

Mathematical Logic

Propositional Logic –

– syntactical primitives: , , , , symbols, true, false

– rule of inference: de Morgan rule, modus ponens, …

– semantic interpretation

rains blows-wind sun-will-shine

First Order Predicate Logic –

– enriched by variables, predicates, functions

– quantifiers ,

friends(father(david),father(andrew))

Y friends(Y, petr)

X likes(X,ice_cream)

X Y Z parent(X,Y) parent(X,Z) siblings(Y,Z)

Mathematical Logic cont’

inference representation – proof system

rules of inference – example: modus ponens

– if p is true and p q is true, then mp infers q to be true

X(man(X) mortal(X))

man(socrates)

(man(socrates) mortal(socrates))

mortal(socrates)

rules of inference can be

– sound if all conclusions the rule infers logically follows

– complete if it infers all conclusions that logically follows

modus ponens is sound but not complete

Mathematical Logic cont’

inference representation – resolution theorem proving

– transform the knowledge system into clausal normal form (conjunction

of disjunction of literals)

– add negation of what has to be proved

– keep resolve new disjuncts unless you produce an empty set

dog(X) animal(X) dog(X) animal(X)

(dog(X) animal(X)) (animal(Y) die(Y))

(dog(fido)))

(die(fido) 4

-----------------------

(dog(Y) die(Y)) 1+2

(die(fido)) 1+2+3

1+2+3+4

1 2 3

Logic Based Financial Advisor

savings(inadequate) investment(savings)

savings(adequate) income(adequate) investment(stocks)

savings(adequate) income(inadequate)

investment(combined)

X saved(X) Y dependents(Y) greater(X,5000*Y)

savings(adequate)

X saved(X) Y dependents(Y) greater(X, 5000*Y)

savings(inadequate)

X earnings(X,steady) Y dependents(Y) greater(X,(15000+(4000*X)) income(adequate)

X earnings(X,steady) Y dependents(Y) greater(X,(15000+(4000*X)) income(inadequate)

X earnings(X,unsteady) income(inadequate)

saved(22000)

earnings(25000,steady)

dependents(3)

prolog code example

Production System

procedural representation of knowledge

in the form of if – then rules

inference mechanism is firing the rules

subject of Expert System lecture

‘jug problem’ example

if small=0 then

small=3

if big=0 and small=3 then

big=3 and small= 0

5l 3l

Conceptual Graphs

network knowledge representation schema

rooted in association theory of meaning

very much used in the problem of natural language processing

Conceptual Graph is complete bipartite oriented graph, where

each node is either a concept or a relation between two

concepts, there is one or two edges each going to concepts,

and each concept may represent another conceptual graph

dog brown colour

Conceptual Graphs

A monkey scratches its ear with a paw

monkey scratch agent object ear

instrument

paw part of

part of

Conceptual Graphs

each concept has got its type and an instance

general concept – a concept with a wildcard instance

specific concept – a concept with a concrete instance

there exists a hierarchy of types subtype:

concept w is specialisation of concept v if type(v)>type(w) or instance(w)::type(v)

dog:Emma brown colour

dog:*X brown colour

animal

dog cat

Conceptual Graphs

canonic conceptual graph is sensible representation of

knowledge that can be but does not necessary need to be true

canonic formation rules formalise rules of inference between

two graph for while preserving canonicity

– copy – identical cloning of a graph

– restriction – substituting a concept in a graph with its

specialisation

– join – joining two graphs via shared concept

– simplification – deleting identical relations

Restriction of Concepts

person eat agent object pie pie pie pie pie pie pie

girl eat agent object pie pie pie pie pie pie pie

person:Sue eat agent object pie pie pie pie pie pie pie

girl:Sue eat agent object pie pie pie pie pie pie pie

person

Joining Concepts

person eat agent object pie pie pie pie pie pie pie girl:Sue

person eat agent manner pie pie pie pie pie pie fast girl:Sue

person eat

agent object pie pie pie pie pie pie pie

agent manner fast

Simplification of Concepts

person eat

agent object pie pie pie pie pie pie pie

agent manner fast

person eat agent

object pie pie pie pie pie pie pie

manner fast

Conceptual Graphs

FOPL transformation to CG

– for each node predicate

– general concept variable, specific concept atom

type:instance type(instance)

– relation n-ary predicat relation(in1, in2, …, inn) with

arguments conncecting neighbouring concepts

– CG is existencionally quantified conjunction of these

predicates

X (dog(emma) color(emma,X)

brown(X))

dog:Emma brown colour

Frames

instance of structured representation (schemes)

static data-structure representing stereotyped situation

predecessor of object-oriented systems

hotel bed superclass:bed use:sleeping size:king part:mattress frame

mattress superclass:cushion firmness:firm

hotel room special of:room location:hotel contains: hotel chair hotel phone hotel bed hotel phone

special of:phone use: calling room service billing: through room

hotel chair special of:chair legs:four use:sitting

• default slots

• daemons – procedural

attachment (infoseek)

Scripts

Schank’s formalisation of stereotyped sequence of

events in a particular context

knowledge base representation in terms of the

situations that the system is supposed to understand

a restaurant script

Decision Trees

Related to tables

Similar to decision trees in decision theory

Can simplify the knowledge acquisition process

Knowledge diagramming - very natural

22

O-A-V Triplet

Objects, Attributes and Values

O-A-V Triplet

Objects may be physical or conceptual

Attributes are the characteristics of the objects

Values are specific measures of the attributes

23

24

Representative O-A-V Items

Object Attributes Values

House Bedrooms 2, 3, 4, etc.

House Color Green, white, brown,

etc.

Admission to a

university

Grade-point average 3.0, 3.5, 3.7, etc.

Inventory control Level of inventory 14, 20, 30, etc.

Bedroom Size 9 X 10, 10 X 12, etc.

25

Default Logic

Deals with uncertainties

Incomplete information

Knowledge Maps

Visual representation

Cognitive maps

Semantic Networks

Graphic Depiction of Knowledge

Nodes and Links Showing Hierarchical

Relationships Between Objects

Nodes: Objects

Arcs: Relationships

– is-a

– has-a

26

Semantic networks can show inheritance

Semantic Nets - visual representation of

relationships

Can be combined with other representation

methods

27

Semantic Network Example

28

Joe

Boy

Kay

Woman

Food

Human

Being

School

Has

a child

Needs Goes to

Production Rules

Condition-Action Pairs

– IF this condition (or premise or antecedent) occurs,

– THEN some action (or result, or conclusion, or

consequence) will (or should) occur

– IF the stop light is red AND you have stopped,

THEN a right turn is OK

29

Each production rule in a knowledge base

represents an autonomous chunk of expertise

When combined and fed to the inference

engine, the set of rules behaves

synergistically

Rules can be viewed as a simulation of the

cognitive behavior of human experts

Rules represent a model of actual human

behavior

30

Forms of Rules

IF premise, THEN conclusion

– IF your income is high, THEN your chance

of being audited by the IRS is high

Conclusion, IF premise

– Your chance of being audited is high, IF

your income is high

31

Inclusion of ELSE

– IF your income is high, OR your deductions are

unusual, THEN your chance of being audited by the

IRS is high, OR ELSE your chance of being audited

is low

More Complex Rules

– IF credit rating is high AND salary is more than

$30,000, OR assets are more than $75,000, AND pay

history is not "poor," THEN approve a loan up to

$10,000, and list the loan in category "B.”

– Action part may have more information: THEN

"approve the loan" and "refer to an agent"

32

Knowledge and Inference Rules

Common Types of Rules

Knowledge rules, or declarative rules, state all the

facts and relationships about a problem

Inference rules, or procedural rules, advise on how to

solve a problem, given that certain facts are known

Inference rules contain rules about rules (metarules)

Knowledge rules are stored in the knowledge base

Inference rules become part of the inference engine 33

Advantages of Rules

Easy to understand (natural form of knowledge)

Easy to derive inference and explanations

Easy to modify and maintain

Easy to combine with uncertainty

Rules are frequently independent

34

Limitations of Rules

Complex knowledge requires many rules

Builders like rules (hammer syndrome)

Search limitations in systems with many

rules

35

Frames

Definitions and Overview

Frame: Data structure that includes all the

knowledge about a particular object

Knowledge organized in a hierarchy for

diagnosis of knowledge independence

Form of object-oriented programming for AI

and ES.

Each Frame Describes One Object

Special Terminology 36

37

Frame Terminology

Default Instantiation

Demon Master frame

Facet Object

Hierarchy of

frames

Range

If added Slot

If needed Value (entry)

Instance of

Decision Support Systems and Intelligent Systems, Efraim Turban and Jay E. Aronson

6th ed, Copyright 2001, Prentice Hall, Upper Saddle River, NJ

Concise, natural, structural representation of

knowledge

Encompasses complex objects, entire situations or a

management problem as a single entity

Frame knowledge is partitioned into slots

Slot can describe declarative knowledge or procedural

knowledge

Major Capabilities of Frames

Typical frame describing an automobile

Hierarchy of Frames: Inheritance

38

39

Frame Capabilities

Ability to clearly document information about a domain model; for example,

a plant's machines and their associated attributes

Related ability to constrain the allowable values that an attribute can take on

Modularity of information, permitting ease of system expansion and

maintenance

More readable and consistent syntax for referencing domain objects in the

rules

Platform for building a graphic interface with object graphics

Mechanism that will allow us to restrict the scope of facts considered during

forward or backward chaining

Access to a mechanism that supports the inheritance of information down a

class hierarchy

Multiple Knowledge

Representations

Rules + Frames

Others

Knowledge Representation Must Support

Acquiring knowledge

Retrieving knowledge

Reasoning

40

Considerations for Evaluating a

Knowledge Representation

Naturalness, uniformity and understandability

Degree to which knowledge is explicit

(declarative) or embedded in procedural code

Modularity and flexibility of the knowledge base

Efficiency of knowledge retrieval and the

heuristic power of the inference procedure

41

No single knowledge representation method

is ideally suited by itself for all tasks

Multiple knowledge representations: each

tailored to a different subtask

Production Rules and Frames works well in

practice

Object-Oriented Knowledge Representations

– Hypermedia

42

Representing Uncertainty:

An Overview

Dealing with Degrees of Truth, Degrees of Falseness

in ES

Uncertainty

– When a user cannot provide a definite answer

– Imprecise knowledge

– Incomplete information

43

Uncertainty

Several Approaches Related to

Mathematical and Statistical Theories

Bayesian Statistics

Dempster and Shafer's Belief Functions

Fuzzy Sets

44

Relevant Information is Deficient

in One or More

Information is partial

Information is not fully reliable

Representation language is inherently imprecise

Information comes from multiple sources and it

is conflicting

Information is approximate

Non-absolute cause-effect relationships exist

Can include probability in the rules

IF the interest rate is increasing, THEN the price

of stocks will decline (80% probability)

45