240 likes | 434 Views
The Inference Process. Rules There are two main forms of Inferencing Forward Chaining Backward Chaining. The Inference Process. Rules Rules follow an IF…THEN format English IF the pump’s temperature is hot THEN follow maintenance instructions Aion DS
E N D
The Inference Process • Rules • There are two main forms of Inferencing • Forward Chaining • Backward Chaining
The Inference Process • Rules • Rules follow an IF…THEN format • English IF the pump’s temperature is hot THEN follow maintenance instructions • Aion DS IFMATCH pump with temperature is “hot” THEN send (print maintenance to pump) END
The Inference Process • MYCIN (an expert system to diagnose blood disorders) • IF • the site of the culture is Blood AND • the identity of the organism is Unknown AND • the strain of the organism is Gramneg AND • the morphology of the organism is Rod AND • the patient has been seriously burned • THEN • there is weakly suggestive evidence (0.4) that the • identity of the organism is Pseudomonas
The Inference Process • Forward vs. Backward Chaining • Do we drive the inference process based on the known facts (data) or on the questions (goals) we need answers to? • Data Driven • Starts with the known data and fires rules to infer new information (forward chaining) • Goal Driven • Starts with the goal and tries to match facts to the solution (backward chaining)
The Inference Process • Forward Chaining 1 Enter new data 2 Fire forward chaining rules 3 Rule actions infer new data values 4 Go to step 2 5 repeat until no new data can be inferred 6 If no solution, rule base is insufficient
The Inference Process Forward Chaining 1 Add new data values to knowledge base Get some new data 4 Fire forward chaining rules 2 Infer new data values from rule actions 3
The Inference Process • Cascading Rules • Only applicable in forward chaining • Rule executes causing inference of new data • New data is added to the knowledge base • New data added causes other rules to fire • Can be very time consuming and inefficient in large systems
The Inference Process • Forward Chaining • The data is usually entered “up front” • Is usually done on a form by form basis • Relevant questions must be grouped together • Rules will only fire when all information is available • The inference engine will not try to find out any unknown information • All possible questions need to be asked at the start of a consultation
The Inference Process • Why Forward Chain? Reasons to Forward Chain Examples You want to know everything that can possibly be concluded about a set of data Monitoring for mechanical problems on a production line Scanning a new loan application for problem areas Many conclusions are possible from a single data item Filtering sensor data It is important to communicate new conclusions to the user immediately Advice to shut down faulty machines Data entry errors
The Inference Process • Backward Chaining 1 State a specific goal (question) 2 Find rules which resolve the goal 3 At runtime, answer questions to satisfy the antecedents of the rules as required 4 Obtain a result (goal resolved or not)
The Inference Process Backward Chaining 1 State primary goal to source Source sub goals Fire backward chaining rules 2 3 Primary goal sourced 4
The Inference Process • Why Backward Chain? Reasons to Backward Chain Examples There is a clear set of statements which must be confirmed or denied Which machine is causing the quality control problem? A large number of questions could be asked of the user, but typically only a few are necessary to resolve a situation Processing of a motor claim for vandalism; not necessary to know about personal injuries It is desirable to have interactive dialogue with the user Asking machine operator detailed questions about suspect machinery Rule execution depends on data gathering which may be expensive or difficult Real-time observations by the user
The Inference Process • Backward or Forward Chaining? • Criteria to consider - • The logical reasoning process • Design features of the system • What are the inputs and where do they come from? • What are the outputs and where do they go? • How do these map to forward or backward chaining?
The Inference Process • Examples Use Forward Chaining Use Backward Chaining Sensor indicates machine failure; want to find out what happens next Defect observed in product; want to locate faulty machine User types erroneous input for insurance claim; want to alert user Suspect an overpayment; want to check form for erroneous input Stock value suddenly drops; want to predict market response FTSE industrials drop; want to know which stocks will be affected
The Inference Process • Chaining in Action • A list of known facts - A, B, D, G, P, Q, R, S.
The Inference Process • Chaining in Action • A list of known facts - A, B, D, G, P, Q, R, S. Raining outside?
The Inference Process • Chaining in Action • A list of known facts - A, B, D, G, P, Q, R, S. Cold?
The Inference Process • Chaining in - X is the goal • A list of Rules 1 A + I => X 2 A+B => C 3 C+D => E 4 F+G => H 5 E+H => X 6 A+C => F 7 P+Q => R 8 R+S => T
The Inference Process • Chaining in Action (Backward) • A list of Rules 1 A + I => X 2 A+B => C 3 C+D => E 4 F+G => H 5 E+H => X 6 A+C => F 7 P+Q => R 8 R+S => T Rule 1 never fired because either “I” was not true or the user did not know it was true Rules 7+8 never fired because they were not relevant to proving our goal of “X”, though they may have been used if we had another consultation with a different goal
The Inference Process • Chaining in Action (Forward) • A list of known facts - “A, B, D, P, Q, R, S”, are all true (we asked the user) and “I” is false or not known
The Inference Process • Chaining in Action (Forward) • A list of Rules 1 A + I => X 2 A+B => C 3 C+D => E 4 F+G => H 5 E+H => X 6 A+C => F 7 P+Q => R 8 R+S => T
The Inference Process • Chaining in Action (Forward) • A list of Rules 1 A + I => X 2XA+B => C 3XC+D => E 4 F+G => H 5 E+H => X 6XA+C => F 7XP+Q => R 8XR+S => T
The Inference Process • Backward or Forward Chaining? • Backward chaining was more focused but only answered the question asked • Forward chaining found all possible results but needed more information “up front” • Backward chaining never used rules 7 and 8