Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Antecedent-Consequent Rules Rn:IF condition 1 condition 2... THEN consequent 1 consequent 2...

Similar presentations


Presentation on theme: "1 Antecedent-Consequent Rules Rn:IF condition 1 condition 2... THEN consequent 1 consequent 2..."— Presentation transcript:

1 1 Antecedent-Consequent Rules Rn:IF condition 1 condition 2... THEN consequent 1 consequent 2...

2 2 Zookeeper (1) Z1: IF ?x has hair THEN ?x is a mammal Z2: IF ?x gives milk THEN ?x is a mammal Z3: IF ?x has feathers THEN ?x is a bird Z4: IF ?x flies ?x lays eggs THEN ?x is a bird

3 3 Zookeeper (2) Z5: IF ?x is a mammal ?x eats meat THEN ?x is a carnivore Z6: IF ?x is a mammal ?x has pointed teeth ?x has claws ?x has forward-looking eyes THEN ?x is a carnivore

4 4 Zookeeper (3) Z7: IF ?x is a mammal ?x has hooves THEN ?x is an ungulate Z8: IF ?x is a mammal ?x chews cud THEN ?x is an ungulate

5 5 Zookeeper (4) Z9: IF ?x is a carnivore ?x has tawny color ?x has dark spots THEN ?x is a cheetah Z10: IF ?x is a carnivore ?x has tawny color ?x has black stripes THEN ?x is a tiger

6 6 Zookeeper (5) Z11: IF ?x is an ungulate ?x has long legs ?x has long neck ?x has tawny color ?x has dark spots THEN ?x is a giraffe Z12: IF ?x is an ungulate ?x has white color ?x has black stripes THEN ?x is a zebra

7 7 Zookeeper (6) Z13: IF ?x is a bird ?x does not fly ?x has long legs ?x has long neck ?x is black and white THEN ?x is an ostrich

8 8 Zookeeper (7) Z14: IF ?x is a bird ?x does not fly ?x swims ?x is black and white THEN ?x is a penguin Z15: IF ?x is a bird ?x is a good flyer THEN ?x is an albatross

9 9 Initial Database Stretch has hair Stretch chews cud Stretch has long legs Stretch has long neck Stretch has tawny color Stretch has dark spots

10 10 Forward Chaining

11 11 Initial Database Swifty has forward-looking eyes Swifty has claws Swifty has pointed teeth Swifty has hair Swifty has tawny color Swifty has dark spots

12 12 Backward Chaining

13 13 Mycin (1) What is the patient’s name? John Doe. Male or female? Male. Age? He is 55. Have you obtained positive cultures indicating general type? Yes. What type of infection is it? Primary bacteremia.

14 14 Mycin (2) When did symptoms first appear? May 5. Let’s call the most recent positive culture C1. From what site was C1 taken? From the blood. When? May 9. Let’s call the first significant organism from this culture U1. Do you know the identity of U1? No.

15 15 Mycin (3) Is U1 a rod or a coccus or something else? Rod. What is the gram stain of U1? Gram-negative. Have there been positive cultures from sites that are not associated with the infections about which you are seeking advice? No. Did U1 grow aerobically? Yes. …

16 16 Mycin (4) My recommendation will be based on the opinion that the identity of U1 may be 1. Pseudomonas-aeruginosa 2. Klebsiella-pneumoniae 3. E. coli 4. Bacteroides-fragilis 5. Enterobacter 6. Proteus-nonmirabilis

17 17 Mycin Rules M88: IF ?x’s type is primary bacteremia the suspected entry point of ?x is the gastrointentinal tract the site of the culture of ?x is one of the sterile sites THEN there is evidence that ?x is bacteroides

18 18 General Information

19 19 Bagger (1) B1: IF step is check-order potato chips are to be bagged there is no Pepsi to be bagged THEN ask the customer whether he would like a bottle of Pepsi B2: IF step is check-order DELETE step is check-order ADD step is bag-large-items

20 20 Bagger (2) B3: IF step is bag-large-items a large item is to be bagged the large item is a bottle the current bag contains less than 6 large items DELETE the large item is to be bagged ADD the large item is in the current bag

21 21 Bagger (3) B4: IF step is bag-large-items a large item is to be bagged the current bag contains less than 6 large items DELETE the large item is to be bagged ADD the large item is in the current bag

22 22 Bagger (4) B5: IF step is bag-large-items a large item is to be bagged an empty bag is available DELETE the current bag is the current bag ADD the empty bag is the current bag B6: IF step is bag-large-items DELETE step is bag-large-items ADD step is bag-medium-items

23 23 Bagger (5) B7: IF step is bag-medium-items a medium item is frozen, but not in a freezer bag DELETE the medium item is not in a freezer bag ADD the medium item is in a freezer bag

24 24 Bagger (6) B8: IF step is bag-medium-items a medium item is to be bagged the current bag is empty or contains only medium items the current bag contains less than 12 medium items DELETE the medium item is to be bagged ADD the medium item is in the current bag

25 25 Bagger (7) B9: IF step is bag-medium-items a medium item is to be bagged an empty bag is available DELETE the current bag is the current bag ADD the empty bag is the current bag B10: IF step is bag-medium-items DELETE step is bag-medium-items ADD step is bag-small-items

26 26 Bagger (8) B11: IF step is bag-small-items a small item is to be bagged the current bag is empty or contains only small items the current bag contains less than 18 small items DELETE the small item is to be bagged ADD the small item is in the current bag

27 27 Bagger (9) B12: IF step is bag-small-items a small item is to be bagged an empty bag is available DELETE the current bag is the current bag ADD the empty bag is the current bag B13: IF step is bag-small-items DELETE step is bag-small-items ADD step is done

28 28 Initial State 1. Step is check-order 2. Bread is to be bagged 3. Jam is to be bagged 4. Cornflakes are to be bagged 5. Ice cream is to be bagged 6. Potato chips are to be bagged 7. Bag1 is a bag

29 29 After B1 1. Step is check-order 2. Bread is to be bagged 3. Jam is to be bagged 4. Cornflakes are to be bagged 5. Ice cream is to be bagged 6. Potato chips are to be bagged 7. Bag1 is current bag 8. Pepsi is to be bagged

30 30 After B2 1’. Step is bag-large-items 2. Bread is to be bagged 3. Jam is to be bagged 4. Cornflakes are to be bagged 5. Ice cream is to be bagged 6. Potato chips are to be bagged 7. Bag1 is current bag 8. Pepsi is to be bagged

31 31 After B3 1’. Step is bag-large-items 2. Bread is to be bagged 3. Jam is to be bagged 4. Cornflakes are to be bagged 5. Ice cream is to be bagged 6. Potato chips are to be bagged 7. Bag1 is current bag 8’. Pepsi is in Bag1

32 32 After B4 1’. Step is bag-large-items 2. Bread is to be bagged 3. Jam is to be bagged 4’. Cornflakes are in Bag1 5. Ice cream is to be bagged 6. Potato chips are to be bagged 7. Bag1 is current bag 8’. Pepsi is in Bag1

33 33 After B6 1’’. Step is bag-medium-items 2. Bread is to be bagged 3. Jam is to be bagged 4’. Cornflakes are in Bag1 5. Ice cream is to be bagged 6. Potato chips are to be bagged 7. Bag1 is current bag 8’. Pepsi is in Bag1

34 34 After B7 1’’. Step is bag-medium-items 2. Bread is to be bagged 3. Jam is to be bagged 4’. Cornflakes are in Bag1 5. Ice cream is to be bagged 6. Potato chips are to be bagged 7. Bag1 is current bag 8’. Pepsi is in Bag1 9. Ice cream is in freezer bag

35 35 After B9 1’’. Step is bag-medium-items 2. Bread is to be bagged 3. Jam is to be bagged 4’. Cornflakes are in Bag1 5. Ice cream is to be bagged 6. Potato chips are to be bagged 7’. Bag2 is current bag 8’. Pepsi is in Bag1 9. Ice cream is in freezer bag

36 36 After B8 1’’. Step is bag-medium-items 2’. Bread is in Bag2 3. Jam is to be bagged 4’. Cornflakes are in Bag1 5. Ice cream is to be bagged 6. Potato chips are to be bagged 7’. Bag2 is current bag 8’. Pepsi is in Bag1 9. Ice cream is in freezer bag

37 37 After B8 1’’. Step is bag-medium-items 2’. Bread is in Bag2 3. Jam is to be bagged 4’. Cornflakes are in Bag1 5’. Ice cream is in Bag2 6. Potato chips are to be bagged 7’. Bag2 is current bag 8’. Pepsi is in Bag1 9. Ice cream is in freezer bag

38 38 After B8 1’’. Step is bag-medium-items 2’. Bread is in Bag2 3. Jam is to be bagged 4’. Cornflakes are in Bag1 5’. Ice cream is in Bag2 6’. Potato chips are in Bag2 7’. Bag2 is current bag 8’. Pepsi is in Bag1 9. Ice cream is in freezer bag

39 39 After B10 1’’. Step is bag-small-items 2’. Bread is in Bag2 3. Jam is to be bagged 4’. Cornflakes are in Bag1 5’. Ice cream is in Bag2 6’. Potato chips are in Bag2 7’. Bag2 is current bag 8’. Pepsi is in Bag1 9. Ice cream is in freezer bag

40 40 After B12 1’’. Step is bag-small-items 2’. Bread is in Bag2 3. Jam is to be bagged 4’. Cornflakes are in Bag1 5’. Ice cream is in Bag2 6’. Potato chips are in Bag2 7’’. Bag3 is current bag 8’. Pepsi is in Bag1 9. Ice cream is in freezer bag

41 41 After B11 1’’. Step is bag-small-items 2’. Bread is in Bag2 3’. Jam is in Bag3 4’. Cornflakes are in Bag1 5’. Ice cream is in Bag2 6’. Potato chips are in Bag2 7’’. Bag3 is current bag 8’. Pepsi is in Bag1 9. Ice cream is in freezer bag

42 42 R1 (XCON) IF the context is doing layout and assigning a power supply an SBI module of any type has been put in a cabinet the position that the SBI module occupies is known there is space available for a power supply there is no available power supply the voltage and frequency of the components are known THEN add an appropriate power supply

43 43 R1 (XCON) IF the context is doing layout and assigning a power supply an SBI module of any type has been put in a cabinet the position that the SBI module occupies is known there is space available for a power supply there is an available power supply THEN put the power supply in the cabinet in the available space

44 44 Valuable Facts 1. Comet is-a horse 2. Prancer is-a horse 3. Comet is-a-parent-of Dasher 4. Comet is-a-parent-of Prancer 5. Prancer is fast 6. Dasher is-a-parent-of Thunder 7. Thunder is fast 8. Thunder is-a horse 9. Dasher is-a horse

45 45 Valuable Rule IF ?x is-a horse ?x is-a-parent of ?y ?y is fast THEN ?x is valuable

46 46 Forward Chaining (1)

47 47 Forward Chaining (2)

48 48 Backward Chaining (1)

49 49 Backard Chaining (2)

50 50 More Valuable Information IF ?w is-a winner THEN ?w is fast 10. Dasher is-a winner 11. Prancer is-a winner

51 51 Backward Chaining (3)

52 52 Rete 1 2 Prancer 3 Comet Dahser 5 Comet Prancer 4 Comet Dahser 6 Comet Prancer 7 Prancer 8 Comet Prancer 9 Comet is valuable ?x is-a horse ?x is-a-parent-of ?y ?x is fast 10 Dasher Thunder 11 Thunder 12 Thunder 13 Dasher 14 Dasher Thunder 15 Dasher Thunder 16 Dasher 17 Dasher 18 Comet Dasher 19 =

53 53 Rete (2)

54 54 Rete (3)

55 55 Answering Questions

56 56 Goal Tree

57 57 Being Careful IF ?x is-a horse ?x is-a-parent of ?y ?y is fast ?x is fertile THEN ?x is valuable

58 58 Being Flexible IF ?x is-a horse ?x is-a-parent of ?y ?y is fast THEN ?x is valuable PROVIDED ?x is fertile UNLESS ?x is dead

59 59 Ask Specific Questions

60 60 Compare Similar Situations Frozen Peas

61 61 Knowledge Acquisition (Teiresias) Proposed Rule IF ?x stalks a different kind of animal THEN ?x is a carnivore Teiresias Excuse me, Prof. Winston, but did you know that most rules that conclude that an animal is a carnivore also have a condition that the animal is a mammal? Would you like me to add this condition for you?

62 62 Knowledge Acquisition (Teiresias) Typical Carnivore IF ?x is a mammal THEN ?x is a carnivore


Download ppt "1 Antecedent-Consequent Rules Rn:IF condition 1 condition 2... THEN consequent 1 consequent 2..."

Similar presentations


Ads by Google