300 likes | 403 Views
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
E N D
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
Writing Efficient CycL: Part 2 • Factor out Commonality • Existence is Expensive • Exceptions are Exceptional • State Negations Explicitly • Generalize -- Don’t List • Use #$different
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
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
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
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
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
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
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
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
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
Microtheories + a Forward Rule X Y Z T PQRS P Q R S A
Microtheories + a Forward Rule X Y Z T P Q R PQRS ... S S S S C A D B
Microtheories + a Forward Rule X Y Z T P Q R PQRS S Shared Assumptions Mt ... C A D B
Writing Efficient CycL: Part 2 • Factor out Commonality • Existence is Expensive • Exceptions are Exceptional • State Negations Explicitly • Generalize -- Don’t List • Use #$different
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
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
Writing Efficient CycL: Part 2 • Factor out Commonality • Existence is Expensive • Exceptions are Exceptional • State Negations Explicitly • Generalize -- Don’t List • Use #$different
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
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) ...
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?”
Writing Efficient CycL: Part 2 • Factor out Commonality • Existence is Expensive • Exceptions are Exceptional • State Negations Explicitly • Generalize -- Don’t List • Use #$different
Underuse of #$not • Better to conclude than assume • Negations can prune inferences • Some Powerful Negations • #$disjointWith is not a (#$disjointWith) 5
Powerful Negations • #$SiblingDisjointCollection • #$completeExtentKnown is not a (#$SiblingDisjointCollection) is not a (#$SiblingDisjointCollection) (#$completeExtentKnown #$nationalBorder)
Another Powerful Negation • #$completeCollectionExtent (#$completeCollectionExtent #$MonthOfYearType) #$January, #$February, #$March, #$April, #$May, #$June, #$July, #$August, #$September, #$October, #$November, #$December + #$Yule ?
Writing Efficient CycL: Part 2 • Factor out Commonality • Existence is Expensive • Exceptions are Exceptional • State Negations Explicitly • Generalize -- Don’t List • Use #$different
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
Writing Efficient CycL: Part 2 • Factor out Commonality • Existence is Expensive • Exceptions are Exceptional • State Negations Explicitly • Generalize -- Don’t List • Use #$different
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>)) ...)
Summary • Factor out Commonality • Existence is Expensive • Exceptions are Exceptional • State Negations Explicitly • Generalize - Don’t List • Use #$differentAvoid (#$not (#$equals ...))