Bagger (Winston 1984)
An expert system to pack grocery bags at supermarket checkouts. The task can be broken down into four major stages:
Rules
Rule B1 IF step is check-order
there is bag of potato chips
there is no soft drink bottle
THEN add one bottle of Pepsi to order
Rule B2 IF step is check-order
THEN discontinue check-order-step
start bag-large-items step
Rule B3 IF step is bag-large-items
there is large item to be bagged
there is large bottle to be bagged
there is bag with less than 6 large items
THEN put large item in bag
Rule B4 IF step is bag-large-items
there is large item to be bagged
there is bag with less than 6 large items
THEN put large item in bag
Rule B5 IF step is bag-large-items
there is large item to be bagged
THEN start fresh bag
Rule B6 IF step is bag-large-items
THEN discontinue bag-large-items
start bag-medium-items step
Rule B7 IF step is bag-medium-items
there is medium item to be bagged
there is empty bag or bag with medium items
bag is not yet full
medium item is frozen
medium item is not in freezer bag
THEN put medium item in freezer bag
Rule B8 IF step is bag-medium-items
there is medium item to be bagged
there is empty bag or bag with medium items
bag is not yet full
THEN put medium item in bag
Rule B9 IF step is bag-medium-items
there is medium item to be bagged
THEN start fresh bag
Rule B10 IF step is bag-medium-items
THEN discontinue bag-medium-items
Rule B11 IF step is bag-small-items
there is small item to be bagged
there is bag that is not yet full
bag does not contain bottles
THEN put small item in bag
Rule B12 IF step is bag-small-items
there is small item to be bagged
there is bag that is not yet full
THEN put small item in bag
Rule B13 IF step is bag-small-items
there is small item to be bagged
THEN start fresh bag
Rule B14 IF step is bag-small-items
THEN discontinue bag-small-items
stop