1 / 20

Inference Reasoning

Inference Reasoning. Forward Chaining. Backward chaining. 1. Show how to use backward chaining, forward chaining for the following example and construct an Inference Tree.

fsnook
Download Presentation

Inference Reasoning

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Inference Reasoning

  2. Forward Chaining

  3. Backward chaining

  4. 1. Show how to use backward chaining, forward chaining for the following example and construct an Inference Tree Here is an example involving an investment decision: whether to invest in IBM stock. The following varibles are used: A= Have $10,000, B= Younger than 30, C = Education at college level, D= Annual income of at least $40,000, E= Invest in securities, F= Invest in growth stocks, G= Invest in IBM stock Each of these variables can be answered as true or false. The facts: We assume that an investor has $10,000( A is true) and that she is 25 years old ( B is true). She would like advice on investing in IBM stock ( Yes or no for the goal). The rules: Our knowledge base contains five rules: • R1: If A and C, Then E. • R2: If D and C, Then F. • R3: If B and E, Then F. • R4: If B Then C • R5: If F, Then G Our goal is to determine whether to invest in IBM Stock.

  5. Solution: Backward chaining • Start: We start by looking for a rule that includes the goal(G) in its conclusion ( THEN part). Because, R5 is the only rule that qualifies, we start with it. • Step1: Try to accept or reject G. The ES goes to the assertion base to see whether G is there. Since we have in the assertion base : A is true, B is true, ES proceeds to step 2 • Step 2: R5 traces G to F. F is a premise of R5 is the conclusion of R2 and R3. There to check whether F is true, we need to check either of these two rules. • Step 3: We try R2 first; if both D and C are true, then F is true. Since D is not a conclusion of any rule, ES tries to find out the whether D is true by asking a question to the investor. • Step 4: ES does a backtracking and goes to R3: test B and E. We know that B is true because it is a given fact. To prove E, we go to R1, where E is the conclusion. • Step 5: Examine R1. It is necessary to determine whether A and C are true. • Step 6: A is true because it is a given fact. To test C, it is necessary to test R4. • Step 7: R4 tells us that C is true. Therefore C becomes a fact . Now E is true, which validates F which validates the goal.

  6. Forward Chaining Systems • The actions will result in a new working memory, and the cycle begins again. • This cycle will be repeated until either no rules fire, or some specified goal state is satisfied. • Rule-based systems vary greatly in their details and syntax, so the following examples are only illustrative

  7. IF (lecturing X) AND (marking-practicals X) THEN ADD (overworked X) • IF (month february) THEN ADD (lecturing ali) • IF (month february) THEN ADD (marking-practicals ali) • IF (overworked X) OR (slept-badly X) THEN ADD (bad-mood X) • IF (bad-mood X) THEN DELETE (happy X) • IF (lecturing X) THEN DELETE (researching X)

  8. Example • Let us assume that initially we have a working memory with the following elements • (month february) (happy ali) (researching ali) • Rules 2 and 3 both apply, so the system has to choose between them, using its conflict resolution strategies. • Let us say that rule 2 is chosen. So, (lecturing ali) is added to the working memory

  9. Example • (lecturing ali) (month february) (happy ali) (researching ali) • Now the cycle begins again • This time rule 3 and rule 6 have their preconditions satisfied • Lets say rule 3 is chosen and fires, so (marking-practicals ali) is added to the working memory • On the third cycle rule 1 fires, so, with X bound to ali, (overworked ali) is added to working memory which is now:

  10. Example • (overworked ali) (marking-practicals ali) (lecturing ali) (month february) (happy ali) (researching ali) • Now rules 4 and 6 can apply. Suppose rule 4 fires, and (bad-mood ali) is added to the working memory. • And in the next cycle rule 5 is chosen and fires, with (happy ali) removed from the working memory.

  11. Example • Finally, rule 6 will fire, and (researching ali) will be removed from working memory, to leave: • (bad-mood ali) (overworked ali) (marking-practicals ali) (lecturing ali) (month february) The order that rules fire may be crucial, especially when rules may result in items being deleted from working memory.

  12. A number of conflict resolution strategies are typically used to decide which rule to fire • Don't fire a rule twice on the same data. (We don't want to keep on adding (lecturing ali) to working memory). • Fire rules on more recent working memory elements before older ones. This allows the system to follow through a single chain of reasoning, rather than keeping on drawing new conclusions from old data.

  13. Fire rules with more specific preconditions before ones with more general preconditions. This allows us to deal with non-standard cases. If, for example, we have a rule ``IF (bird X) THEN ADD (flies X)'' and another rule ``IF (bird X) AND (penguin X) THEN ADD (swims X)'' and a penguin called tweety, then we would fire the second rule first and start to draw conclusions from the fact that tweety swims.

  14. Forwards vs Backwards Reasoning • Whether you use forward or backwards reasoning to solve a problem depends on the properties of your rule set and initial facts. • Sometimes, if you have some particular goal (to test some hypothesis), then backward chaining will be much more efficient, as you avoid drawing conclusions from irrelevant facts.

  15. However, sometimes backward chaining can be very wasteful - there may be many possible ways of trying to prove something, and you may have to try almost all of them before you find one that works. • Forward chaining may be better if you have lots of things you want to prove • when you have a small set of initial facts; and when there tend to be lots of different rules which allow you to draw the same conclusion • Backward chaining may be better if you are trying to prove a single fact, given a large set of initial facts, and where, if you used forward chaining, lots of rules would be eligible to fire in any cycle.

  16. Basic Types of Inferences: Deduction • Deduction:Derive a conclusion from given axioms (“knowledge”) and facts (“observations”). • Example: All humans are mortal. (axiom) Socrates is a human. (fact/premise) Therefore, Socrates is mortal. (conclusion) • The conclusion can be derived by applying the modus ponens inference rule (Aristotelian logic). • Theorem proving is based on deductive reasoning techniques. WANG Huaping Shandong University Scientific Research Methodology 2011

  17. Basic Types of Inferences: Induction • Induction:Derive a general rule (axiom) from background knowledge and observations. • Example: Socrates is a human (background knowledge) Socrates is mortal (observation/ example) Therefore, I hypothesize that all humans are mortal (generalization) • Remarks: • Induction means to infer generalized knowledge from example observations: Induction is the inference mechanism for learning. WANG Huaping Shandong University Scientific Research Methodology 2011

  18. Basic Types of Inferences: Abduction • Abduction:From a known axiom (theory) and some observation, derive a premise. • Example: Socrates is mortal (observation) All humans are mortal (theory) Therefore, Socrates must have been a human (explanation) • Remarks: • Abduction is typical for explanation. • If one has the flue, one has moderate fewer. • Patient X has moderate fewer. • Therefore, he has the flue. • Strong relation to causation WANG Huaping Shandong University Scientific Research Methodology 2011

  19. Comparing abduction, deduction, and induction A => B A --------- B Deduction: major premise: All balls in the box are black minor premise: These balls are from the box conclusion: These balls are black Abduction: rule: All balls in the box are black observation: These balls are black explanation: These balls are from the box Induction: case: These balls are from the box observation: These balls are black hypothesized rule: All ball in the box are black A => B B ------------- Possibly A Whenever A then B ------------- Possibly A => B Deductionreasons from causes to effects Abduction reasons from effects to causes Induction reasons from specific cases to general rules

More Related