Presentation is loading. Please wait.

Presentation is loading. Please wait.

Knowledge Representation and Reasoning University "Politehnica" of Bucharest Department of Computer Science Fall 2011 Adina Magda Florea Master of Science.

Similar presentations


Presentation on theme: "Knowledge Representation and Reasoning University "Politehnica" of Bucharest Department of Computer Science Fall 2011 Adina Magda Florea Master of Science."— Presentation transcript:

1 Knowledge Representation and Reasoning University "Politehnica" of Bucharest Department of Computer Science Fall 2011 Adina Magda Florea Master of Science in Artificial Intelligence, 2011-2013

2 Lecture 4 – NML Supliment Truth Maintenance Systems  TMS Functioning  Data structures for a TMS  TMS/IE responsibilities  TMS/IE interface

3 TMS Truth Maintenance Systems  Non monotonic reasoning  Increase efficiency of problem solving  Good for: validate assumptions redraw abandoned conclusions  NMR  dependency directed backtracking (DDBkt) control program actions explain reasoning 3

4 Dependency Directed Bkt (1) x  {0,1}(2) a = e 1 (x) (3) y  {0,1}(4) b = e 2 (x) (5) z  {0,1}(6) c = e 3 (x) (7) b  c(8) a  b e i (x) = (x+100000)!, i=1,2,3 Find a, b, c to satisfy (1)-(8)  x=0, y=0, z=0 and x=0, y=0, z=1 are rejected because of (7) and (8) – y's value  backtrack to y  c = e 3 (0) and c = e 3 (1) are lost 4

5 TMS principles  Each action in the problem solving process has an associated justification  When a contradiction is obtained, find the minimal set of assumptions which generated the contradiction – if we eliminate an element from this set, the justification for the contradiction is not valid any more and the contradiction is removed  Propagate the effects of adding a justification and of eliminating a belief + keep consistency  Select an assumption from the minimal set which generated the contradiction and defeat it 5

6 TMS Structure Inference Engine (IE) TMS Knowledge Base Justifications Beliefs  Belief - expression which can be true or false  Justification - inference rule (step) which lead to a belief  Premise - true fact (no justification needed) 6

7 TMS Structure  Set of nodes in the TMS  Every node has 2 states IN (believed node) OUT (node not believed)  Set of valid assumptions = set of IN nodes in the TMS 7

8 TMS Structure  The nodes may be: premises – no justification needed, IN nodes belief – may be believed (IN) or not (OUT) assumption - with supporting justifications – IN nodes if the justification is true, OUT nodes otherwise  A justification = set of nodes used to infer the justified node, composed of 2 lists: IN List – nodes that have to be IN for the justification to be true / to support an IN node OUT List – nodes that have to be OUT for the justification to be true / to support an IN node 8

9 The ABC Murder Initial set of beliefs Beneficiar (Alecu)~Alibi(Alecu) Beneficiar(Barbu) Beneficiar(Cezar) R1: if Beneficiar(x) and ifnot Alibi(x) then Suspect(x) Nonmonotonic production rule 9

10 The ABC Murder Rules R1: if Beneficiar(x) and ifnot Alibi(x) then Suspect(x) R2:if Hotel(x,y) and Departe(y) and ifnot Falsificat(y) then Alibi(x) R3:if Aparat(x, y) and ifnot Minte(y) then Alibi(x) R4:ifnot ~Spune_adevar(x) then Alibi(x) 10

11 TMS for the ABC Murder (Node (IN_List OUT_List)) N1 = Suspect (Alecu) (N1, ( (N2) (N3) ) ) N2 = Beneficiar (Alecu) N3 = ~Alibi(Alecu) justification justified assumption premiseunjustified assumption 11

12 TMS for the ABC Murder Suppose new beliefs are added Inregistrat la hotel Alecu, Departe Arad, ~Falsificat registru R2:if Hotel(x,y) and Departe(y) and ifnot Falsificat(y) then Alibi(x) R1: if Beneficiar(x) and ifnot Alibi(x) then Suspect(x) 12

13 TMS for the ABC Murder Suppose another new belief is added Barbu aparat de Cumnat R3:if Aparat(x, y) and ifnot Minte(y) then Alibi(x) R1: if Beneficiar(x) and ifnot Alibi(x) then Suspect(x) 13

14 TMS for the ABC Murder What about Cezar? R4:ifnot ~Spune_adevar(x) then Alibi(x) R1: if Beneficiar(x) and ifnot Alibi(x) then Suspect(x) 14

15 TMS for the ABC Murder Represent contradiction 15

16 TMS for the ABC Murder New beliefs are added 16

17 TMS for the ABC Murder The new beliefs bring a contradiction 17

18 Removing the contradiction Identify the minimal set of beliefs that brought the contradiction OUT some belief to remove contradiction Select an assumption (node) N and add a valid justification to a node N’  OUT List of N OR OUT a node N’  IN List of N by adding a valid justification to a node N”  OUT List of N’ 18

19 Removing the contradiction Justification to remove the contradiction {Suspect Alecu, Suspect Barbu, Suspect Cezar, Alti Suspecti} 19

20 Data structures for a TMS Data structures (1)Node. Contains the following slots:  Value – the representation of the associated fact; a unique value, which is identical with the representation in the KB  Label – state of the node - IN or OUT.  NodeJustification – list of justifications which justify a given node. Note that a node may have several justifications  IsConsequence – list of justifications in which the node take part. It is formed of 2 lists: ConseqIN – list of justifications in which the node appears in the IN list (N.ConseqIN) ConseqOUT - list of justifications in which the node appears in the OUT list (N.ConseqOUT)  Contradiction – a flag indicating if the node is a contradiction 20

21 Data structures for a TMS (2) Justification. Contains the following slots:  Type – represents the inference type of a justification, namely premise, Modus Ponens, rule, inheritance, etc. Depends on the Inference Engine and it is given by the IE to the TMS  Consequence – the node the justification justifies  Premises – list of nodes that participated in the inference, formed of the INList of nodes and the OUTList of nodes (N.Justification) (3) An indexing structure and mechanism to allow fast search of nodes in the TMS 21

22 Types of nodes (Node (IN_List OUT_List)) N1 = Suspect (Alecu) (N1, ( (N2) (N3) ) ) N2 = Beneficiar (Alecu) N3 = ~Alibi(Alecu) Justification Justified Assumption (Regular node) PremiseUnjustified assumption (Assumption) Rau Alecu [IN] Unjustified assumption (Assumption) + 22

23 Types of nodes  Premise nodes – always true (IN)  Unjustified assumptions nodes (Assumptions) – nodes which IE wants to believe (IN) or not (OUT), although they are not supported by the existing evidence  Justified assumptions nodes (Regular nodes) - nodes which are believed only if there is a valid reason for that (a valid justification). An assumptions that has a valid justification is treated as a Regular node and is IN.  Contradiction nodes – always false (OUT) 23

24 TMS/IE responsibilities  Responsibilities of the IE:  Adds premises and makes assumptions  Apply rules and adds justifications  Retracts assumptions  Provides advise on handling contradictions  Responsibilities of the TMS:  Cashes beliefs and maintains node labels  Detects contradictions  Performs belief revision  Generates explanations 24

25 TMS/IE interface  IE action A. Provides a mapping between IE and TMS data structures: 1.If a new node is needed, IE must inform TMS about it, and give the connection between this node and the corresponding assertions. 2.To use TMS nodes, IE must be able to retrieve TMS nodes associated with assertions that IE works with. 3.IE must provide a way for defining nodes as premises, and for enabling/retracting assumptions.  TMS action A. Creates nodes with specified properties 25

26 TMS/IE interface  IE action B. Provides facilities for representing justifications. C. Provides facilities for inspecting TMS beliefs, i.e. accessing label information.  TMS action B. Accepts records of IE deductions (as justifications) C. Computes the correct label for nodes and supplies them on request. 1.Derives consequences of assumptions & premises based on the dependency network 2.When assumptions are retracted, their consequences are retracted 3.Provides explanations for beliefs, e.g., inferences 26

27 TMS/IE interface  IE action D. Provides facilities for contradiction handling.  TMS action D. Detects contradictions, based on contradiction nodes and explicit dependencies. Ensuring a proper mapping between IE and TMS structures Assertion i Cash assertion i Node I TMS network Belief status for Node i 27

28 TMS – Computes the correct label Algorithm:Add a node justification 1.Create justification J for node N 2.Update the links to referred nodes for connecting J in the TMS 3.if justified node N is IN then STOP /* justification does not modify N state*/ 4.if justified node N is OUT then 4.1.Evaluate justification J 4.2.if J is valid then 4.2.1.Change N state in IN /* node changes from OUT to IN */ 4.2.2.Propagate(N) end 28

29 TMS – Computes the correct label Propagate(N) 1.for all nodes N i in N.ConseqIN do 1.1.if N i is OUT then 1.1.1.Evaluate new state of N i based on N i.Justification /* considering new state IN of N */ 1.1.2.if new sate of N i is IN then Propagate(N i ) /* if N i is IN no modification required */ 29

30 TMS – Computes the correct label 2.for all nodes N i in N.ConseqOUT do 2.1.if N i is IN then 2.1.1.Build list LN with all nodes recursively justified by N 2.1.2.for all nodes N j in LN do i. N j.Label  OUT /* mark N j with OUT */ 2.1.3. for all nodes N j in LN do i. Evaluate N j.State /* N j.State may be IN or OUT */ ii. N j.Label  N j.State /* update N j state */ end 30

31 Network update when changing a node state in OUT


Download ppt "Knowledge Representation and Reasoning University "Politehnica" of Bucharest Department of Computer Science Fall 2011 Adina Magda Florea Master of Science."

Similar presentations


Ads by Google