1 / 84

KNOWLEDGE REPRESENTATION 최윤정

KNOWLEDGE REPRESENTATION 최윤정. Knowledge Representation Methods. Declarative Methods --knowledge is knowing WHAT Logical Approach Predicate Calculus Nonstandard Logics Fuzzy Logic Non-Logical Approach Semantic Net Frame (procedural features) Conceptual Dependency.

torin
Download Presentation

KNOWLEDGE REPRESENTATION 최윤정

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. KNOWLEDGE REPRESENTATION최윤정

  2. Knowledge Representation Methods • Declarative Methods --knowledge is knowing WHAT • Logical Approach • Predicate Calculus • Nonstandard Logics • Fuzzy Logic • Non-Logical Approach • Semantic Net • Frame (procedural features) • Conceptual Dependency • Procedural Methods --knowledge is knowing HOW • PLANNER, CONNIVER • Rule-based systems

  3. Tweety Robin Bird isa isa Wings Wings Wings Semantic Net(1/3) (Quillian(1968) Psychological Model) • Basic Constructs • Node-Object, Concept • Links-Relation property inheritance -Property Inheritance is the main inferencemechanism! has-part

  4. Semantic Net(2/3) Example Sold-by Furniture store Furniture isa Chair Seat has-part isa Park My-Chair owner cover isa Person Leather Black Color

  5. Semantic Net(3/3) • Internal Representation(LISP) • My-Chair: ((ISA CHAIR)(COLOR BLACK) (OWNER PARK)(COVER LEATHER)) • Chair: ((ISA FURNITURE)(HASPART SEAT)) (get `My-CHAIR `COLOR)= `BLACK

  6. Action and Event(1/2) • “John gave the book to Mary.” Event isa agent isa object John EV-1 BK-1 Book beneficiary time Mary action Give Past

  7. Action and Event(2/2) • “John is taller than Bill.” John Bill Is-taller Bill John height height H1 Number H2 isa isa greater-than

  8. Reasoning with Semantic Nets(1/2) • Spreading Activation “What is the relation between John and Mary?” John ? Mary

  9. Reasoning with Semantic Nets(2/2) • Matching Fact Goal Net Direct Match vs. Semantic Match • What is Tweety? isa Tweety Robin Bird isa isa Tweety ? isa

  10. Problems of Semantic Net(1/2) 1. Different people use different nets to represent the same thing. John Mary married Event isa Marriage isa M1 male female John Mary

  11. Problems of Semantic Net(2/2) 2. Same Net interpreted differently by different person. 3. Quantification Jack Tom Father-of

  12. Dealing with Exceptions(1/2) Fly CAN Exception node Bird ISA Ostrich ISA Henry

  13. Grey COLOR Elephant ISA isa Royal Elephant ISA Circus Elephant ISA Clyde Dealing with Exceptions(2/2) • Inferential Distance(Touretzky)

  14. Frame (1/2) -Minsky • Slot-Filler Concept : Typical Expected Situation • [frame: Vehicle ISA: Object Slots: (Weight (a wt-measure)) (color (a color(default black))) (number-of-wheel (a integer))] • [frame: Trailer-Truck ISA: Vehicle Slots: (trailer-size (a length-measure)) (weight (default 8)) (number-of-wheel (default 18))] • [frame: Sedan ISA: Vehicle Slots: (number-of-wheel 4)] • [frame: My-truck instance-of: Trailer-Truck Slots: (trailer-size = 12) (color red)]

  15. Frame(2/2) weight= color= black wheel= Object ISA weight=8 trailer-size= wheel=18 Color=black Vehicle ISA Trailer-truck Weight=8 Trailer-size=12 Wheel=18 Color=red ISA My-Truck

  16. Procedural Attachment(1/2)-Procedural knowledge is attached to slots If-Added: Triggered to fill in If-Needed: Triggered when filled in If-Modified: Triggered when changed Employee: ISA: Person Sex: (M, F) Birthday: Date Age: integer If-Needed: CALC-AGE Skill: code If-Added: ADD-TO-SKILL-FILE

  17. Procedural Attachment(2/2) Proc CALC-AGE; x:= get-current-year; y:= get-birth-year; age:= x-y end; Proc ADD-TO-FILE; c:= get-code; open-file(skill); put-file(c, skill) end;

  18. LOGICAL PRELIMINARIES • LOGIC- ARTIFICIAL LANGUAGE TALKING ABOUT “TRUTH” • LOGIC AS LANGUAGE • SYNTAX(GRAMMAR) -Symbol -WFF(Well Formed Formula) -Deductive Closure -Proof Theory • SEMANTICS -Meaning -Model -Validity, Consistency -Model Theory • LOGIC AS A PROGRAMMING LANGUAGE • SYNTAX • SEMANTICS

  19. LOGIC-LANGUAGE and its MEANING

  20. PROPOSITIONAL LOGIC (1/2) • (P∧Q)R Falsifying Model

  21. PROPOSITIONAL LOGIC (2/2) • ((PQ)∧~Q)~P • VALID TRUE in Every Model(Tautology) • INCONSISTENT FALSE in Every Model • CONSISTENT TRUE in at least ONE Model VALID  INVALID INCONSISTENT  CONSISTENT (Unsatisfiable) (Satisfiable)

  22. FORMAL SYSTEM Well Formed Formula Language AXIOM + THEOREM ├ A INFERENCE RULES VALID ╞ A PROOF THEORY MODEL THEORY THEOREM VALID SOUNDNESS (→) COMPLETENESS (←)

  23. Types of Logical Reasoning • Deduction Given A, AB infer B • Induction Given A, B find the rule AB • Abduction (Not logically valid!) Given AB, B infer A • Refutation Proof

  24. Proof by Cases • Is there a Red Box right next to a Non-Red Box? ?

  25. Refutation Proof • A, AB want to prove B Assume ¬B and find a contradiction Most Common Method using Computer - Resolution, Tableau Method etc.

  26. PROVING VALIDITY in PROPOSITIONAL LOGIC • 1. TRUTH TABLE • 2. TABLEAU METHOD • 3. SEQUENT CALCULUS • 4. RESOLUTON

  27. TABLEAU METHOD • Refutation Method (Assuming FALSE and draw CONTRADICTION) (( P Q) ∧ -Q ) -P F T F T T T T F CONTRADICTION

  28. RESOLUTION (Robinson) • A  B, B  C, A C? -A ∨ B -B ∨ C A -C -A ∨ C C

  29. Example 1 (1/2) “Head I win, Tail you lose.” Prove I win. H: head T: tail H  W W: I win T  L L: You lose (Hidden information) H ∨ T W  L L  W

  30. Example 1 (2/2) -H∨W -T∨L H∨T -W∨L -L∨W -W ~L ~T H W

  31. Example: Lion Sleeps Tonight • Lion always sleeps except when he is hunting. • Lion cannot sleep when he is hungry. • When he is tired he cannot hunt. • Lion is tired when he does not sleep. • Prove Lion is not hungry.

  32. Resolution Strategies (1/4) • 1. UNIT RESOLUTION (Wos) • Not complete • UNIT PREFERENCE RESOLUTION • Unit clause always reduces the size! P ∨ Q P ∨ -Q -P ∨ Q -P ∨ -Q P Q -Q

  33. Resolution Strategies (2/4) • 2. INPUT RESOLUTION • Not complete • INPUT CLAUSES HAVE MEANINGFUL INFORMATION P ∨ Q INPUT CLAUSES P ∨ -Q -P ∨ Q -P ∨ -Q P Q -Q

  34. Resolution Strategies (3/4) • 3. LINEAR RESOLUTION(Loveland) • Chain of Reasoning • Depth First • COMPLETE P ∨ Q P ∨ -Q -P ∨ Q -P ∨ -Q P Q -P

  35. Resolution Strategies (4/4) • 4. LOCK RESOLUTION(BOYER) • COMPLETE • Index every literal (Lock) : consider smallest P1 Q2 P3-Q4 -P6Q5 -P8-Q7 -P6 -Q4 Q2

  36. Predicate Calculus • Variable : object x, y, z, .. • Constant : a, b, c, tom, 1, 2, .. • Function : f, g, h, father(tom),… • Predicate : P, Q, R • Quantifier : ∀, ∃

  37. Well Formed Formula • Term constant, variable, f(t1, .. tn): ti term • Atom P(t1,..tn) • Formula(wff) 1. atom 2. F∨G, -F, FG 3. (∀x)F, (∃x)F

  38. Nested Quantifiers • Describe each statement ∀x ∀y Love(x, y) ∀x ∃y Love(x, y) ∃x ∀y Love(x, y) ∃x ∃yLove(x, y) ∀x ∃y Love(y, x) ∃x ∀y Love(y, x) Negation of these?

  39. Symbolize the Statement • Every rational number is a real number. • There exists a number that is prime. • For every number x, there exists a number y such that x<y. • Not every real number is a rational number. • Everybody has somebody who loves him. • There is someone whom everybody loves. • Mimi loves only those who is younger than her. • Everyone who eats BigMac listens Jazz music.

  40. Clausal Form Conversion • 1. Eliminate  • 2. Reduce the scope of ~ • 3. Rename the variables • 4. Move quantifiers to the left (prenex normal form) • 5. Eliminate ∃ : Skolemize • 6. Eliminate ∀ • 7. Conjunctive Normal Form

  41. Reducing the Scope of ~ • ~ (p ∧ q) = ~p ∨ ~q ~ (p ∨ q) = ~p ∧ ~q • ~ Q1Q2..Qn P(x,y,..) = Q’1Q’2..Q’n ~P(x,y,..) where Q’ = ∃ if Q=∀ ∀ if Q= ∃

  42. Prenex Normal Form • Prenex normal form: Q1Q2..Qn P(x,y,..) where Q i = ∀, ∃ • ∀x (P(x) ∨ ∀y (Q(y))) = ∀x ∀y (P(x) ∨ Q(y)) • ∀x (P(x) ∨∃y (Q(x, y))) = ∀x ∃y (P(x) ∨ Q(x, y))

  43. Skolem Function • Eliminating ∃’s ∃x P(x)  P(sk1) : sk1 is skolem constant ∃x ∀y P(x,y)  ∀y P(sk1, y) ∀y ∃x P(x,y)  ∀y P(sk1(y),y) ∀x ∃y ∀z ∃w P(x,y,z,w)  ∀x ∀z P(x,sk1(x),z,sk2(x,z))

  44. Example : Clausal Form • ∀x((∀y P(x,y)  ~∀y(Q(x,y)  R(x,y))) ∀x( ~∀y P(x,y) ∨ ~∀y (~Q(x,y) ∨ R(x,y))) … (1) ∀x( ∃y ~P(x,y) ∨∃y (Q(x,y) ∧~R(x,y))) … (2) ∀x( ∃y ~P(x,y) ∨∃z (Q(x,z) ∧~R(x,z))) … (3) ∀x∃y∃z (~P(x,y) ∨((Q(x,z) ∧~R(x,z))) … (4) ∀x(~P(x,s1(x))∨((Q(x,s2(x))∧~R(x,s2(x)))) … (5) ~P(x,s1(x))∨((Q(x,s2(x))∧~R(x,s2(x))) … (6) (~P(x,s1(x))∨Q(x,s2(x)))∧(~P(x,s1(x))∨~R(x,s2(x)))

  45. Matching • Rule : Mother(x, y)  Like(x, y) “Every Mother Like their Son” • Fact Like(Joe, Jack), Like(Kim, Mary) Mother(Judy, Jack), Mother(Mary, Jay) • Query Like(Judy Jack)? Like(Mary, ?)

  46. Unification(2-way Matching) • Find a substitution σ(unifier) which makes two clause equal • Essential step for Resolution of Predicate Calculus • Usually unification tries to find a most general unifier

  47. Most General Unifier (mgu) • Substitution : σ C = Like(x, father(x)) σ = {jack/x} C • σ = Like(Jack, father(Jack)) • C, D are unifiable iff there is σ s.t. C • σ = D • σ (σ is called unifier) • Mgu  least specific unifier Like(x, y), Like(Jack, y) σ1={Jack/x}, σ2={Jack/x, Mary/y}

  48. Unification - Examples Like(x, y) Like(joe, father(joe)) Like(jack, y) Like(x, father(x)) Like(x, father(x)) Like(joe, y) Like(x, father(joe)) Like(jack, father(y)) Like(x, father(x)) Like(jack, father(joe)) Like(x, father(x)) Like(father(y),z) Like(x, x) Like(father(z), z) ?

  49. Factoring • If 2 literals in a clause C have mgu σ then C • σ is called a factor of C • If C = P(x) ∨ P(f(y))∨ ~Q(x) Then σ = {f(y)/x} P(f(y))∨P(f(y))∨~Q(f(y)) P(f(y))∨~Q(f(y)) : factor of C

  50. Subsumption • Clause C subsumes D iff ∀ C  D • (A ∧B) subsumes A A subsumes A ∨ B • Subsumed clause can be deleted • C=P(x) D=P(a)  delete P(a) • Note: factoring – within a clause subsumption – between two clauses

More Related