1 / 30

ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

UNIFICATION AND ITS ALGORITHM. ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]. Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information Technology Institute of Applied Computer Systems Department of Systems Theory and Design

kanoa
Télécharger la présentation

ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

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. UNIFICATIONAND ITS ALGORITHM ARTIFICIAL INTELLIGENCE[INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information Technology Institute of Applied Computer Systems Department of Systems Theory and Design E-mail: Janis.Grundspenkis@rtu.lv

  2. Unification and Its Algorithm Modus Ponens can also be applied to expressions containing variables. Example: “All boxers have broken noses and Lewis is a boxer” X[boxer(X)  broken nose(X)] boxer(lewis)

  3. Unification and Its Algorithm Because the X is universally quantified, it is possible to substitute any value in the domain for X: boxer(lewis)  broken nose (lewis) Using Modus Ponens the conclusion is infered: broken nose(lewis)

  4. any predicate Unification and Its Algorithm Universal instantiation states that if any universally quantified variable in a true sentence is replaced by any appropriate term from the domain, the result is a true sentence. For example, if c is from the domain of X, Xp(X) allows to infer p(c).

  5. Unification and Its Algorithm To apply inference rules, an inference system (inference engine) must be able to determine when two expressions are the same or match. In propositional calculus two expressions match if and only if they are syntactically identical.

  6. Unification and Its Algorithm In predicate calculus a decision process based on universal instantiation is needed for determining the variable substitutions under which two or more expressions can be made identical.

  7. Unification and Its Algorithm The process of finding substitutions that make two or more expressions identical is called unification. Unification is an algorithm for determining the substitutions needed to make two predicate calculus expressions match.

  8. Unification and Its Algorithm Unification and inference rules allow to make inferences on a set of logical assertions. To do this, the knowledge base must be expressed in an appropriate form.

  9. Unification and Its Algorithm • Requirements of this form: • All variables must be universally quantified. This allows full freedom in computing substitutions. • Existentially quantified variables may be eliminated by replacing them with the constants that make the sentence true. • Thus all quantifiers can be dropped.

  10. Unification and Its Algorithm The process of eliminating existentially quantified variables is complicated because the value of these substitutions may depend on the value of other variables in the expression. For example, in the sentence: X Y father(X, Y) the value of the existentially quantified variable Y depends on the value of X.

  11. Unification and Its Algorithm SKOLEMIZATION Skolemization replaces each existentially quantified variable with a function that returns the appropriate constant as a function of some or all of the other variables in the sentence.

  12. Unification and Its Algorithm SKOLEMIZATION (continued) In the previous example, Y could be replaced by a Skolem functionf(X) because Y depends on X: X father (X, f(X)), which indicates that each X has a father (the f of that X).

  13. Unification and Its Algorithm SKOLEMIZATION (continued) Example: “Everyone has brain” X person(X)  Y brain(Y) has(X, Y) If Y is replaced with a constant b the result will be X person(X)  brain(b)  has(X, b) which says that everyone has the same brain.

  14. Unification and Its Algorithm SKOLEMIZATION (continued) In fact, it is needed to say that brain they have is not necessarily shared: X person(X)  brain(f(X)) has(X, f(X)) wheref is a Skolem function name that does not appear elsewhere in the knowledge base.

  15. Unification and Its Algorithm SKOLEMIZATION (continued) In general, the existentially quantified variable is replaced by a term that consists of a Skolem function applied to all the variables universally quantified outside the existential quantifier in question. Skolemization eliminates all existentially quantified variables, so now universal quantifiers can be dropped, because any variable must be universally quantified.

  16. Unification and Its Algorithm Unification is complicated because a variable may be replaced by any term, including other variables and function expressions of arbitrary complexity, that may themselves contain variables. For example, father(lewis) may be substituted for X in boxer(X) to infer that Lewis father has a broken nose.

  17. Unification and Its Algorithm SUBSTITUTIONS The notation X/Y indicates that the variable Xis substituted for the variable Y in the original expression. The notation { } denotes the empty substitution.

  18. Unification and Its Algorithm SUBSTITUTIONS (continued) To keep track of substitutions they are denoted as follows: {V1  c; V2  V3; V4  f(...) } Vi (i = 1, 2, 3, 4, ...) are variables c is the constant f(...) is a function A variable is said to be bound to the value substituted for it.

  19. Unification and Its Algorithm • SUBSTITUTIONS (continued) • Rules for substitutions • A constant may be systematically substituted for a variable. • Any constant is considered a “ground instance” and may not be replaced. • Two different constantscan not be substituted for one variable.

  20. Unification and Its Algorithm SUBSTITUTIONS (continued) ! If a variable is boundto a constant, that variable may not be given a new bindings. A variable may be replaced by a variable. A variable may be replaced by a function expression, as long as the function expression does not contain that variable.

  21. Unification and Its Algorithm SUBSTITUTIONS (continued) !A variablecan not be replacedby a term containing that variable. For example: X, cannot be replaced by p(X), because it creates an infinite expression: p(p(p(p(...X...)))).

  22. Unification and Its Algorithm SUBSTITUTIONS (continued) In general, a problem solving process will require multiple inferences and, consequently, multiple successive unifications. Logic problem solvers must maintain consistency of variable substitutions.

  23. Unification and Its Algorithm SUBSTITUTIONS (continued) Any substitutions must be made consistently across all occurrences of the variable in both expressions being matched. If a variable V1 is substituted for a variable V2 and later V1 is replaced by a constant c, then V2 must also reflect this binding.

  24. Unification and Its Algorithm SUBSTITUTIONS (continued) For example: p(X, Y)  q(X, Y) p(a, Z) The substitution is {X  a; Y  Z}

  25. Unification and Its Algorithm SUBSTITUTIONS (continued) Modus Ponens p(a, Z)  q(a, Z) p(a, Z) __________________q(a, Z) q(W, b)  s(W, b) The substitution is { W  a; Z  b }

  26. Unification and Its Algorithm SUBSTITUTIONS (continued) Modus Ponens q(a, b)  s(a, b) q(a, b) ____________________s(a, b)

  27. Unification and Its Algorithm SUBSTITUTIONS (continued) If S and S1 are two substitution sets, then the compositionSS1 of S and S1 is obtained by applying S to the elements of S1 and adding the result to S.

  28. Unification and Its Algorithm SUBSTITUTIONS (continued) For example, the sequence of substitutions S = {Y/X, U/V}, S1 = {W/Y},S2 = {a/W, f(b) / U} is equivalent to the single substitution{a/X, f(b)/V}. This is produced by composing SS1to yield SS1= {W/X, U/V} and then composing SS1S2 = {a/X; f(b)/V}.

  29. Unification and Its Algorithm • UNIFICATION ALGORITHM • unify((boxer X(father X)), (boxer lewis Y)) • The function will attempt to recursively unify the first elements of each expression and apply substitutions to the rest. • unify(boxer, boxer) • return { } • unify((X(father X)), (lewis Y)) • unify(X, lewis)

  30. Unification and Its Algorithm • UNIFICATION ALGORITHM (continued) • return { lewis/X } • unify((father lewis), (Y)) • return { father lewis/Y } • unify((), ()) • return {} • The complete set of substitutions is {lewis/X, father lewis/Y}

More Related