Sie sind auf Seite 1von 5

Expert Systems Tutorial 1

I) Propositional Logic (i) (A B) (B A) (ii) (A B) (A B) (iii) (A (B A)) (iv) (A(B ((A C) (A B)) C)) (v) ((A B ) (B C)) ( ((A B) C) ((A B ) B)) Determine the models (interpretation of the variables for which the expression is true) for these three wffs. Which expression is a Tautology, Satisfiable, Insatisfiable. Use a truth table for (i) (ii)and truth tree for (ii), (iii) and (iv). II) Loan Granter System Assume we have the following variables intended to denote the associated proposition. - OK (the loan should be approved) - COLLAT (the collateral for the loan is satisfactory) - PYMT (the applicant is able to make the loan payments) - REP (the applicant has a good financial reputation) - APP (the appraisal of the collateral is sufficiently greater than the loan amount) - RATING (the applicant has a good credit rating) - INC (the applicant's income exceeds his/her expenses) - BAL (the applicant has an excellent balance sheet) (a ) Express the following rules using Production rules. R1: The loan should be approved if the applicant has a good financial reputation, he is able to make the loan payments and the collateral for the loan is satisfactory. R2: The collateral for the loan is satisfactory when its appraisal is sufficiently greater than the loan amount. R3: If the applicant has a good credit rating then he has a good financial reputation. R4: The loan is granted when the applicant has an excellent balance sheet, and a good financial reputation. R5: If the applicant's income exceeds his/her expenses, he should be able to make the loan payments. R6: The applicant has an excellent balance sheet when he is able to make the loan payments. R7: The applicant has a good credit rating if the collateral for the loan is satisfactory (b) A customer applies for a loan. Its income exceeds his/her expenses and the appraisal of the collateral is sufficiently greater than the loan amount. Shall we approve the loan? (i) Propose two resolutions using Backward Chaining, and Forward Chaining. (ii) Explain the advantages/drawbacks of each method. What is the most appropriate method for our problem. (iii) Implement a simple Loan Granter System using CLIPS. (for Week 4)

III) Stud Farm Knowledge Based System Assume we have the following facts. - Comet is-a horse - Prancer is-a horse - Comet is-a-parent-of Dasher - Comet is-a-parent-of Prancer - Prancer is winner - Dasher is-a-parent of Thunder - Thunder is winner - Thunder is-a horse - Dasher is-a horse Furthermore we have the following rules that allows to deduce fast and valuable horses: R1: if x is-a horse x is-parent-of y y is-a winner then x is fast R2: if x is fast then x is valuable We wish to know what are the valuable horses in the stud farm. (i) Explain the Principles of Backward Chaining, and Forward Chaining and example of use. You may make use of a simple example to illustrate them. (ii) (iii) Propose two resolutions using Backward Chaining, and Forward Chaining. What is the most appropriate method for our problem, and why (two reasons).

Solutions
I) Propositional Logic
A B (A B) (B A) (A B) (B A) (i) (A B) (A B) (ii)

0 0 1 1 (iii)

0 1 0 1

1 0 1 0

1 0 1 1

1 1 1 1
Tautology

0 0 0 1
Satisfiable

(A (B A)) A=0 A=1

(0 (B 0)) (1 (B 1)) (0 (0)) (1 (1)) (1) (1) 0 0 Insatisfiable

(iv)
(A (B C)) ((A C) (A B)) A=0 A=1

(0 (B C)) ((0 C) (0 B)) (1 (B C)) ( (1 C) (1 B)) ((B C)) (C B) ) (1) ( (1) (1)) 1 1 Tautology

(v)
((A B ) (B C)) ( ((A B) C) ((A B ) B)) B=0 ((A 0 ) (0 C)) ( ((A 0) C) ((A 0 ) 0)) ((0 ) (C)) ( ((0) C) ((0 ) 0)) (0) ( (0) ((0)) (0) (0) 1 B=1 ((A 1 ) (1 C)) ( ((A 1) C) ((A 1 ) 1)) ((A) (1)) ( ((A) C) ((A))) (A) ( (A C) A)) A=0 A=1 (0) ( (0 C) 0)) (0) ( (0) 0)) 1 (1) ( (1 C) 1)) (1) ( (C) 1)) 1

Tautology

II) Stud Farm Knowledge Based System - Explain the Principles of Backward Chaining, and Forward Chaining and their advantages/drawbacks. Forward chaining
Consider the following set of rules Rule 1: IF A and C Rule 2: IF A and E Rule 3: IF B Rule 4: IF G THEN F THEN G THEN E THEN D

Suppose it needs to be proved that D is true, given A and B are true. Start with Rule 1 and go on down till a rule that ``fires'' is found. In this case, Rule 3 is the only one that fires in the first iteration. At the end of the first iteration, it can be concluded that A, B and E are true. This information is used in the second iteration. This time Rule 2 fires adding the information that G is true. This extra information causes Rule 4 to fire, proving that D is true. This is the method of forward chaining, where one proceeds from a given situation toward a desired goal, adding new assertions along the way. In expert systems, this strategy is especially appropriate in situations where data are expensive to collect, but few in quantity.

Backward chaining
In this method, one starts with the desired goal, and then attempts to find evidence for proving the goal. Returning to the previous example, the strategy to prove that D is true would be as follows. First, find a rule that proves D. Rule 4 does so. This provides a sub-goal -- to prove that G is true. Now Rule 2 comes into play, and as it is already known that A is true, the new sub-goal is to show that E is true. Here, Rule 3 provides the next sub-goal of proving that B is true. But the fact that B is true is one of the given assertions. Therefore, E is true, which implies that G is true, which in turn implies that D is true. Backward chaining is useful in situations where the quantity of data is potentially very large and where some specific characteristic of the system under consideration is of interest. Typical situations are various problems of diagnosis, such as medical diagnosis or fault-finding in electrical equipment.

What is the most appropriate method for our problem

- Propose two resolutions using Backward Chaining, and Forward Chaining. Forward Chaining:
x is-a horse
x Comet x Prancer x Thunder x Dasher

x is-a-parent-of y
y x Dasher Comet y x Prancer Comet y x Thunder Dasher

y is winner
y x Prancer Comet y x Thunder Dasher

y x

Prancer Comet

y x

Thunder Dasher

x is fast

y x

Prancer Comet

y x

Thunder Dasher

x is valuable

Backward Chaining:

z z x z y z Dasher Comet x y x z y x z w Dasher y Dasher x Comet z x w Dasher y Dasher x Comet z x x z Prancer Comet x Prancer x

x x

z is valuable z is fast x is-a horse x Thunder z x x z Dasher x x is-a-parent-of y

y Thunder x z y Thunder x z w Prancer y Prancer x Comet z x w Prancer y Prance x Comet z x Dasher x w Thunder y Thunder x Dasher z x Dasher x

x Comet x

y is fast Prancer Comet x

w is fast

w is-a winner

Das könnte Ihnen auch gefallen