Topics in artificial intelligence Reasoning and search techniques

  • Slides: 53
Download presentation
Topics in artificial intelligence Reasoning and search techniques Dr hab. inż. Joanna Józefowska, prof.

Topics in artificial intelligence Reasoning and search techniques Dr hab. inż. Joanna Józefowska, prof. PP 1/1

Plan Topics in artificial intelligence • Reasoning in Description logics – – Subsumption Classification

Plan Topics in artificial intelligence • Reasoning in Description logics – – Subsumption Classification Satisfiability Tableau algorithms • Reasoning and search – Search space – MIN-MAX algorithm – Alpha-beta algorithm Dr hab. inż. Joanna Józefowska, prof. PP 2

Reasoning task: sumsumption C T D Topics in artificial intelligence C is subsumed by

Reasoning task: sumsumption C T D Topics in artificial intelligence C is subsumed by D with respect to T iff CI DI holds for all models I of T Intuition If C T D then D is more general than C. Lecturer = Person teaches. Course Student = Person attends. Course Lecturer attends. Course Dr hab. inż. Joanna Józefowska, prof. PP T Student 3

Topics in artificial intelligence Reasoning task: classification Arrange all defined objects from TBox in

Topics in artificial intelligence Reasoning task: classification Arrange all defined objects from TBox in a hierarchy with respect to generality. Lecturer = Person teaches. Course Student = Person attends. Course Ph. DStudent = teaches. Course Student Person Student Can be computed using multiple subsumption tests. Dr hab. inż. Joanna Józefowska, prof. PP Lecturer Ph. DStudent 4

Reasoning task: satisfiability Topics in artificial intelligence C is satisfiable w. r. t. T

Reasoning task: satisfiability Topics in artificial intelligence C is satisfiable w. r. t. T iff T has a model with CI . Intuition: If unsatisfiable the concept contains a contradiction. Woman = Person Female Man = Person Female Then sibling. Woman sibling. Man is unsatisfiable w. r. t. T. Subsumption can be reduced to (un)satisfiability and vice versa. C T D iff C D is not satisfiable w. r. t. T C is satisfiable w. r. t. T iff not C Dr hab. inż. Joanna Józefowska, prof. PP T 5

Description logics are more than concept language Topics in artificial intelligence Knowledge base Use

Description logics are more than concept language Topics in artificial intelligence Knowledge base Use concept language TBox terminological knowledge background knowledge DL Reasoner ABox knowledge about individuals Dr hab. inż. Joanna Józefowska, prof. PP 6

Definitorial TBoxes Topics in artificial intelligence A primitive interpretation for TBox T interprets •

Definitorial TBoxes Topics in artificial intelligence A primitive interpretation for TBox T interprets • the primitive concept names • all role names A TBox is called definitorial if every primitive interpretation for T can be uniquely extended to a model of T. i. e. primitive concepts (and roles) uniquely determine defined concepts. Not all TBoxes are definitorial Person = parent. Person Non-definitorial TBoxes describe constraints, e. g. from background knowledge. Dr hab. inż. Joanna Józefowska, prof. PP 7

Acyclic TBoxes Topics in artificial intelligence TBox is acyclic if there are no definitorial

Acyclic TBoxes Topics in artificial intelligence TBox is acyclic if there are no definitorial cycles. Lecturer = Person teaches. Course = hastitle. Title tought-by. Lecturer Expansion of acyclic TBox T exhaustively replace defined concept name with their definition (terminates due to acyclicity) Acyclic TBoxes are always definitorial first expand then set AI : = CI for all A = C T Dr hab. inż. Joanna Józefowska, prof. PP 8

Acyclic TBoxes II Topics in artificial intelligence For reasoning acyclic TBoxes can be eliminated

Acyclic TBoxes II Topics in artificial intelligence For reasoning acyclic TBoxes can be eliminated • to decide with • expand T C T D T acyclic • replace defined concept names in C, D with their definition • decide C D • analogously for satisfiability May yield an exponential blow-up. Dr hab. inż. Joanna Józefowska, prof. PP 9

General concept inclusions Topics in artificial intelligence General Tbox: finite set of general concept

General concept inclusions Topics in artificial intelligence General Tbox: finite set of general concept implications (GCIs) C D with both C and D allowed to be complex. Course attended-by. Sleeping Note: C Boring D equivalent to T = C D (in terms of model I) Dr hab. inż. Joanna Józefowska, prof. PP 10

Tableau algorithms Topics in artificial intelligence Goal: an algorithm which takes an ALC concept

Tableau algorithms Topics in artificial intelligence Goal: an algorithm which takes an ALC concept C 0 and 1. Returns „satisfiable” iff C 0 is satisfiable 2. Terminates on every input 3. i. e. decides satisfiability of ALC concepts Recall: such an algorithm cannot exist for FOL since satisfiability of FOL is not decidable! Dr hab. inż. Joanna Józefowska, prof. PP 11

Negation normal form (NNF) Topics in artificial intelligence Negation occurs only in front of

Negation normal form (NNF) Topics in artificial intelligence Negation occurs only in front of concept names C C (C D) C D R. C R. C Dr hab. inż. Joanna Józefowska, prof. PP 12

Intuition Is A R. B R. B satisfiable? Topics in artificial intelligence The tableau

Intuition Is A R. B R. B satisfiable? Topics in artificial intelligence The tableau algorithm works on a complete tree which • represents a model I: • nodes represent elements of DI each node x is labeled with concepts L(x) sub(C 0), C L(x) is read as „x should be an instance of C” • edges represent role successorship each edge x, y is labelled with a role name from C 0, R L( x, y ) is read as „(x, y) should be in RI” • is initialized with a single root node x 0 with L(x 0) = {C 0} • is expanded using completion rules Dr hab. inż. Joanna Józefowska, prof. PP 13

Completion rules Topics in artificial intelligence We only apply rules if their application does

Completion rules Topics in artificial intelligence We only apply rules if their application does „something new” rule: if (C 1 C 2) L(x) and {C 1, C 2} L(x) then set L(x) = L(x) {C 1, C 2} rule: if (C 1 C 2) L(x) and {C 1, C 2} = then set L(x) = L(x) C for some C {C 1, C 2} rule: if S. C L(x) and x has no S-successor y with C L(x) then create a new node y with L( x, y )={S} and L(y)={C} rule: if S. C L(x) and there is an S-successor y of x with C L(y) The rule is nonthen set L(y) = L(y) {C} Dr hab. inż. Joanna Józefowska, prof. PP deterministic 14

Topics in artificial intelligence Clash A c-tree contains a clash if it has a

Topics in artificial intelligence Clash A c-tree contains a clash if it has a node x with L(x) or {A, A} L(x) – otherwise it is clash-free C 0 is satisfiable iff the completion rules can be applied in such a way that it results in a complete and clash-free c-tree. Careful: this is nondeterministic Dr hab. inż. Joanna Józefowska, prof. PP 15

Properties of the tableau algorithm Topics in artificial intelligence Let C 0 be an

Properties of the tableau algorithm Topics in artificial intelligence Let C 0 be an ALC concept in NNF. Then: 1. the algorithm terminates when applied to C 0 and 2. the rules can be applied such that they generate a clash-free and complete completion tree iff C 0 is satisfiable. Dr hab. inż. Joanna Józefowska, prof. PP 16

Example L(x) = {A, R. B} x Topics in artificial intelligence R w L(w)

Example L(x) = {A, R. B} x Topics in artificial intelligence R w L(w) = {B, R. B} R y x AI x ( R. B)I d: (x, d) RI, d BI x ( R. B)I d ( B)I Dr hab. inż. Joanna Józefowska, prof. PP L(y) = {B, B} CLASH! 17

ABoxes Topics in artificial intelligence An ABox is a finite set of assertions a:

ABoxes Topics in artificial intelligence An ABox is a finite set of assertions a: C (a – individual name, C – concept) (a, b) : R (a, b – individual names, R – role name) E. g. {peter : Student, (ai-course, joanna) : tought-by} Interpretations I map each individual name a to an element of DI. I satisfies an assertion a: C iff a. I C I (a, b) : R iff (a. I, b. I ) RI I is a model for an Abox A if I satisfies all assertions in A. Dr hab. inż. Joanna Józefowska, prof. PP 18

Topics in artificial intelligence ABoxes • Interpretations describe the state of the world in

Topics in artificial intelligence ABoxes • Interpretations describe the state of the world in a complete way • ABoxes describe the state of the world in an incomplete way • An ABox has many models • An ABox constraints the set of admissible models similar to a TBox Dr hab. inż. Joanna Józefowska, prof. PP 19

Reasoning with ABoxes Topics in artificial intelligence ABox consistency Given an ABox A and

Reasoning with ABoxes Topics in artificial intelligence ABox consistency Given an ABox A and a TBox T do they have a common model? Instance checking Given an ABox A, a TBox T , an individual name a, and a concept C does a. I CI hold in all models of A and T ? A, T = a : C The two tasks are interreducible: • A consistent w. r. t T iff A, T |= a : • A, T = a : C iff A {a : C} is not consistent Dr hab. inż. Joanna Józefowska, prof. PP 20

Topics in artificial intelligence Example ABox dumbo : Mammal t 14 : Trunk (dumbo,

Topics in artificial intelligence Example ABox dumbo : Mammal t 14 : Trunk (dumbo, t 14) : bodypart g 23 : Darkgrey (dumbo, g 23) : color TBox Elephant = Mammal bodypart. Trunk color. Grey = Lightgrey Darkgrey • ABox is inconsistent w. r. t. TBox. • dumbo is an instance of Elephant. Dr hab. inż. Joanna Józefowska, prof. PP 21

Topics in artificial intelligence Reasoning and search Dr hab. inż. Joanna Józefowska, prof. PP

Topics in artificial intelligence Reasoning and search Dr hab. inż. Joanna Józefowska, prof. PP 22

ba ab ca ac cb bc Topics in artificial intelligence Production rules cbac (3)

ba ab ca ac cb bc Topics in artificial intelligence Production rules cbac (3) bcac (1) cabc (2) bacc (1) acbc (3) abcc Dr hab. inż. Joanna Józefowska, prof. PP (1) (2) (3) 23

Topics in artificial intelligence State space is an ordered 4 -tuple [N, A, S,

Topics in artificial intelligence State space is an ordered 4 -tuple [N, A, S, GD], where: N is a set of nodes corresponding to the states of the problem in the solution process A is a set of arcs corresponding to the steps in the solution process S is a non-empty subset of N containing the initial states of the problem GD is a non-empty subset of N containing the goal states of the problem. Dr hab. inż. Joanna Józefowska, prof. PP 24

produkcyjne NSystemy – state set cbac Topics in artificial intelligence (3) bcac (1) cabc

produkcyjne NSystemy – state set cbac Topics in artificial intelligence (3) bcac (1) cabc (2) bacc (1) acbc (3) abcc Dr hab. inż. Joanna Józefowska, prof. PP 25

N – state set A – step set cbac Topics in artificial intelligence (3)

N – state set A – step set cbac Topics in artificial intelligence (3) bcac S – set of initial states (1) cabc (2) bacc (1) acbc (3) abcc GD – set of goal states Dr hab. inż. Joanna Józefowska, prof. PP 26

Topics in artificial intelligence The states in GD are defined: 1. by properties of

Topics in artificial intelligence The states in GD are defined: 1. by properties of states occurring during search 2. by properties of the path created during search Solution path is the path from a node in S to a node in GD. Dr hab. inż. Joanna Józefowska, prof. PP 27

cbac Topics in artificial intelligence (3) bcac (1) cabc (2) bacc (1) acbc (3)

cbac Topics in artificial intelligence (3) bcac (1) cabc (2) bacc (1) acbc (3) abcc Two solution paths Dr hab. inż. Joanna Józefowska, prof. PP 28

Topics in artificial intelligence NIM Dr hab. inż. Joanna Józefowska, prof. PP 29

Topics in artificial intelligence NIM Dr hab. inż. Joanna Józefowska, prof. PP 29

Topics in artificial intelligence NIM Dr hab. inż. Joanna Józefowska, prof. PP 30

Topics in artificial intelligence NIM Dr hab. inż. Joanna Józefowska, prof. PP 30

Topics in artificial intelligence NIM Dr hab. inż. Joanna Józefowska, prof. PP 31

Topics in artificial intelligence NIM Dr hab. inż. Joanna Józefowska, prof. PP 31

Topics in artificial intelligence NIM Dr hab. inż. Joanna Józefowska, prof. PP 32

Topics in artificial intelligence NIM Dr hab. inż. Joanna Józefowska, prof. PP 32

Topics in artificial intelligence NIM Dr hab. inż. Joanna Józefowska, prof. PP 33

Topics in artificial intelligence NIM Dr hab. inż. Joanna Józefowska, prof. PP 33

Topics in artificial intelligence NIM Dr hab. inż. Joanna Józefowska, prof. PP 34

Topics in artificial intelligence NIM Dr hab. inż. Joanna Józefowska, prof. PP 34

Topics in artificial intelligence NIM Dr hab. inż. Joanna Józefowska, prof. PP 35

Topics in artificial intelligence NIM Dr hab. inż. Joanna Józefowska, prof. PP 35

Topics in artificial intelligence NIM Dr hab. inż. Joanna Józefowska, prof. PP 36

Topics in artificial intelligence NIM Dr hab. inż. Joanna Józefowska, prof. PP 36

Topics in artificial intelligence NIM Dr hab. inż. Joanna Józefowska, prof. PP 37

Topics in artificial intelligence NIM Dr hab. inż. Joanna Józefowska, prof. PP 37

Algorytm MIN-MAX Topics in artificial intelligence Players are denoted MIN and MAX The value

Algorytm MIN-MAX Topics in artificial intelligence Players are denoted MIN and MAX The value of the game is the score of MAX. The score of MAX plus the score of MIN equals zero. MAX attempts to maximize the value of the game. MIN attempts to minimize the value of the game. Dr hab. inż. Joanna Józefowska, prof. PP 38

MAX NIM Topics in artificial intelligence MIN +1 -1 +1 +1 Dr hab. inż.

MAX NIM Topics in artificial intelligence MIN +1 -1 +1 +1 Dr hab. inż. Joanna Józefowska, prof. PP MAX MIN 39

-1 NIM Topics in artificial intelligence -1 +1 MAX -1 -1 -1 +1 +1

-1 NIM Topics in artificial intelligence -1 +1 MAX -1 -1 -1 +1 +1 Dr hab. inż. Joanna Józefowska, prof. PP MIN MAX MIN 40

Topics in artificial intelligence Algorithm MINi. MAX Both players have the same information about

Topics in artificial intelligence Algorithm MINi. MAX Both players have the same information about the game and want to win. If the father is MIN, assign it the minimum value of all its children. If the father is MIN, assign it the maximum value of all its children. Dr hab. inż. Joanna Józefowska, prof. PP 41

Topics in artificial intelligence Algorithm alpha-beta Assumptions: 1. The rules prohibit infinite path. 2.

Topics in artificial intelligence Algorithm alpha-beta Assumptions: 1. The rules prohibit infinite path. 2. Only finite number of successors can be generated from any node. 3. The length of any game is finite. Dr hab. inż. Joanna Józefowska, prof. PP 42

Algorithm alpha beta Topics in artificial intelligence alfa=- beta=+ MAX beta=+ MIN MAX MIN

Algorithm alpha beta Topics in artificial intelligence alfa=- beta=+ MAX beta=+ MIN MAX MIN Dr hab. inż. Joanna Józefowska, prof. PP 43

Algorithm alpha beta alfa=- Topics in artificial intelligence Ł9 beta=+ 9 MAX beta=+ MIN

Algorithm alpha beta alfa=- Topics in artificial intelligence Ł9 beta=+ 9 MAX beta=+ MIN MAX MIN Dr hab. inż. Joanna Józefowska, prof. PP 44

Algorithm alpha beta Topics in artificial intelligence alfa=- beta=9 beta=+ 9 MAX beta=+ MIN

Algorithm alpha beta Topics in artificial intelligence alfa=- beta=9 beta=+ 9 MAX beta=+ MIN MAX MIN Dr hab. inż. Joanna Józefowska, prof. PP 45

Algorithm alpha beta alfa=- Topics in artificial intelligence Ł7 beta=+ 9 7 MAX beta=+

Algorithm alpha beta alfa=- Topics in artificial intelligence Ł7 beta=+ 9 7 MAX beta=+ MIN MAX MIN Dr hab. inż. Joanna Józefowska, prof. PP 46

Algorithm alpha beta Topics in artificial intelligence alfa=- beta=7 beta=+ 9 7 8 MAX

Algorithm alpha beta Topics in artificial intelligence alfa=- beta=7 beta=+ 9 7 8 MAX beta=+ MIN MAX MIN Dr hab. inż. Joanna Józefowska, prof. PP 47

Algorithm alpha beta Topics in artificial intelligence alfa=- beta=7 beta=+ 9 7 8 ł7

Algorithm alpha beta Topics in artificial intelligence alfa=- beta=7 beta=+ 9 7 8 ł7 beta=+ MAX MIN Dr hab. inż. Joanna Józefowska, prof. PP 48

Alpha cuts Any value found in this branch can not increase beta. Topics in

Alpha cuts Any value found in this branch can not increase beta. Topics in artificial intelligence alfa=7 beta=+ 9 7 Ł6 8 6 MAX MIN Dr hab. inż. Joanna Józefowska, prof. PP 49

Topics in artificial intelligence Alpha cuts Search can complete below any MIN node with

Topics in artificial intelligence Alpha cuts Search can complete below any MIN node with value less than or equal from value alpha of any of its predecessors (of type MAX). Dr hab. inż. Joanna Józefowska, prof. PP 50

Beta cuts Topics in artificial intelligence alfa=7 beta=+ 9 7 MAX MIN beta=8 8

Beta cuts Topics in artificial intelligence alfa=7 beta=+ 9 7 MAX MIN beta=8 8 8 MAX MIN MAX Dr hab. inż. Joanna Józefowska, prof. PP 51

Beta cuts Alfa cannot decrease. MAX Topics in artificial intelligence alfa=7 beta=+ 9 7

Beta cuts Alfa cannot decrease. MAX Topics in artificial intelligence alfa=7 beta=+ 9 7 8 ł9 9 MIN beta=8 8 MAX MIN MAX Dr hab. inż. Joanna Józefowska, prof. PP 52

Topics in artificial intelligence Beta cuts Search can complete below any MAX node with

Topics in artificial intelligence Beta cuts Search can complete below any MAX node with value greater than or equal from value beta of any of its predecessors (of type MIN). Dr hab. inż. Joanna Józefowska, prof. PP 53