1 / 30

Writing Efficient CycL: Part 2

Writing Efficient CycL: Part 2. Part One: General Suggestions Simpler is Better Use Rule Macro Predicates Create Simplifying Vocabulary Part Two: Cyc-Specific Suggestions Factor out Commonality Existence is Expensive Exceptions are Exceptional State Negations Explicitly

leigh-duffy
Download Presentation

Writing Efficient CycL: Part 2

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. Writing Efficient CycL: Part 2 • Part One: General Suggestions • Simpler is Better • Use Rule Macro Predicates • Create Simplifying Vocabulary • Part Two: Cyc-Specific Suggestions • Factor out Commonality • Existence is Expensive • Exceptions are Exceptional • State Negations Explicitly • Generalize -- Don’t List • Use #$different

  2. Writing Efficient CycL: Part 2 • Factor out Commonality • Existence is Expensive • Exceptions are Exceptional • State Negations Explicitly • Generalize -- Don’t List • Use #$different

  3. P N*M reduces to N+M When similarity is not a coincidence N*M reduces to N+M A B C D A B C D W X Y Z W X Y Z

  4. Commonalities in Collections Olympic Women’s Individual 100 Meter Backstroke Olympic Women’s Individual 200 Meter Freestyle Olympic Men’s Individual 200 Meter Backstroke Olympic Men’s Individual 400 Meter Butterfly

  5. Commonalities in Collections Individual Competition Swimming Competition Olympic Competition Olympic Women’s Individual 100 Meter Backstroke Olympic Women’s Individual 200 Meter Freestyle Olympic Men’s Individual 200 Meter Backstroke Olympic Men’s Individual 400 Meter Butterfly

  6. Commonalities in Collections Individual Competition Swimming Competition Olympic Competition Olympic Women’s Individual 100 Meter Backstroke Olympic Women’s Individual 200 Meter Freestyle Olympic Men’s Individual 200 Meter Backstroke Olympic Men’s Individual 400 Meter Butterfly

  7. Commonalities in Collections Individual Competition Swimming Competition Olympic Competition Olympic Individual Swimming Olympic Women’s Individual 100 Meter Backstroke Olympic Women’s Individual 200 Meter Freestyle Olympic Men’s Individual 200 Meter Backstroke Olympic Men’s Individual 400 Meter Butterfly

  8. Commonalities in Microtheories ... ... ... ... June 2, 2002 USA Today Sports Section Mt October 8, 2002 USA Today Sports Section Mt September 21, 2002 USA Today Sports Section Mt April 15, 2002 USA Today Sports Section Mt

  9. Commonalities in Microtheories American Sports Competition Mt Current and Historical Stats Mt Rules for Games Mt June 2, 2002 USA Today Sports Section Mt October 8, 2002 USA Today Sports Section Mt September 21, 2002 USA Today Sports Section Mt April 15, 2002 USA Today Sports Section Mt

  10. Commonalities in Microtheories American Sports Competition Mt Current and Historical Stats Mt Rules for Games Mt June 2, 2002 USA Today Sports Section Mt October 8, 2002 USA Today Sports Section Mt September 21, 2002 USA Today Sports Section Mt April 15, 2002 USA Today Sports Section Mt

  11. Commonalities in Microtheories American Sports Competition Mt Current and Historical Stats Mt Rules for Games Mt Rules, Competition, and Stats Mt June 2, 2002 USA Today Sports Section Mt October 8, 2002 USA Today Sports Section Mt September 21, 2002 USA Today Sports Section Mt April 15, 2002 USA Today Sports Section Mt

  12. Microtheories + a Forward Rule X Y Z T PQRS P Q R S A

  13. Microtheories + a Forward Rule X Y Z T P Q R PQRS ... S S S S C A D B

  14. Microtheories + a Forward Rule X Y Z T P Q R PQRS S Shared Assumptions Mt ... C A D B

  15. Writing Efficient CycL: Part 2 • Factor out Commonality • Existence is Expensive • Exceptions are Exceptional • State Negations Explicitly • Generalize -- Don’t List • Use #$different

  16. Concluding #$thereExists • Skolemization • In order to conclude #$thereExists, introduce a function to denote the thing that so exists so that we can reason with it • Extends the number of concepts and symbols in the language that the system might have to think about • Things that conclude #$thereExists are a little more expensive than others

  17. State Existence Generally • Pervasive problemEvery elephant has a head Every elephant has a head with a trunk Every cat has a head with whiskers Every spotted wombat has a spotted head … • State existence generally, constrain specifically Every animal has a head Every elephant has a trunk An animal’s trunk is part of its head

  18. Writing Efficient CycL: Part 2 • Factor out Commonality • Existence is Expensive • Exceptions are Exceptional • State Negations Explicitly • Generalize -- Don’t List • Use #$different

  19. Overuse of #$not (#$implies (#$and (#$isa ?BRD #$Bird) (#$not (#$isa ?BRD #$Penguin))) (#$behaviorCapableOf ?BRD #$Flying #$performedBy)) What about Emus? What about these examples? • broken wings • feet in concrete • slathered in crude oil • hypnotized into thinking it is a dog

  20. Use Default Reasoning Solution : use default reasoning (#$implies (#$isa ?BRD #$Bird) (#$behaviorCapableOf ?BRD #$Flying #$performedBy)) (#$exceptWhen (#$isa ?BRD #$FlightlessBird) (#$implies (#$isa ?BRD #$Bird) (#$behaviorCapableOf ?BRD #$Flying #$performedBy))) (#$genls #$Penguin #$FlightlessBird) (#$genls #$Emu #$FlightlessBird) ...

  21. Postpone Checking for Exceptions • Save a lot of work • only check for exceptional cases after using the rule • #$not’s in the antecedent of a rule you’re writing? • ask yourself “is this what the rule really means or this a meta-statement about cases where that rule wouldn’t apply and should be stated as an exception?”

  22. Writing Efficient CycL: Part 2 • Factor out Commonality • Existence is Expensive • Exceptions are Exceptional • State Negations Explicitly • Generalize -- Don’t List • Use #$different

  23. Underuse of #$not • Better to conclude than assume • Negations can prune inferences • Some Powerful Negations • #$disjointWith is not a (#$disjointWith) 5

  24. Powerful Negations • #$SiblingDisjointCollection • #$completeExtentKnown is not a (#$SiblingDisjointCollection) is not a (#$SiblingDisjointCollection) (#$completeExtentKnown #$nationalBorder)

  25. Another Powerful Negation • #$completeCollectionExtent (#$completeCollectionExtent #$MonthOfYearType) #$January, #$February, #$March, #$April, #$May, #$June, #$July, #$August, #$September, #$October, #$November, #$December + #$Yule ?

  26. Writing Efficient CycL: Part 2 • Factor out Commonality • Existence is Expensive • Exceptions are Exceptional • State Negations Explicitly • Generalize -- Don’t List • Use #$different

  27. Disjunctions? Try to Generalize • “list-em” KR is almost always wrong (#$implies (#$and (#$isa ?PRSN #$Person) (#$or (#$brothers ?PRSN ?SBLNG) (#$sisters ?PRSN ?SBLNG))) (#$feelsTowardsObject ?PRSN ?SBLNG #$Rivalry #$Positive)) • Create vocabulary for the generalization #$siblings

  28. Writing Efficient CycL: Part 2 • Factor out Commonality • Existence is Expensive • Exceptions are Exceptional • State Negations Explicitly • Generalize -- Don’t List • Use #$different

  29. Use#$differentAvoid(#$not (#$equals ...)) (#$different <ITEM-1> <ITEM-2> <ITEM-3> ...) is much better than (#$and (#$not (#$equals <ITEM-1> <ITEM-2>)) (#$not (#$equals <ITEM-1> <ITEM-3>)) (#$not (#$equals <ITEM-2> <ITEM-3>)) ...)

  30. Summary • Factor out Commonality • Existence is Expensive • Exceptions are Exceptional • State Negations Explicitly • Generalize - Don’t List • Use #$differentAvoid (#$not (#$equals ...))

More Related