100 likes | 206 Views
10 if interest rates=FALL then stock market=RISE 20 if interest rates=RISE then stock market=FALL 30 if dollar exchange rate=FALL then interest rates=RISE 40 if dollar exchange rate=RISE then interest rates=FALL 50 if fedint=FALL AND FEDMON=ADD then inerest rates=FALL.
E N D
10 if interest rates=FALL then stock market=RISE 20 if interest rates=RISE then stock market=FALL 30 if dollar exchange rate=FALL then interest rates=RISE 40 if dollar exchange rate=RISE then interest rates=FALL 50 if fedint=FALL AND FEDMON=ADD then inerest rates=FALL dollar exchange rate=FALL R30 interestrate=RISE R20 stock market=FALL
10 if interest=FALL then stock=RISE 20 if interest=RISE then stock market=FALL 30 if dollar=FALL then interest=RISE 40 if dollar=RISE then interest=FALL 50 if fedint=FALL AND FEDMON=ADD then inerest =FALL 1 interest 2 3 4 5 interest 6 7 8 9 dollar 10 11 12 13 dollar 14 15 16 17 fedint 18 fedmon forward chaining… ?dollar=rise I NI value interest dollar fedint fedmon stock variable list knowledge base clause variable list rule no clause no clause variable pointer conclusion variable queue
10 if interest=FALL then stock=RISE 20 if interest=RISE then stock market=FALL 30 if dollar=FALL then interest=RISE 40 if dollar=RISE then interest=FALL 50 if fedint=FALL AND FEDMON=ADD then inerest =FALL 1 interest 2 3 4 5 interest 6 7 8 9 dollar 10 11 12 13 dollar 14 15 16 17 fedint 18 fedmon forward chaining… ?dollar=rise I NI value interest dollar fedint fedmon stock Rise I variable list knowledge base clause variable list interest 1 40 rule no clause no 13 clause variable pointer conclusion variable queue
10 if interest=FALL then stock=RISE 20 if interest=RISE then stock market=FALL 30 if dollar=FALL then interest=RISE 40 if dollar=RISE then interest=FALL 50 if fedint=FALL AND FEDMON=ADD then inerest =FALL 1 interest 2 3 4 5 interest 6 7 8 9 dollar 10 11 12 13 dollar 14 15 16 17 fedint 18 fedmon forward chaining… ?dollar=rise I NI value Fall interest dollar fedint fedmon stock I Rise I I Rise variable list knowledge base clause variable list stock 1 10 rule no clause no 1 clause variable pointer conclusion variable queue
Decision nodes Backward Chaining less than 2 years Do not offer applicant a position 9 Average less than 3.5 How many years experience does applicant have? 7 Do not offer applicant a position 2 No Offer applicant a position in service engineering 10 2 Does applicant have a degree? 1 applicant possibly qualifies for a position 3 What’s applicant’s overall average? 5 Yes Yes average 3.5 Did applicant make an important discovery? 4 Offer applicant a position in product engineering 8 Offer applicant a position in research 6 Yes Yes
Goals (conclusions) Subconclusion Backward Chaining less than 2 years Do not offer applicant a position 9 Average less than 3.5 How many years experience does applicant have? 7 Do not offer applicant a position 2 No Offer applicant a position in service engineering 10 2 Does applicant have a degree? 1 applicant possibly qualifies for a position 3 What’s applicant’s overall average? 5 Yes Yes average 3.5 Did applicant make an important discovery? 4 Offer applicant a position in product engineering 8 Offer applicant a position in research 6 Yes Yes
Variable Conditions IF part Backward Chaining less than 2 years Do not offer applicant a position 9 Average less than 3.5 How many years experience does applicant have? 7 Do not offer applicant a position 2 No Offer applicant a position in service engineering 10 2 Does applicant have a degree? 1 applicant possibly qualifies for a position 3 What’s applicant’s overall average? 5 Yes Yes average 3.5 Did applicant make an important discovery? 4 Offer applicant a position in product engineering 8 Offer applicant a position in research 6 Yes Yes
Backward Chaining…Creating a knowledge base (conversion to IF-THEN rules) No IF applicant has a degree = yes, THEN applicant possibly qualifies for a position = yes Does applicant have a degree? 1 applicant possibly qualifies for a position 3 Yes
Backward Chaining…Creating a knowledge base (conversion to IF-THEN rules) • Choose a conclusion node of the decision tree. Record it. • Choose a decision node with a connecting branch to the left of the node you chose in step 1. Record that node • Continue doing step 2 until either there are no more nodes to the left or until a conclusion node is reached. If a conclusion node is reached record it and stop. IF there are no more nodes, stop. • Each decision node in the path is the variable part of an IF clause. The value associated with the branch is the condition. All connected clauses use the logical AND. • The conclusion becomes the THEN part
Backward Chaining…Creating a knowledge base (conversion to IF-THEN rules) conclusion IF DEGREE = YES AND DISCOVERY = YES THEN POSITION = RESEARCH Did applicant make an important discovery? 4 Does applicant have a degree? 1 Offer applicant a position in research 6 Yes Yes