Knowldg-Bsd Systms Andrw Kusik, Profssor 9 Smns Cntr Iow City, Iow - 7 ndrw-kusik@uiow.du http://www.in.uiow.du/~nkusik Tl: 9-9 Fx: 9-9 Outlin INTRODUCTION KNOWLEDGE REPRESENTATION - First-Ordr Logi - Prodution Ruls -Frms - Smnti Ntworks INFERENCE ENGINE - Bsi Rsoning Strtgis - Unrtinty in Rul Bss - Othr Srh Strtgis Outlin KNOWLEDGE ACQUISITION KNOWLEDGE CONSISTENCY - Grouping Ruls with Simpl Ation Cluss - Infrn Anomlis in Rul Bss SUMMARY Exprt Systms, Knowldg-Bsd Systms, nd CI Computtionl Intllign Progrms Knowldg-Bsd Systms Exprt Systms Exhibit intllignt bhvior by skillful pplition of huristis Mk domin knowldg xpliit nd sprt from th rst of th systm Apply xprt knowldg to diffiult, rl world problms CI = Computtionl Intllign Exprt Systm Dvlopmnt of KB Systms Knowldg bs Tool buildr Domin xprt Infrn Engin Exprt systm = Struturd omputr progrm KB systm building tool Knowldg nginr KB systm End-usr Dt http://www.z-xprt.om/ Clril Stff http://www.z-xprt.om/smpls.html Pg
Knowldg-Bsd Systm Usr Slting th right pplition is importnt! Knowldg bs Usr intrf modul Infrn ngin ES Shll Working mmory Knowldgquisition modul DM Softwr Exprts Knowldg Rprsnttion Mthods First-ordr logi Prodution ruls (inluding struturd prodution ruls) Frms Smnti ntworks IF (onditions) THEN (onlusions) EXAMPLE IF Prodution Ruls prt Pi is to b dispthd to mhin M tht is oupid by nothr prt Pj THEN hk vilbility of n ltrntiv mhin Mb Advntgs of Prodution Ruls Frms Th us of rul n b sily xplind to th systm usr Slot VALUE If-ddd produr Dvloprs nd usrs n modify som ruls without brking th ntir systm Slot VALUE If-rmovd produr Nw knowldg n b inorportd into th systm simply by dding nw ruls without onrn of how thy fit into th ovrll knowldg bs Slot VALUE If-ndd produr Pg
A frm is viwd hr s nstd ssoition list with numbr of lvls of mbdding: (Frm (slot (ft (dtum (lbl mssg... ) ) (dtum... )... ) (ft... )... )... ) (slot... ) Frm (Frz_MPS (AKO ($VALUE (Dmpning_mhnism))) (Mthod_to_lot_siz_MPS ($VALUE (Wgnr_Whitin_mthod))) (Plnning_horizon_lngth ($VALUE (N (unit: k multipl of nturl yl lngth)))) (Rplnning_frquny ($VALUE (R (unit: th numbr of priods btwn rplnning yl)))) (Frz_intrvl ($VALUE (P (unit: th proportion of th ovrll plnning horizon n tht rmins fixd in h plnning yl)))) (Plnning_informtion ($VALUE (Ordr_bsd)))) Smnti Ntwork Bsi Rsoning Strtgis Frz_MPS Frz_MPS ISA ISA Dmpning_mhnism Dmpning_mhnism Forwrd rsoning Bkwrd rsoning hs prmtr Pln_horizon vlu K Exmpl Ruls Bs: : IF b THEN Gol R: IF d THEN R: IF THEN http://www.xsys.om/ : IF b THEN Gol Infrn (And/OR) tr IF subssmbly subssmbly b r vilbl THEN initit th ssmbly pross Gol b R: IF d THEN IF prt prt d hv bn ssmbld THEN subssmbly is vilbl Ruls: : IF b THEN Gol R: IF d THEN R: IF THEN d Pg
b Gol : IF b THEN Gol R: IF d THEN R: IF THEN R: IF sunny, THEN hot insid R: IF hot insid humid, THEN us AC d d : IF us AC mny popl, THEN swith b on unit Gol Givn th fts: b, d, nd, driv gol Ruls: : IF b THEN Gol R: IF d THEN R: IF THEN Forwrd Rsoning b Gol fird R fird R fird Infrn tr d Exmpl: Forwrd Rsoning Givn Prts Dtrmin Assmbly Givn th gol, driv fts tht prov it Bkwrd Rsoning Ruls: : IF b THEN Gol R: IF d THEN R: IF THEN b Gol b is stisfid, whil is not R R d is stisfid, whil is not d is tru, is stisfid; thn th gol is stisfid Exmpl: Bkwrd Rsoning Rsoning Summry Forwrd rsoning Bkwrd rsoning Ruls: : IF b THEN Gol R: IF d THEN Givn Assmbly Dtrmin Prts R: IF THEN Infrn dirtion b Gol d Top-down infrn (Bkwrd rsoning) Infrn dirtion Bottom-up infrn (Forwrd rsoning) Pg
Unrtinty in Rul Bss Rul : IF A B THEN D Givn rtinty ftors: CF(A) = CA CF(B) = CB Th rtinty ftor of rul CF(D) = CF() = CF(A B) = min{cf(a), CF(B)} = min{ca, CB} Rul R: IF A OR B Th rtinty ftor of Rul R THEN D CF(D) = CF(R) = CF(A OR B) = mx{cf(a), CF(B)} = mx{ca, CB} C Rul R: IF A B THEN D CF = R.9 Crtinty ftor of R CF(D) = CF(R) = min{ca, CB} /OR tr with thr ruls A R.9.7 B Rul R: IF A OR B THEN D CF = Crtinty ftor of R CF(D) = CF(R) = mx{ca, CB} : IF F G THEN D R: IF D E THEN A R: IF A B THEN C D.8.9 E.8.9 F G Givn CF(F) =.8, CF(G) =.9, CF(E) =.9, nd CF(B) =.7 nd C frtinty ftors of ruls, R, nd R CF() =.8, CF(R) =.9, nd CF(R) =.9 Dtrmin Crtinty ftors of D, A, nd C CF(D) = min{cf(f), CF(G)}. CF() =.800 CF(A) = min{cf(d), CF(E)}. CF(R) =.0 CF(C) = min{cf(a), CF(B)}. CF(R) =.08 F D.8.8.9 A R G.9 R.9.9 E.7 B Givn two prodution ruls nd th orrsponding rtinty ftors: Rul : IF A B THEN D CF = Rul R: IF A OR B THEN D CF = Rlibility nlogy Th ombind vidn CF(, R) = - = ( - ) r r Pg
EXAMPLE: Combind Evidn Rul : IF th infltion rt is lss thn % THEN stok mrkt pris go up CF = = 0.7 Rul R: IF unmploymnt rt is lss thn 7% THEN stok mrkt pris go up CF = = 0. Th ombind vidn is omputd s follows: CF(, R) = - = 0.7 0. - 0. = 0.88 Optimiztion nd Knowldg-Bsd Systms Diffiultis in pplying optimiztion du to: Th dt my not b sily vilbl Modl s sop of pplibility my b limitd Humn xprtis might b rquird Algorithms r oftn not bl to provid optiml solutions bus of problms' omplxity Two Clsss of Knowldg-Bsd Systms Stnd-lon knowldg-bsd systms Tndm knowldg-bsd systms KNOWLEDGE ACQUISITION Typil knowldg quisition pross Knowldg-bsd subsystm Domin xprt Dt, problms, qustions Knowldg nginr Formlizd, struturd knowldg Modl nd lgorithm bs Knowldg, onpts, solutions Knowldg bs KNOWLEDGE ACQUISITION METHODS Knowldg Anomlis KB systm intrfs Protool nlysis Nurl ntworks Dt mining. Stti nomlis: Dttd without infrning ruls. Infrn (dynmi) nomlis: Idntifid during th infrn pross Pg
Stti Anomlis Infrn (Dynmi) Anomly Typ (potntil onflit) - Two ruls with diffrnt onditions produ th sm tion, i.., for C(Ri) C(Rj), A(Ri) = A(Rj) Typ (potntil onflit) - Two ruls with idntil onditions rsult in diffrnt tions, i.., for C(Ri) = C(Rj), A(Ri) A(Rj) Typ (yl) - St of prodution ruls forms yl. Typ (rdundny) - Two ruls with idntil onditions rsult th sm tion, i.., for C(Ri) = C(Rj), A(Ri) = A(Rj) Stti Anomlis Inidn Mtrix Rprsnttion Ruls with Simpl Ation Cluss R : C D R : C D R : C D R : C D R : C D R : C OR D Ation lus A A A Condition lus whr '' indits th inidn of ondition-tion lus Trnsformd Mtrix Condition lus R : C D R : C D R : C D R : C D R : C D R : C OR D Ation lus A A A Clustr Idntifition Algorithm Pg 7 7
Clustr Idntifition Algorithm Stp 0. St itrtion numbr k =. Stp. Slt row i of inidn mtrix [ij](k) nd drw horizontl lin hi through it ([ij](k) is rd: mtrix [ij] t itrtion k ). Stp. For h ntry of rossd by th horizontl lin hi drw vrtil lin vj. Stp. For h ntry of rossd-on by th vrtil lin vj drw horizontl lin hk. Stp. Rpt stps nd until thr r no mor rossd-on ntris of in [ij](k). All rossd-twi ntris in [ij](k) form row lustr RC-k nd olumn lustr CC-k. Stp. Trnsform th inidn mtrix [ij](k) into [ij](k) by rmoving rows nd olumns orrsponding to th horizontl nd vrtil lins drwn in stps through. Stp. If mtrix [ij](k) = 0 (whr 0 dnots mtrix with ll mpty lmnts ), stop; othrwis st k = k nd go to stp. Condition lus Inidn mtrix 7 Ation lus 7 8 7 7 8 Nxt Stp Dlt ll doubl-rossd lmnts 7 8 Rsultnt Mtrix 7 7 7 Pg 8 8
Itrtion Itrtion 7 v v 7 v v7 h h h h C- C- C- Finl Domposition Rsult 7 A- A- A- 8 7 Mtrix Clustring Givn th inidn mtrix Ation lus Condition lus R : C D R : C D R : C D R : C D R : C D R : C OR D Th Clustrd Mtrix (with thr nomlis) Ation lus A A A Condition lus Dttion of Anomlis Ruls with Compound Condition nd Ation Cluss Nottion for th first lmnt in lus j of rul numbr i for th sond ' lmnt ' in lus j of rul numbr i OR for th sond ' OR lmnt ' in lus j of rul numbr i for th third ' lmnt ' in lus j of rul numbr i OR for th third ' OR lmnt ' in lus j of rul numbr i ij =......... k for th k - th ' lmnt ' in lus j of rul numbr i OR k for th k - th ' OR lmnt ' in lus j of rul numbr i EXAMPLE: Dttion of Anomlis Considr six prodution ruls: : IF C D THEN A A R: IF C D THEN A A7 A R: IF C D THEN A A R: IF C D THEN A A R: IF E OR F THEN A7 A R: IF C D THEN A OR A Pg 9 9
Condition-Ation Clus Inidn Mtrix : IF C D THEN A A R: IF C D THEN A A7 A R: IF C D THEN A A R: IF C D THEN A A R: IF E OR F THEN A7 A R: IF C D THEN A OR A R : C D R : C D R : C D R : C D R : E OR F R : C D OR http://wombt.do.i..uk/foldo/foldo.gi?truthtbl A A A A A A A 7 R : C D R : C D R : C D R : C D R : C D R : E OR F Th Clustrd Mtrix A A A A A A A 7 OR Rmrks R : C D R : C D : C D R : C D R : C D R : E OR F A A A A A A A7 OR Prodution ruls R nd R r susptd of typ nomly Infrn Anomlis : IF THEN R: IF OR THEN /OR grphs Prodution ruls nd R r susptd of typ nomly R Prodution ruls R nd R show som similrity in thir tion luss, whil thir ondition luss diffr Considr Four Ruls : IF OR THEN R: IF 7 THEN R: IF OR THEN R: IF THEN Adding R: IF THEN R: IF THEN rsults in /OR grphs R R R R 7 R 7 R R R R R Pg 0 0
Inidn Mtrix for Ruls,..., R Inidn Mtrix for Ruls,..., R R R R R R 7 R R R R R R R R R R R R R R R 7 R R R R R Rsult Produd by th Tringulriztion Algorithm http://www.in.uiow.du/~nkusik/pross-modl.html R R R R R R R R R R A yl R 7 R R R R R R R R R R R R R Rmrks. Th ordr in whih th prodution ruls n b fird is, R, R, R, R.. Th lmnt (R, R) in th uppr digonl indits tht thr xist yl btwn ruls R nd R. R R Pg