Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We have a rule-based system (BAGGER) to bag groceries in the manner of a supermarket checkout clerk. We are not interested in optimal packing, but

We have a rule-based system (BAGGER) to bag groceries in the manner of a supermarket checkout clerk. We are not interested in optimal packing, but we do want BAGGER to know some of the fundamentals of grocery bagging, i.e., big bottles of cola (Pepsi) go in the bottom, with not too many in any one bag; ice cream is protected with freezer bags; and little things are stuffed here and there. BAGGER has 4 steps as shown below:

image text in transcribedimage text in transcribedimage text in transcribed

We have a rule-based system (BAGGER) to bag groceries in the manner of a supermarket checkout clerk. We are not interested in optimal packing, but we do want BAGGER to know some of the fundamentals of grocery bagging, i.e., big bottles of cola (Pepsi) go in the bottom, with not too many in any one bag; ice cream is protected with freezer bags, and little things are stuffed here and there. BAGGER has 4 steps as shown below: 1. Check what the customer has selected, looking over the groceries to see if something may be missing, with a view toward suggesting additions to the customer. 2. Bag the large items, with special attention to putting bottles in first. 3. Bag the medium items, taking care to put frozen things in freezer bags. 4. Bag the small items, putting them whenever there is room. And, of course, whenever necessary BAGGER starts a fresh bag. BAGGER contains information about the items in each bag, the items yet to be bagged, and the current step. BAGGER contains step names. Each of the attached rules tests the step name. Simulate the BAGGER procedure using the following property list and shopping list. Assume two medium items or three small items take the same room as one large item. Indicate items put in a freezer bag. a Item Bread Glop Granola Ice cream Paper towels Pepsi Popsicles Potato chips Container Type Plastic bag Jar Cardboard box Cardboard carton Plastic bag Bottle Cardboard carton Plastic bag Size Medium Small Large Medium Large Large Small Medium Frozen No No No Yes No No Yes No Step: Check-order Bagl: Unbagged: Bread (3) Glop (2) Ice cream (2) Paper towels (4) Pepsi (4) Popsicles (1) Rule Bl IF step is check-order Rule B7 IF step is bag-medium-items there is bag of potato chips there is medium item to be bagged there is no soft drink bottle there is empty bag or bag with medium items THEN add one bottle of Pepsi to order bag is not yet full Rule B2 IF step is check-order medium item is frozen THEN discontinue check-order-step medium item is not in freezer bag start bag-large-items step THEN put medium item in freezer bag Rule B3 IF step is bag-large-items. Rule BS IF step is bag-medium-items there is large item to be bagged there is medium item to be bagged there is large bottle to be bagged there is empty bag or bag with medium items there is bag with less than 6 large items bag is not yet full THEN put large item in bag THEN put medium item in bag Rule step is bag-large-items Rule B9 IF step is bag-medium-items there is large item to be bagged there is medium item to be bagged there is bag with less than 6 large items THEN start fresh bag THEN put large item in bag Rule B10 IF step is bag-medium-items. Rule B5 IF step is bag-large-items. THEN discontinue bag-medium-items. there is large item to be bagged Rule B11 IF step is bag-small-items THEN start fresh bag there is small item to be bagged Rule B6 IF step is bag-large-items. there is bag that is not yet full THEN discontinue bag-large-items bag does not contain bottles start bag-medium-items step 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 Step is stop

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Systems For Physicians And Medical Professionals How To Use And Access Databases

Authors: Harley Bjelland

1st Edition

1878487442, 9781878487445

More Books

Students also viewed these Databases questions