1 / 19

Writing Efficient CycL Part 1

Writing Efficient CycL Part 1. Part One Simpler is Better Use Rule Macro Predicates Create Simplifying Vocabulary Part Two Factor out Commonality Existence is Expensive Exceptions are Exceptional State Negations Explicitly Generalize -- Don’t List Use #$different.

ata
Télécharger la présentation

Writing Efficient CycL Part 1

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 1 • Part One • Simpler is Better • Use Rule Macro Predicates • Create Simplifying Vocabulary • Part Two • Factor out Commonality • Existence is Expensive • Exceptions are Exceptional • State Negations Explicitly • Generalize -- Don’t List • Use #$different

  2. Writing Efficient CycL Part 1 • Simpler is Better • Use Rule Macro Predicates • Create Simplifying Vocabulary

  3. BETTER WORSE GAFs Binary Horn rules Small rules Rules Non-binary Non-horn rules 1 gargantuan rule Simpler is Better • Modularity leads to generality and reuse • If it looks too complicated, it is

  4. BETTER WORSE GAFs Binary Horn rules Small rules Rules Non-binary Non-horn rules 1 gargantuan rule GAFs are better than rules Rule Macro Predicates = Rules + GAFs 99.9% of KB should be GAFs Example: #$hasDiet (#$hasDiet #$koala #$eucalyptus) (#$hasDiet #$cow #$grass) (#$hasDiet #$vampireBats #$blood) (#$hasDiet #$venusFlytrap #$fly-Insect)

  5. BETTER WORSE GAFs Binary Horn rules Small rules Rules Non-binary Non-horn rules 1 gargantuan rule Binary is better than non-binary Avoid gratuitously ternary or quaternary predicates: (graduationDate ?PRSN ?DGREETYP ?DATE) (graduationEvent ?PRSN ?EVENT) (dateOfEvent ?EVENT ?DATE) (degreeTypeOfGraduationEvent ?EVENT ?DGREETYP)

  6. BETTER WORSE GAFs Binary Horn rules Small rules Rules Non-binary Non-horn rules 1 gargantuan rule Horn-rules are better than non-horn rules Consequent of Non-horn Rule: (#$or (#$objectHasColor #$Rover #$TanColor) (#$objectHasColor #$Rover #$BlackColor)) Horn Rule: (#$implies (#$isa ?ANIMAL #$Bird) (#$thereExists ?WING (#$and (#$isa ?WING #$Wing-AnimalBodyPart) (#$anatomicalParts ?ANIMAL #$Wing-AnimalBodyPart))))) If all of this is true, then

  7. BETTER WORSE GAFs Binary Horn rules Small rules Rules Non-binary Non-horn rules 1 gargantuan rule Several small rules are better than one gargantuan rule • 1 Gargantuan Rule: • way too complex to be • correct • will never get used • large memory requirement • likely does not say what • was intended • cannot be generalized

  8. Writing Efficient CycL Part 1 • Simpler is Better • Use Rule Macro Predicates • Create Simplifying Vocabulary

  9. OE Programming genlPreds Rule Macro Predicates helper function macros Simpler is better (#$genlPreds #$brothers #$siblings) is better than (#$implies (#$brothers ?AGT ?BRO) (#$siblings ?AGT ?BRO))

  10. Reason with the vocabulary itself Do this: (animalTypeEatsAnimalType Cheetah Wildebeest) (implies (animalTypeEatsAnimalType ?ANM1 ?ANM2) (hasAttributes ?ANM2 Deceased)) (animalTypeEatsAnimalType Cheetah Antelope) Instead of this: (eats Cheetah Wildebeest) (implies (and (isa ?EAT Eating) (isa ?CH1 Cheetah) (isa ?WIL1 Wildebeest) (doer ?EAT ?CH1) (objectActedOn ?WIL1) (hasAttributes ?WIL1 Deceased)) (eats Cheetah Antelope) (implies (and (isa ?EAT Eating) (isa ?CH1 Cheetah) . . . One rule applies to all animal types

  11. Reason with the vocabulary itself (cont.) Entering a lot of rich knowledge in a new domain? • add some abstractions as new vocabulary • define new vocabulary in ways that link it up to other existing vocabulary Now you can tersely write the things you need to say.

  12. Add Rule Macro Predicates Simple vocabulary for the sake of being simple is not worth it. Add Rule Macro Predicates. An extreme example of operating with too little vocabulary: 0 (#$SuccessorFn 0) (#$SuccessorFn (#$SuccessorFn 0)) (#$SuccessorFn (#$SuccessorFn (#$SuccessorFn 0))) (#$SuccessorFn (#$SuccessorFn (#$SuccessorFn (#$SuccessorFn 0)))) . . .

  13. Writing Efficient CycL Part 1 • Simpler is Better • Use Rule Macro Predicates • Create Simplifying Vocabulary

  14. Some False Ideas Erroneous Mindset “vocabulary is expensive” “complex assertions are cheap” • Physics Envy • Maxwell’s Equations of KR

  15. New Vocabulary Will Not Make Rules Less Reusable • The same kinds of tools that help you find #$Dog will help you find your new vocabulary • The meaning of #$Dog is only defined by how it’s linked up to other things in the system -- all new vocabulary must be linked up properly • All truly large-scale, reusable, interesting knowledge bases are going to be big • For all large-scale knowledge bases, you must have tools

  16. OE vs KE vs SME’s and Their Vocabulary • OE: make it so that a KE can create vocabulary • KE: understand enough about the logic so that they can create vocabulary • SME: use the vocabulary • Should be able to say everything that they need to say with the available vocabulary

  17. The Rule of 10 Simplifying many assertions is reason enough to create new vocabulary (#$isa ?MAL #$MalePerson) is better than (#$and (#$isa ?MAL #$Person) (#$hasGender ?MAL #$Masculine))

  18. Why Simplify Vocabulary? • Cyc is not a frame system: • Adding new vocabulary is NOT expensive • Creating collections is NOT expensive • Creating predicates is NOT expensive • Creating functions is NOT expensive • Creating microtheories is NOT expensive • Reasoning with overly complicated rules is expensive • Reasoning with overused vocabulary is hard to focus

  19. Summary Slide • Simpler is Better • Use Rule Macro Predicates • Create Simplifying Vocabulary

More Related