1 / 60

Antecedent-Consequent Rules

Antecedent-Consequent Rules. Rn: IF condition 1 condition 2 ... THEN consequent 1 consequent 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

Download Presentation

Antecedent-Consequent Rules

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Antecedent-Consequent Rules • Rn: IF condition 1 • condition 2 • ... • THEN consequent 1 • consequent 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. 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. 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. 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. 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. 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. 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. 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. Forward Chaining

  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. Backward Chaining

  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. 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. 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. 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. 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. General Information

  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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. Valuable Rule • IF ?x is-a horse • ?x is-a-parent of ?y • ?y is fast • THEN ?x is valuable

  46. Forward Chaining (1)

  47. Forward Chaining (2)

  48. Backward Chaining (1)

  49. Backard Chaining (2)

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

More Related