1 / 12

Using Rules

Using Rules. Chapter 6. Logic Programming. (Definite) logic program: A  B 1 , B 2 , …, B m program clause (Horn) head body  A 1 , A 2 , …, A n goal clause. Logic Programming. PROLOG (Alain Colmerauer 1972): apartmentpet(X) :- pet(X), small(X) pet(X) :- cat(X)

vic
Télécharger la présentation

Using Rules

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. Using Rules Chapter 6

  2. Logic Programming (Definite) logic program: A  B1, B2, …, Bm program clause (Horn) headbody  A1, A2, …, An goal clause

  3. Logic Programming PROLOG (Alain Colmerauer 1972): apartmentpet(X) :- pet(X), small(X) pet(X) :- cat(X) pet(X) :- dog(X) dog(X) :- poodle(X) small(X) :- poodle(X) poodle(fluffy) pet(mittens) ?- apartmentpet(X)

  4. Forward vs. Backward Reasoning • Forward: from the start states. • Backward: from the goal states.

  5. Forward vs. Backward Reasoning • Forward rules: to encode knowledge about how to respond to certain input. • Backward rules: to encode knowledge about how to achieve particular goals.

  6. Forward vs. Backward Reasoning Combining forward and backward reasoning  A1, …, Ak-1, Ak, Ak+1, …, An achieved by achieved by forward reasoning backward reasoning

  7. Production Systems Working memory: {A(1), A(2), B(2), B(3), B(4), C(5)} Rule memory: A(x)  B(x)  C(y)  add D(x) A(x)  B(y)  D(x)  add E(x) A(x)  B(x)  E(x)  delete A(x)

  8. Production Systems RETE network (Forgy, 1982) D A=D add E A B A=B C add D C(5) D(2) A(1), A(2) B(2), B(3), B(4) A(2) B(2) E delete A

  9. Production Systems Conflict resolution: Preferences based on rules: Specificity of rules Physical order of rules Preferences based on objects: Importance of objects Position of objects Preferences based on states: Evaluation of states

  10. Matching ELIZA (Weizenbaum, 1966): Person: Men all are alike. ELIZA: In what way? Person: They're always bugging us about something or other. ELIZA: Can you think of specific example? Person: Well, my boyfriend made me come here. ELIZA: Your boyfriend made you come here. Person: He says I'm depressed much of the time. ELIZA: I am sorry to hear you are depressed. Person: It's true. I am unhappy. ELIZA: Do you think coming here will help you not to be unhappy?

  11. Matching ELIZA (Weizenbaum, 1966): Person: I need some help, that much seems certain. ELIZA: What would it mean to you if you got some help? Person: Perhaps I could learn to get along with my brother. ELIZA: Tell me more about your family. ....

  12. Matching ELIZA (Weizenbaum, 1966): (X me Y)  (X you Y) (I remember X)  (Why do you remember X just now?) (My {family-member} is Y)  (Who else in your family is Y?) (X {family-member} Y)  (Tell me more about your family) .... Person: My brother is mean to me. ELIZA: Who else in your family is mean to you? ....

More Related