Question: This is done in CLIPS programming language: This will be a modification of the advising problem above and will give you a chance to use

This is done in CLIPS programming language:

This will be a modification of the advising problem above and will give you a chance to use a control fact and to do pattern matching with variables and wildcards. We will assume that no course has more than one prerequisite. Here are the advisors rules:

If student has taken COP1000, student should take COP2000.

If student has taken COP1001, student should take COP2001.

If student has taken MAC1000, student should take MAC2000.

If student has taken MAC1001, student should take MAC2001.

If student has taken ENG1000, student should take ENG2000.

Well solve the problem differently this time by creating a deffacts construct that contains the above information:

(deffacts prerequisites

(after COP1000 take COP2000)

(after COP1001 take COP2001)

(after MAC1000 take MAC2000)

(after MAC1001 take MAC2001)

(after ENG1000 take ENG2000))

Then we will assert a fact like the following about a particular student:

(student George has taken COP1000 MAC1000 ENG1000)

The expert system should respond back with advice for that student.

You are to construct two rules to perform the job of this advisor. Put your two rules in a file called problem2.CLP (and include the deffacts construct at the beginning of that file). I have provided some sample executions to demonstrate the way that your rules should behave. Please have your rules behave exactly like mine, with precisely the same output, the same order and the same spacing. I expect your rules to be dumb in that they should recommend a course be taken (if the prerequisite is satisfied), even if the student has already taken that course (note the sample execution where the student has taken COP1000 and COP2000). We will see later in the term how to make our rules more intelligent, but please dont do that here have your rules behave exactly like mine. (6 points)

SAMPLE EXECUTIONS:

CLIPS>

(you load the deffacts construct and your two rules from problem2.CLP here)

CLIPS> (reset)

CLIPS> (run)

Welcome to the advising system.

CLIPS> (reset)

CLIPS> (assert (student George has taken COP1000 MAC1000 ENG1000))

CLIPS> (run)

Welcome to the advising system.

Since George has taken COP1000, I suggest taking COP2000. {order not critical}

Since George has taken MAC1000, I suggest taking MAC2000.

Since George has taken ENG1000, I suggest taking ENG2000.

CLIPS> (reset)

CLIPS> (assert (student Mary has taken ENG1000 MAC1000 COP1000))

CLIPS> (run)

Welcome to the advising system.

Since Mary has taken ENG1000, I suggest taking ENG2000. {order not critical}

Since Mary has taken MAC1000, I suggest taking MAC2000.

Since Mary has taken COP1000, I suggest taking COP2000.

CLIPS> (reset)

CLIPS> (assert (student Rufus has taken nothing))

CLIPS> (run)

Welcome to the advising system.

CLIPS> (reset)

CLIPS> (assert (student George has taken COP1001 MAC1001 ENG1001))

CLIPS> (run)

Welcome to the advising system.

Since George has taken COP1001, I suggest taking COP2001. {order not critical}

Since George has taken MAC1001, I suggest taking MAC2001.

CLIPS> (reset)

CLIPS> (assert (student Dudley has taken COP1000 COP2000))

CLIPS> (run)

Welcome to the advising system.

Since Dudley has taken COP1000, I suggest taking COP2000.

CLIPS>

Note: it IS important that the welcome message come before the advice.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!