1 / 58

Chapter 5 Information Processing and Utilization Section 3

Chapter 5 Information Processing and Utilization Section 3 Theorem Proving. 1. Terminology 1) Atom A proposition/predicate that can not be decomposed into other proposition/predicate is an atom. 2) Literal

olina
Télécharger la présentation

Chapter 5 Information Processing and Utilization Section 3

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. Chapter 5 Information Processing and Utilization Section 3 Theorem Proving

  2. 1. Terminology 1) Atom A proposition/predicate that can not be decomposed into other proposition/predicate is an atom. 2) Literal Atom and the negated atom are called literals. 3) Clause A number of literals connected only by disjunctive symbols are called clauses. 4) Term Constant, variable, function are called terms. 5) Well formed formula (wff) Any legal expressions/formulas are called wffs.

  3. 6) An interpretation of a formula is an assignment of a truth value to every atom of the formula. A formula containing n distinct atoms has 2 distinct interpretations. Under each interpretation, a formula can be evaluated to be true or false. 7) An interpretation is said to satisfy a formula iff it can make the formula true . 8) A formula is valid iff true under all its interpretations 9) A formula is inconsistency iff it is false under all its interpretations. 10) A formula is consistent iff it is not inconsistent. A consistent formula is true under at least one interpretation. n

  4. 11) Formula G is said to be a logical consequence of formulas F1, …, Fn iff every interpretation that satisfies (F1∧F2∧... ∧Fn) also satisfies G. 12) Rules of inference are operations, in the logic, which can be applied to certain Wffs and sets of Wffs to produce new Wffs. Modus Ponens: P(x), P(x) →Q(x)  Q(x) Universal Specialization: (x)P(x), A  P(A) 13) Theorems: Wffs as a logic consequence derived from ones by inference rules applications. 14) Proof of a theorem: The sequence of inference rules applications used in new Wffs derivation.

  5. 2. Preliminary Knowledge (a) Unification: process of finding substitutions, {s}, of terms for variables, {t/v}, to make expressions identical. A substitution instance of an expression E is obtained by substituting terms for variables in that expression and denoted by Es. A set of expressions {Ei} is said unifiable if there exists a substitution s such that E1s = E2s = … = Ens, and s is said to be a unifier of {Ei}. The most general (simplest) unifier of {Ei} is denoted by mgu.

  6. (b) Process for Conversion of Wff to Clause Form (1) Eliminate implication symbols (2) Reduce scopes of negation symbols (3) Standardize variables (4) Eliminate existential quantifiers (5) Convert to prenex form (6) Put matrix in conjunctive normal form (7) Eliminate universal quantifiers (8) Eliminate conjunction symbols (9) Rename variables

  7. 3.Resolution Principle (RP) (a) Concept: RP is a procedure that produces proofs by refutation. To prove a statement, RP attempts to show that the negation of the statement produces a contradiction with the known statement. (b) RP in Propositional Logic Given premises S and a conclusion G to be proved. (1) Convert all the propositions of S to clause form. (2) Negate G and then convert into clause form, add it to the set of clauses obtained in (1).

  8. (3) Repeat until either a contradiction is found or no progress can be made: (a) Select two clauses c and c , the parent clauses. (b) Resolve c and c , the resulting clause, called the resolvent, r , will be the disjunction of all the literals of both the parent clauses with the following exception: If there are any pair of literal L and L, such that one of the parent clauses contains L and the other contain L, then delete L and L from the resolvent. (c) If the resolvent is the empty clause, NIL, then a contradiction has been found. If it is not, then add it to the set of clauses available to the procedure. i j i j ij i j

  9. Examples 1: Parent Clauses Resolvent plm …, pno … lmno… p, pq q (MP) pq, pq qq = q (Merge) pq,  p q qq, p p (Taotology) p, p NIL (Empty) pq, qr pr (chaining)

  10. Example 2: Given Premises Convert to Clause Form p p (1) (pq)r  p  q r (2) (st) q  s  q (3)  t  q (4) Conclusion: t t (5) Negated Goal  r (6) RP: (2,6)  p   q (7) (1,7)  q (8) (4,8)  t (9) (5,9) NIL (10)

  11. This is a contradiction among the premises and the negated conclusion. The premises are known valid. Therefore the invalid component must be the negated conclusion. In other words, the conclusion should be the logic consequence of the premises.

  12. 4. RP in Predicate Logic Given: a set of premises S and a conclusion G to be proved. (1) Convert S to clause form. (2) Negate G and then convert to clause form. Add it to the set of clauses obtained in (1). (3) Repeat until either a contradiction is found, or no progress can be made, or a predetermined amount of effort has been expanded: (a) Select two clauses c (x) and c (x), the parent ones. (b) Resolve c (x) and c (x): (i) If there is P(x) in c (x) and  P(x) in c (x), the resolvent will be the disjunction of c (x) and c (x) with P(x) and  P(x) disappeared. i j i j i j i j

  13. (ii) If there is a pair of literals L (x) and  L (x) such that one of the parent clause contains L (x) and the other contains L (x), and if L (x) and L (x) are unifiable, then by using unification make them identical, and the resolvent will be the disjunction of c (x) and c (x) with appropriate substitution performed and with L (x) and L (x) disappeared. (c) If the resolvent is NIL, a contradiction is found; If not, add it to the set of clauses available to the procedure. i j i i j j i j i j

  14. Example 1 S: Whoever cab read is literate. (x) (R(x)  L(x)) Dolphins are not literate. (x)(D(x)   L(x)) Some Dolphins are intelligent. (x) (D(x) I(x)) G: Some who are intelligent cannot read. (x) (I(x)   R(x)) Proof:S: 1.R(x)  L(x) (Premise) 2.  D(y) L(y) (Premise) 3a. D(A) (Premise) 3b. I(A) (Premise)  G: 4.I(z)  R(z) (Negated Conclusion) 5.R(A) {A/z} (3b, 4; R) 6. L(A) {A/z} (5, 1; R) 7.  D(A) {A/z} (6, 2; R) 8. NIL (7, 3a; R)

  15. Example 2 S: Man are mortal. (x) (MAN(x)  MORTAL(x)) Socrate is a man. MAN(SOCRATE) G: Socrate is mortal. MORTAL(SOCRATE) Proof: S: 1.MAN(x) MORTAL(x)(Premise) 2. MAN(S) (Premise)  G: 3. MORTAL(S) (Negated Conclusion) 4. MAN(S), {S/x} (1, 3; R) 5. NIL (2, 4; R)

  16. Refutation Tree MORTAL(S) MAN(x)  MORTAL (x) {S/x}  MAN(S) MAN(S) NIL

  17. Example 3 Theorem: The inner alternate angles of a trapezoid are equal. Symbols: 1. T(x,y,u,v) denotes a trapezoid: xyuv 2. P(x,y,u,v): xy//uv 3. E(x,y,v,u,v,y): ∠xyv = ∠uvy a (x) b (y) d (v) c (u)

  18. S: Premises 1. (x)(y)(u)(v) (T(x,y,u,v)  P(x,y,u,v)) 2. (x)(y)(u)(v) (P(x,y,u,v)  E(x,y,v,u,v,y)) 3. T(a,b,c,d) G: Theorem 4. E(a,b,d,c,d,b) Proof: 1. T(x,y,u,v)  P(x,y,u,v) (Premise) 2.  P(x,y,u,v)  E(x,y,v,u,v,y) (Premise) 3. T(a,b,c,d) (Premise) 4. E(a,b,d,c,d,b) (Negated Conclusion) 5. P(a,b,c,d) {a/x, b/y, c/u, d/v} (2,4) 6. T(a,b,c,d) {a/x, b/y, c/u, d/v} (1,5) 7. NIL (3,6) a b c d

  19. 6. Answer Extraction System -- A Modified Version Example: S: If Fido goes wherever John goes (x) (AT(J, x)  AT(F, x)) and if John is at School. AT(J, S) G: Where is Fido? (x) (AT(F, x)) A Refutation Tree Approach: AT(F, x) AT(J, y)AT(F, y) {x/y} G AT(J, x) AT(J, S) {S/y} NIL

  20. A Proof Tree Approach  G  G AT(F, x)  AT(F, x) AT(J, y)  AT(F, y) {x/y} AT(J, S)  AT(J, x)  AT(F, y) {S/x} AT(F, S) The Answer

  21. Chapter 5 Information Processing & utilization Section 4 Rule-Based Deduction Systems

  22. 1. Introduction Rule-based Deduction Systems do not convert wffs to clause forms as the latter forms would lose information: A B C =  (A B)  C =  (A  C)  B = … Wffs representing assertion knowledge are separated into two categories: (1) The rules expressed in implication form; (2) The facts expressed in AND/OR form. The task of the production system here is to prove a goal from these facts and rules.

  23. 2. A Forward Deduction System (1) Obtaining AND/OR form from Arbitrary Forms -- Eliminate Implication symbols; -- Minimize the scope of negation symbols; -- Skolemize; * Variables within the scopes of universal quantifiers are standardized by renaming: variables in different conjunctions have different names; * Existentially quantified variables are replaced by Skolem functions; * The universal quantifiers are dropped; * Any remaining variables are assumed to have universal quantification.

  24. Example: Given a wff below: (u) (v) {Q(v,u) [[R(v) P(v)] S(u,v)]} (u) (v) {Q(v,u)  [[R(v)  P(v)] S(u,v)]} (v) {Q(v,A)  [[R(v)  P(v)] S(A,v)]} Q(v,A)  [[R(v)  P(v)] S(A,v)] fact form: Q(w,A)  [[R(v)  P(v)] S(A,v)] Root Q(w,A) {[R(v) P(v)] S(A,v)} Leaf Q(w,A) [R(v) P(v)] S(A,v) Leaf R(v) P(v) S(A,v) Leaf Leaf R(v) P(v)

  25. An interesting property of the AND/OR graph representation of a wff is that the set of clauses (into which that wff could have been converted) can be read out as the set of solution graphs (terminating in leaf nodes) of the AND/OR graph. Thus the clauses that result from the fact wff above are: Q(w,A),  S(A,v)  R(v),  S(A,v)  P(v) Each clause is obtained as the disjunction of the literals at the leaf nodes of one of the solution graphs.

  26. (2) The Rule Expressions and Rule Application (a) General Remarks on Rule Expressions -- Rules are based on the implication wffs that represent general assertion knowledge about a problem domain and can then be applied to global database (AND/OR graph structure) to produce new database. -- The simplest form of rule is L W, where L, a single literal and W, an arbitrary wff in AND/OR form. (L1 L2)  W can be expressed as L1W and L2  W since (L1 L2)  W = (L1  L2)  W = ( L1  L2)  W = ( L1  W )  ( L2  W ) = (L1  W )  (L2 W )

  27. Variables in the implication can assume to have Universal quantification over the entire implication; variables existentially quantified have been skolemized. Variables in facts and rules are standardized apart so that no variable occurs in more than one rule and so that the rule variables are different to the fact variables. Any implication with a single-literal antecedent, regardless of its quantification, can be put in a form in which the scope of quantification is the entire implication by a process as follows: -- Replace L  W by  L  W -- Skolemize all existential variables.

  28. E.g: (x) {[(y)(z) P(x,y,z)]  (u)Q(x,u)} can be transformed through the following steps: (i) Eliminate (temporarily) implication symbol (x) {[(y)(z) P(x,y,z)] (u)Q(x,u)} (ii) Reducing the scope of negation symbol (x) {(y)( z) [ P(x,y,z)] (u)Q(x,u)} (iii) Skolemize  (x) {(y) [ P(x,y, f(x,y))] (u)Q(x,u)} (iv) Move all  s to the front and drop  P(x,y, f(x,y)) Q(x,u) (v) Restore implication P(x,y, f(x,y)) Q(x,u)

  29. (b) Rule Application in Proposition Logic A rule of the form L  W can be applied to an AND/OR graph having a leaf node, n, labeled by literal L. The result is a new AND/OR graph in which node n now has an outgoing 1-connector to a descendant node (also label by L) which is the root node of that AND/OR graph structure representing W. E.g., S  (x  y)  z is applied to X Y W T U T U Z X  Y L L T U S L T U S S S (T U) Match Arc S (T U)

  30. From the rule L  W and the fact expression F(L), the expression F(W) can be derived from F(L) by replacing all the occurrences of L in F by W, and thus a new graph containing a representation of F(W) is produced. After a rule is applied at leaf node, this node is no longer a leaf node of the graph, but it is still labeled by a single literal and may continue to have rules applied to it. Any node labeled by a single literal is called a literal node. The set of clauses represented by an AND/OR graph is the set that corresponds to the set of solution graph terminating in literal nodes of the graph.

  31. Termination of Rule Applications -- The object of the forward production system is to prove some goal wff from fact wffs and a set of rules. Hence, whenever the goal wff is reached, the system can be terminated. -- The forward system is limited in proving those goal wffs whose form is disjunction of literals. -- When one of the goal literals matched a literal node, n, of the AND/OR graph, we add a new descendant of node n, labeled by the matching goal literal, to the graph. This descendant is called a goal node.

  32. E.g., Goal: C  G Goal Matching C G C D E G Rules: A  C  D B  E  G A B Rule Matching B A Fact: A  B A  B

  33. (C) Rule Application in Predicate Logic Fact and rule expressions are the same as above: -- Variables are universally quantified; -- Any existentially variables are already Skolemized. Goal wffs, however, is dual to those above: -- Universal variables are replaced by Skolem functions; -- Existential quantifiers in the Skolemized goal wff can then be dropped; -- Variables remaining in goal wffs have been renamed so that the same variable does not occur in more than one disjunct of the goal wff.

  34. Rule Application -- A rule is applicable if the AND/OR graph contains a literal node L’ that unifies with L by mgu, u; -- Application of this rule, then, extends this graph by creating a match arc directed from the node L’ to a new descendant node L; -- This descendant node L is the root node of the graph representation of Wu; -- Label the match arc by the mgu, u. u L’ L Wu Fact Match Goal Rule

  35. E.g., Rule wff: P(A,B)  S(A)  X(B) S(A) X(B) Rule Application P(A,B) Q(x,A) R(B,y) Rule Match {A/x, B/y} P(x, y) Q(x,A)  R(B,y) Fact wff P(x, y)  [Q(x,A)  R(B,y)] The clauses corresponding to these solution graphs are: S(A)  X(B)  Q(A,A) A/x S(A)  X(B)  Q(B,B) B/y

  36. Important Remarks: -- Any solution graph (terminating in literal nodes) can have more than one match arc. -- In computing the set of clauses represented by AND/ OR graph containing several match arcs, only those solution graphsterminating in literal nodes having consistent match arc substitutions are counted. -- The clause represented by a consistent solution graph is obtained by applying a special solution, called the unifying composition, to the disjunction of the literals labeling its terminal nodes.

  37. -- The definition of consistent substitutions: Given a set of substitutions, {u , …, u , …, u }, where u = {t /v , …, t /v }, i = 1, …, n. Let again U = (v , …, v , …, v , …, v ) U = (t , …, t , …, t , …, t ) The substitutions (u , …, u ) are called consistent iff U and U are unfifiable. The unifying composition, u, of (u , …, u ) is the mgu of U and U . 1 i n i1 im(i) i i1 im(i) 1 1m(1) n1 nm(n) 11 2 11 1m(1) n1 nm(n) 1 1 n 2 1 n 1 2

  38. Examples of unifying compositions of substitutions: u u u {A/x} {B/x} inconsistent {x/y} {y/z} {x/y, x/z} {f(z)/x} {f(A)/x} {f(A)/x, A/z} {x/y, x/z} A/z {A/x, A/y, A/z} {s} { } {s} {g(y)/x} {f(x)/y} inconsistent {f(g(x))/z, f(y)/w} {w/z, g(x)/y} {f(g(x))/z, f(g(x))/w, g(x)/y} 1 2

  39. A solution graph must have a set of consistent match arc substitutions in order for its corresponding clauses to be ones that can be inferred from the original fact and rules. R(A) R(B) R2 R1 P(A) Q(B) {A/x} {B/x} R1: P(A)  R(A) R2; Q(B)  R(B) P(x) Q(x) Fact P(x)  Q(x)

  40. As is seen above that the substitutions employed in the graph are inconsistent, the clause R(A)  R(B) is not the one of these, inferred by the graph. If the same rule is applied more than once, then each application must use renamed variables. When a goal literal, L, unifies with a literal L’ labeling a literal node, n, of a graph, we can add a match arc ( labeled by the mgu) directed from node n to a new descendant goal node labeled by L. The same goal literal can also be used a number of times, but each use must employ renamed variables.

  41. Termination The process of extending the AND/OR graph by applying rules or by using goal literals can successfully terminate when a consistent solution graph is produced having goal nodes for all of its terminal nodes. The process has then proved the goal (sub)disjunction obtained by applying the unifying composition of the final solution graph to the disjunction of the literals labeling the goal nodes in the solution graph.

  42. Example Facts: Fido barks and bites, or Fido is not a dog. Rules: All terriers are dogs. Anyone who barks is noisy. Conclusion: There exists someone who is not a terrier or who is noisy. Facts: [BARKS(F)  BITES(F)]  DOG(F) Rule 1: (x) (TERRIER(x)  DOG(x)) (x) (DOG(x) TERRIER(x)) DOG(x) TERRIER(x) Rule 2: (y) (BARKS(y)  NOISY(y)) BARKS(y)  NOISY(y) G: (z) (TERRIER(z)  NOISY(z)) Dual Relations TERRIER(z)  NOISY(z)

  43.  TERRIER(z) NOISY(z) {F/z} {F/z} NOISY(F)  TERRIER(F) R2 R1 BARKS(y) {F/y}  DOG(x) BITES(F) BARKS(F) {F/x}  DOG(F) BARKS(F)  BITES(F) [BARKS(F)  BITES(F)]  DOG(F)

  44. Note that {F/x, F/y, F/z} employed in the graph is the unifying composition of these substitutions. Applying this composition to the goal literals used in the solution graph yields TERRIER(F)  NOISY(F) which is the instance of goal wff that our system has proved. 3. Backward Systems (skipped over) 4. A Combination: F-B Systems (skipped over)

  45. Chapter 6 Expert Systems

  46. 1. Introduction: What Is An Expert System? special category of computer systems able to perform sophisticated functions that only human experts can perform. Expert systems differ substantially from conventional computers in several important respects: -- Their tasks have no algorithmic solutions. -- They often must make conclusions based on uncertain or incomplete information.

  47. -- In a conventional computer program, knowledge pertained to the problem and methods for using this knowledge are inter-wined, so, it is very difficult to change the program. In an expert system, there is a clear separation of general knowledge about the problem (the Knowledge base) from information about the current problem (the input data) and methods (the inference engine) for applying the general knowledge to the problem. So, program in expert systems can be changed by only modification of the knowledge base. -- Symbolic processing is emphasized in expert systems, instead of data processing as in computers. -- Highly interactive processing in expert system. -- Mid-run explanation easily in expert systems

  48. User Expert Knowledge Acquisition Interpretation & Inquiry Knowledge Representation (Bases) Knowledge Processing (Inference Engine) General configuration of expert systems

  49. 2. Representative Example of Expert Systems DENDRAL, E. A. Feigenbaum et al, Stanford U, 1968 Spectroscopic Analysis -- Molecular Structure MACSMA, C. Engleman et al, MIT, 1974 Mathematical Calculus MYCIN, E. H. Shortliffe et al, Stanford U, 1974 Bacterial Infection Diagnosing AM, D. B. Lenat, et al, Stanford, Inductive Inference PROSPECTOR, R. O. Duda et al, Stanford, Geologist HEARSAY, Carnegie-Mellon U, 1960s, NLP XCON, DEC & Carnegie-Mellon, 1980, Computer Configuration …

  50. 3. Example: MYCIN First large expert system to perform at human expert level, first expert system to solve real-world problems instead of “toy problems”, and passed Turing Test. (1) General Description -- Functions: (1) Report the user is a bacterial infection patient; (2) Give the infection hypothesis; (3) Recommend antibiotic therapy; (4) Give the proper prescription. -- Knowledge Acquisition: (1) Built in by knowledge engineers; (2) Learnt during man-machine interaction

More Related