Knowledge Representation Artificial Intelligence Lecture 5 Karim - - PowerPoint PPT Presentation

knowledge representation
SMART_READER_LITE
LIVE PREVIEW

Knowledge Representation Artificial Intelligence Lecture 5 Karim - - PowerPoint PPT Presentation

Knowledge Representation Artificial Intelligence Lecture 5 Karim Bouzoubaa Intelligence - K Every intellectual cognitive activity is definitely based on K Knowledge is power "The power of AI systems resides in the


slide-1
SLIDE 1

Knowledge Representation

Artificial Intelligence Lecture 5 Karim Bouzoubaa

slide-2
SLIDE 2

Intelligence - K

¢ Every intellectual cognitive activity is definitely based on K ¢ Knowledge is power ¢ "The power of AI systems resides in the knowledge"

slide-3
SLIDE 3

Connaissance

Nature & Types of K Reasoning Memory NLP Planification &

Problem Resolution

Learning

Knowledge

slide-4
SLIDE 4

Nature &Types of K

¢ Human beings accumulate billions of

'chunk' of knowledge, connected together and combined in different ways

l Knowledge about the world l Knowledge of specific areas l Knowledge about the human

slide-5
SLIDE 5

General and Specific Knowledge

Learn Reason

Planning

Perception Communication Acts

Communication Acts

Actions

Environment

Actions

Other entities

General AI Model

slide-6
SLIDE 6

Human Intelligence: a characteristic of the whole

¢ Everything is intimately linked: l The basic trio: Knowledge, Reasoning,

Memory (where knowledge is stored)

l Overlapping cognitive processes,

exploiting the basic trio: Learning, Planning & NLP

l The means of perception (the input /

  • utput channels)
slide-7
SLIDE 7

Operations on K

¢ At the basic level: use of operations to

compare and manipulate knowledge:

l Join two knowledge chunks l Find knowledge common to two

knowledge chunks

l Check if knowledge is contained in

another

l etc.

slide-8
SLIDE 8

Reasonings

¢ Inferring knowledge from other

  • knowledge. Take into account :

l Types of inference (deduction, induction,

abduction, analogy, etc.)

l Degree of certainty (knowledge) of

knowledge => approximate reasoning

l The temporal character of all knowledge

slide-9
SLIDE 9

Knowledge representation Major problem in AI

¢ The human being is intelligent because it is

a 'machine' which consumes and generates continually knowledge

¢ Important question for AI: how to represent

knowledge?

¢ The mode of representation has an impact

  • n any process that manipulates the

knowledge

slide-10
SLIDE 10

Knowledge representation The Declarative / Procedural Dilemma

¢ Procedural representation: compact but difficult

to present, extend, exploit, etc.

¢ Declarative representation: Independent

description of use, easy to extend and modify

slide-11
SLIDE 11

¢ A good system for the representation of complex K.

structures in a particular domain should possess the properties (Rich 1983):

l Representational Adequacy: the ability to represent all the

kinds of K. that are needed in that domain

l Inferential Adequacy: the ability to manipulate the

representational structures in such a way as to derive new structures corresponding to new K. inferred from old one

l Acquisitional Efficiency: the ability to acquire new

information easily. The most simplest case involves direct insertion, by a person, of new K. in the KB

What is a good representation?

slide-12
SLIDE 12

¢ A representation is a set of syntactic and

semantic conventions that make it possible to describe things

¢ The syntax of a representation specifies the

symbols that may be used and the ways those symbols may be arranged

¢ The semantics of a representation specifies how

meaning is embodied in the symbols and in the symbols arrangements allowed by the syntax

What is a representation?

slide-13
SLIDE 13

Formalisms to represent knowledge

¢ Propositional logic ¢ Predicate logic ¢ Frames ¢ Semantic network ¢ Conceptual Graph ¢ etc.

slide-14
SLIDE 14

Propositional logic

¢ We need a formal notation to represent knowledge

l Allowing automated inference and problem

solving

¢ One popular choice is to use logic ¢ Proposition logic is the simplest form of logic

l Symbols represent facts/propositions: p, q, etc. l We evaluate the truth value of a proposition l We don’t evaluate the meaning

slide-15
SLIDE 15

Propositional logic

¢ Simple propositions

l Example: earth is flat

¢ Composed propositions

l Example: earth is flat and earth is a planet

¢ Simple propositions are joined by logical

connectives (and, or, negation, implication)

l P ∧ Q; P ∨ Q ; Q → R, ¬S

¢ Given some statements in the logic we can

deduce new facts

slide-16
SLIDE 16

Propositional logic – Rules of Inference

¢ To derive true formulas from other true formulas, rules of

inference are needed

¢ In a sound theory, the rules of inference preserve truth ¢ If all formulas in the starting set are true, only true

formulas can be inferred from them.

¢ Some of the rules of inference for the propositional

calculus are as follows:

l Let symbols p, q and r represent any formula :

Modus Ponens: From p and p →q, derive q Modus Tollens: From ¬q and p → q, derive ¬ p

Hypothetical Syllogism: From p→q and q→r, derive p→r

Disjunctive Syllogism: From p ∨ q and ¬ p, derive q Conjunction: From p and q, derive p ∧ q

slide-17
SLIDE 17

Limits of Propositional Logic

¢ Meaning in propositional logic is context-

independent

l unlike natural language, where meaning depends on

context

¢ Limits of Propositional logic

l Propositional logic is not powerful enough as a general

knowledge representation language

l Impossible to make general statements l Example:

  • all students take exams
  • if any student take an exam, s/he either passes or fails
slide-18
SLIDE 18

Propositional Logic - Exercises

¢ Demonstrate that p → q is equivalent to ¬ (p ∧ ¬q)

l We have the succession of equivalences l p → q ⇔ ¬p ∨ q (implication elimination) l ¬ p ∨ q ⇔ ¬p ∨ ¬ ¬ q l ¬ p ∨ ¬ ¬ q ⇔ ¬(p ∧ ¬ q) (De Morgan)

slide-19
SLIDE 19

Formalisms to represent knowledge

¢ Propositional logic ¢ Predicate logic ¢ Frames ¢ Semantic network ¢ Conceptual Graph ¢ etc.

slide-20
SLIDE 20

Predicate Logic

¢ Whereas propositional logic assumes the world contains facts, first-

  • rder logic (like natural language) assumes the world contains

l Objects: people, houses, numbers, colors, wars, etc. l Relations: red, round, prime, brother of, part of, etc. ¢ In predicate logic the basic unit is a predicate/argument structure

called an atomic sentence:

l likes(ali, chocolate) l tall(zakaria)

¢ Arguments can be any of: l constant symbol, such as ‘ali’ l variable symbol, such as X l A function, such as sqrt(n) ¢ Examples:

l Likes(X, chocolate) l Friends(zakaria, youssef)

slide-21
SLIDE 21

Predicate Logic

¢ These atomic sentences can be combined using logic connectives

l likes(ali,chocolate) ∧ tall(zakaria) l tall(zakaria) → play(zakaria, basket-ball)

¢ Sentences can also be formed using quantifiers ∀ (for all) and ∃

(there exists) to indicate how to treat variables:

l ∀X (mortal(X)) Everything is mortal l ∃X (mortal(X)) Something is mortal l ∀X (on(X,earth)→ mortal(X)) Everything on earth is mortal

¢ We can have several quantifiers in an expression, such as:

l ∀X ∃Y ( father(X, Y) ) l ∀X ( expensive(X) → ∃Y ( wants(Y, X) ) )

¢ Here are identities common in predicate calculus:

l ∃X (P(X)) is identical to ¬∀x (¬P(X)) l ∀x (P(X)) is identical to ¬∃x (¬P(X))

slide-22
SLIDE 22

Predicate Logic

¢ We can define inference rules allowing us to say that if certain things

are true, certain other things are sure to be true, e.g.

∀ X (P(X) →Q(X)) P(aa)

  • ---------------- (so we can conclude)

Q(aa)

¢ This involves matching P(X) against P(aa) and binding the variable X

to the symbol aa

¢

∀x (Chinois(x) → Pere(Mao, x)) ∧ Chinois(Ching) → Pere(Mao, Ching)

¢ Example: What can we conclude from the following?

∀ X Tall(X) → Strong(X) Tall(john) ∀ X Strong(X) → play(X, Boxe)

slide-23
SLIDE 23

Logique des Prédicats

¢ Represent in terms of predicates: l Ahmed gives Ali a book l Somebody gives a book to Ali l Jacques envoie un livre à Marie l Chaque homme se promène l Certains hommes se promènent l Aucun homme ne se promène l Jacques envoie quelque chose à chacun

Predicate Logic - Exercises

l gives (Ahmed, Ali, book33) l or ∃ x (gives(Ahmed, Ali, x) ∧ Book(x) ) l ∃y ∃x (Gives(y, Ali, x) ∧ Person(y) ∧ Book(x) ) l Envoi(jacque1, Marie4, Livre2) l ∀x (Homme(x) → Promener(x)) l ∃x (Homme(x) → Promener(x)) l ¬ (∃ x (Homme(x) → Promener(x))) l ∃y ∀x (Envoi(jacque1, x, y))

slide-24
SLIDE 24

¢ Propose a definition for GrandParentOf(x,y) ¢ Propose a definition for Ancestor(x,y,n)

l using Person(X), ParentOf(X,Y)

Predicate Logic - Exercises

GrandParentOf(x,y) ← Person(x) ∧ Person(y) ∧ ∃z ( Person(z) ∧ ParentOf(x,z) ∧ ParentOf(z,y) ) Ancestor(x,y,n) ← Person (x) ∧ Person (y) ∧ ∃z(Person(z)∧ ParentOf(z,y) ∧ Ancestor(x,z,n-1) ) Ancestor(x,y,1) ← Person (x) ∧ Person (y) ∧ ParentOf(x,y)

slide-25
SLIDE 25

Formalisms to represent knowledge

¢ Propositional logic ¢ Predicate logic ¢ Frames ¢ Semantic network ¢ Conceptual Graph ¢ etc.

slide-26
SLIDE 26

Frames

¢ Family of object-oriented languages ¢ Advantages of object-oriented languages: l Data abstraction l Modularity / Modifiability l reusability l Readability / Understanding l Heritage ¢ Language of frames: OO + procedural attachment ¢ Frames are prototypes for specifying K that are poorly described in

predicate calculus: typicality, default values, incomplete information.

slide-27
SLIDE 27

Frames

¢ In the language of frames: l An object = unit of K representing the prototype of a concept l A frame is a generic entity composed of attributes (slots) that

describe the different properties of the represented concept

¢ The set of frames is organized according to a hierarchy where each

  • bject is both a representation of the frames from which it is

derived and a generator of frames more specialized

¢ A frame has attributes whose various aspects are described by

declarative facets (trigger)

¢ A frame does not have its own behavior described by methods

slide-28
SLIDE 28

Frames

¢ Définition: x|DAY

l year : (y|INTEGER) l month: (when-filled (check MONTH)) l day : (when-filled (check-day)) l day-of-week : (to-fill (get-day-of-week))

¢ Instance : DAY 124

l self : (ELEMENT-OF DAY) l year : 1981 l month : 8 l day : 3 l day of week : MONDAY

slide-29
SLIDE 29

Formalisms to represent knowledge

¢ Propositional logic ¢ Predicate logic ¢ Frames ¢ Semantic network ¢ Conceptual Graph ¢ etc.

slide-30
SLIDE 30

Semantic Networks (RS) Conceptual Graphs (GC)

¢ Exploit the connectivity of a graph to

represent the connectivity between the concepts:

l Often, a situation is described by a conjunction

  • f predicates that share common arguments

l Connectivity is implicit in the predicate

formulation

¢ SN: set of concepts connected by relations

slide-31
SLIDE 31

Semantic network

¢ Semantic networks attempt to combine in a single

mechanism the ability to store factual K and to model the associative connections between information items exhibited by humans

¢ Network designation corresponds to the method

where the concepts are represented by nodes, and relations (in general binary) by labeled arcs

Ali eat apple person action food

e e e agent

  • bjet
slide-32
SLIDE 32

Inheritance via isa link

Semantic network Example

slide-33
SLIDE 33

Phrase 1 : Jacques écrit un livre, Phrase 2 : Jacques envoie ce livre à Marie Phrase 3 : Marie lit le livre. Sens et Contexte

Semantic network Example

slide-34
SLIDE 34

Semantic network Example

John hits Mary with a flower

¢ There is a problem with this

representation: There are 3 instances defined in the ‘fact base’: john, mary, flower33

¢ But what is ‘hits’ ? ‘hits’ should be

replaced by hit46, an instance of the generic action HIT (HIT is an action type)

¢ if we explicitly introduce all the

needed types, what is the new semantic network representing the sentence ‘John hits Mary with a flower’?

slide-35
SLIDE 35

Semantic network Example

slide-36
SLIDE 36

Formalisms to represent knowledge

¢ Propositional logic ¢ Predicate logic ¢ Frames ¢ Semantic network ¢ Conceptual Graph ¢ etc.

slide-37
SLIDE 37

Conceptual Graphs

¢ A formal language developed by John Sowa (IBM) ¢ Based on Semantic Networks ¢ Human readable ¢ CGs express logical precise meaning ¢ Suitable for representing natural language

slide-38
SLIDE 38

¢ Constituents of CGs l Two kinds of nodes

  • Concepts – boxes / [square brackets]

[Cat] [Mat]

Conceptual Graphs

slide-39
SLIDE 39

Conceptual Graphs

¢ Constituents of CGs l Two kinds of nodes

  • Concepts – boxes / [square brackets]
  • Conceptual relations – circles / (parentheses)

[Cat] (on) [Mat]

slide-40
SLIDE 40

¢ Constituents of CGs l Two kinds of nodes

  • Concepts – boxes / [square brackets]
  • Conceptual relations – circles / (parentheses)

l Arches between concepts and relations

  • CGs are bipartite graphs

[Cat]à(on)à[Mat]

Conceptual Graphs

slide-41
SLIDE 41

¢ Display form and linear form

[Cat]à(on)à[Mat] [graph:{*}]à(attr)à[conceptual]

Conceptual Graphs

Cat Mat

  • n

graph:{*} conceptual attr

slide-42
SLIDE 42

Conceptual Graphs

¢ Constituents of CGs

[Cat]à(on)à[Mat]

There exists a concept: ‘Cat’

slide-43
SLIDE 43

¢ Constituents of CGs

[Cat]à(on)à[Mat]

l There exists a concept: ‘Cat’

Conceptual Graphs

slide-44
SLIDE 44

¢ Constituents of CGs

[Cat]à(on)à[Mat]

l There exists a concept: ‘Cat’ and a concept ‘Mat’

Conceptual Graphs

slide-45
SLIDE 45

¢ Constituents of CGs

[Cat]à(on)à[Mat]

l There exists a concept: ‘Cat’ and a concept ‘Mat’* l And the cat is on the mat

Conceptual Graphs

slide-46
SLIDE 46

¢ Constituents of CGs

[Cat]ß(on)ß[Mat]

l There exists a concept: ‘Cat’ and a concept ‘Mat’* l And the mat is on the cat

Conceptual Graphs

slide-47
SLIDE 47

¢ Reading graphs

Conceptual Graphs

slide-48
SLIDE 48

¢ Reading graphs

Conceptual Graphs

slide-49
SLIDE 49

¢ Reading graphs

Conceptual Graphs

slide-50
SLIDE 50

¢ Reading graphs

Conceptual Graphs

slide-51
SLIDE 51

¢ Concept : [Type :Referent = Descr]

Conceptual Graphs

slide-52
SLIDE 52

¢ Concept : [Type :Referent = Descr]

Realise Project: ProjA Complex

agnt

  • bj

kind

In graphical notation

chrc Student : Fatima Head Service

  • bj

chrc

attr

Conceptual Graphs

slide-53
SLIDE 53

Conceptual Graph (CGIF)

¢ notation CGIF

(agnt r Fatima) (obj r ProjA) (agnt Fatima s) (obj s [Service]) (chrc ProjA [Complex]) (attr Fatima [kind])

slide-54
SLIDE 54

Logical Interpretation of a CG

¢ [Girl= Yasmine]←agnt-[love]-obj→[Dance]

∃x, ∃y ( Girl(Yasmine) ∧ love(x) ∧ Dance(y) ∧ agnt(x,Yasmine) ∧

  • bj(x,y) )
slide-55
SLIDE 55

composed CG (Linear Form)

¢ Ahmed thinks it is possible to write a good

Assembling program

[Person:Ahmed]←agnt-[think]-obj→[Proposition = [Status = Poss]←attr-[Proposition = [Person]←agnt-[wirte]-obj→[Program]-

  • attr→[good]
  • chrc→[Assembling]

] ]

In linear form

slide-56
SLIDE 56

Composed GCs

Man

Sit-down circular believe woman Color: white believe queen manufactured China glass crystal

slide-57
SLIDE 57

¢ Represent the sentence: “Ahmed gives Ali a book”

l using the graphical form l using the linear form l in Predicate calculus

¢ Represent using the graphical form of CGs the sentences:

l Mary buys a flower and John eats an apple l Ahmed believes Ali is walking in the park

¢ Represent using the graphical form of CGs the sentences:

l Mary buys an apple and John eats it l Jean believes that Mary will give him a flower

GCs - Exercises

slide-58
SLIDE 58
slide-59
SLIDE 59

Flower: * Buy Apple: * Eat Believe Walk Girl

slide-60
SLIDE 60

Buy

Flower: * Apple: * Eat Believe Give

slide-61
SLIDE 61

Relations

¢ Valence l The valence of a relation is the number of arcs

that belongs to it.

l Monadic relation: a

relation to which one arc belongs

l Dyadic relation l Triadic relation

(office_2 is between

  • ffice_1 and office_3)
slide-62
SLIDE 62

Thematic Roles

slide-63
SLIDE 63

Thematic Roles

¢ Thematic roles proposed by Sowa (2000)

slide-64
SLIDE 64

Final example

slide-65
SLIDE 65

¢ Ontological description of types (concepts) and

relations

¢ Organize concepts and relations in a hierarchy

(graph)

Ontology

slide-66
SLIDE 66

¢ Definition of an ontology (wikipedia)

l Ontology is the philosophical study of the nature of

being, existence or reality in general, as well as of the basic categories of being and their relations. … what entities exist or can be said to exist, and how such entities can be grouped, related within a hierarchy, and subdivided according to similarities and differences

¢ Definition of an ontology (Sowa)

l The subject of ontology is the study of the categories of

things that exist in some domain. The product of this study, called an ontology, is a catalog of the types of things that are assumed to exist in a domain of interest D from the perspective of a person who uses a language L for the purpose of talking about D

Ontology

slide-67
SLIDE 67

¢ Defining elements l Defining concepts l Defining relations

Ontology

slide-68
SLIDE 68

¢ Concepts l A concept consists of a type and a referent

Ontology

slide-69
SLIDE 69

¢ Concepts l A concept consists of a type and a referent

Ontology

slide-70
SLIDE 70

¢ Concepts l A concept consists of a type and a referent l A concept type is a class belonging to a hierarchy l A referent is an individual belonging to a class

Ontology

slide-71
SLIDE 71

¢ Small ontology l Step by step building

Ontology

slide-72
SLIDE 72

¢ Small ontology l Step by step building

Ontology

slide-73
SLIDE 73

¢ Small ontology l Step by step building

Ontology

slide-74
SLIDE 74

¢ Small ontology l Step by step building

Ontology

slide-75
SLIDE 75

¢ Small ontology l Step by step building

Ontology

slide-76
SLIDE 76

¢ Small ontology l Step by step building

Ontology

slide-77
SLIDE 77

¢ Small ontology l Step by step building

Ontology

slide-78
SLIDE 78

Ontology

slide-79
SLIDE 79

Ontology

slide-80
SLIDE 80

¢ Concept types and individuals

Ontology

slide-81
SLIDE 81

¢ Concept types and individuals

Ontology

slide-82
SLIDE 82

¢ Concept types and individuals

Ontology

slide-83
SLIDE 83

¢ Concept types and individuals

Ontology

slide-84
SLIDE 84

Ontology

¢ Building ontologies l bottom-up l Top-down

slide-85
SLIDE 85

Ontology

Ontology by Sowa

slide-86
SLIDE 86

CG Theory Hierarchy of types

Universal Living body Non-Animated Animal Person Man Woman Robot Vehicle Car Truck Action Boy Girl Rajae Ihsane

slide-87
SLIDE 87

CG Theory Hierarchy of types

¢ Some operations on concepts l subType(Type1, Type2)

  • subType(Man, Person)

l maxComSubType(Type1, Type2, Type3)

  • maxComSubType(Man, Person, Man)
  • maxComSubType(Person, Vehicle, null)

l minComSuperType(Type1, Type2, Type3)

  • minComSuperType(Man, Person, Person)
  • minComSuperType(Animal, Boy, Living body)
slide-88
SLIDE 88

Conceptual Structures Definition

¢ Definition of a concept type : Type art-Sponsor(x) is:

[Person : x]←agnt-[Give]-

  • obj→[Moeny]
  • rcpt→[Artist]

¢ Definition of relation type: Relation brother(x, y) is:

[Boy: x]←sonOf-[Person]-sonOf→[Person : y]

slide-89
SLIDE 89

Conceptual Structures Canon

¢ Canon (the canonical graph providing basic

semantics about some type):

Canon for teaching:

[teacher]←agnt-[teaching]-

  • obj→[Course],
  • rcpt→[Person]

Canon for Arriving: [Mobile-entity]←agnt-[Arrive]-loc→[Place]

slide-90
SLIDE 90

Operations on CGs joint

¢ The Joint of two CG à a CG that groups

information contained in both

G1 : [Person]←agnt-[drive]-obj→[car] G2 : [boy: Hicham]←agnt-[drive]-manr→[fast] Resultat : [boy: Hicham]←agnt-[drive]-

  • obj→[car],
  • manr→[fast]
slide-91
SLIDE 91

Operations on CGs contraction

¢ To Contract a graph (habituellement la définition

d’un type) of another one:

[Rich]←attr-[man: Hicham]←agnt-[give]-

  • obj→[moeny]
  • rcpt→[Artist]

Example of art-Sponsor:

[art-Sponsor: Hicham]-attr→[Rich]

slide-92
SLIDE 92

Operations on CGs Generalization

¢ Generalizing two graphs => find the CG that

represents common information

G3 : [BOY: Hicham]←agnt-[DRIVE]-obj→

[CAR]-chrc→[Color = RED]

G4 : [GIRL: Mary]←agnt-[DRIVE]-

  • obj→[VEHICLE],
  • manr→[FAST]

Result: [Human]←agnt-[DRIVE]-obj→[Vehicle]

slide-93
SLIDE 93

Amine Platform : CG and Ontology

¢ AminePlatform

slide-94
SLIDE 94