Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please write an Expert System in CLIPS that computes the auto insurance premium

ID: 3887958 • Letter: P

Question

Please write an Expert System in CLIPS that computes the auto insurance premium based on the following knowledge:

A perfect driver (a driver with no risk) spends about $700 a year for a standard coverage. An individual’s insurance premium may be higher depending on the various risk factors explained in the following rules:

2. If a driver is 18 or younger or 75 or older then her age-risk-factor is 5%, otherwise the age-riskfactor is 0.

3. If the car costs less than or equal to $5000, then the price-factor is 0. If it costs between $5000- $20000, then the price-risk-factor is 5% and if it costs over $20000 then the price-risk-factor is 10%.

4. If the driver commutes less than or equal to 20 miles to work then her commute-risk-factor is 0, if she commutes somewhere between 20-50 miles then her commute-risk-factor is 2%, otherwise, her commute-risk-factor is 5%.

5. If the driver had accumulated less than or equal to 10 offense points in her deriving record then her offense-risk-factor is 0, if her accumulated points is anywhere between 10-20 points then her offense-risk-factor is 2% if she went over 20 offense points then her offense-risk-factor is 10%

6. If the driver has a good credit score (over 700 points) then her credit-risk-factor is 0. If her credit score is between 600-700 points, then her credit-risk-factor is 2%, otherwise if her credit score is less than or equal to 600, her credit-risk-factor is 5%.

7. The total-average-risk of a driver is computed as: (age-risk-factor + price-risk-factor + commute-risk-factor + offense-risk-factor +credit-risk-factor ) / 5

8. The insurance premium of a driver is computed as: 700 * (1+ Total-average-risk)

Now asserts the following facts about Sarah and Daniel in your fact base and let your CLIPS program compute their insurance premium according the above rules (1-8).

Sarah is 18.5 years old, she drives a $5000 car, she commutes 20 miles to work every day and has accumulated 10 points in her offense record. Sarah’s credit score is 700.5.

Daniel is 18 years old, he drives a $5001 car and commutes 20.5 miles to work every day. Daniel has accumulated 11 points in his offense record and his credit score is 700.

Explanation / Answer

CLIPS is a public-domain software tool for building expert systems. The name is an acronym for "C Language Integrated Production System." The syntax and name was inspired by Charles Forgy's OPS. The first versions of CLIPS were developed starting in 1985 at NASA-Johnson Space Center until the mid 1990s when the development group's responsibilities ceased to focus on expert system technology.

CLIPS is probably the most widely used expert system tool because it is fast, efficient and free. Although it is now in the public domain, it is still updated and supported by the original author, Gary Riley. CLIPS incorporates a complete object-oriented language "COOL" for writing expert systems. Though it is written in C, its interface more closely resembles that of the programming language LISP. Extensions can be written in C, and CLIPS can be called from C.

Like other expert system languages, CLIPS deals with rules and facts. Various facts can make a rule applicable. An applicable rule is then asserted. Facts and rules are created by first defining them, as shown below: