# Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Knowledge Structures Building the Perfect Object.

## Presentation on theme: "Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Knowledge Structures Building the Perfect Object."— Presentation transcript:

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Knowledge Structures Building the Perfect Object

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Overview 4 Concepts as Objects, Attributes and Relations 4 Whats a Concept? 4 Concepts, Classes and Instances –Inheritance –Value Restrictions –Default values 4 Specialization/Generalization –ISA and Subset 4 Meta-Modeling: Classes and Instances

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Object, Attributes and Relations

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes (O,A,V) Notation 4 Notation: oav(O, A, V) –oav: object database –O: any object symbol –A: an attribute symbol –V: a value symbol 4 Semantic Interpretation –O represents a concept, –A a property of that concept and –V a value of the property A of the concept O.

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Whats a Concept? 4 oav(telephone, colo r, beige) –telephone is an object that denotes the concept telephone –telephone has a property color and its value is beige. –Is that enough? Which does the representation really intend? the concept telephone is beige? all things that are telephones are beige? 4 oav(tel_101, instance_of, telephone) –tel_101 is a telephone? 4 oav(tel_101, color, beige) –Is tel_101 beige? –Is the color attribute interpreted uniformly? –Can color be an object? –Can instance_of be an object? Asserts something about a particular individual Asserts something about a group of individuals (x) telephone(x) ^ oav(x, color, beige) telephone(tel_101)

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Classes and Individuals? 4 A useful interpretation of OAVs requires a distinction between classes & individuals 4 Individuals –IF an object fact is an assertion about a particular individual, then property values specify the value of that property for that individual –oav(o,a,v): oav(o, a, v) 4 Classes –IF an object describes a class of individuals, THEN property values are intended to describe a class of potential (valid/satisfying) values for any individual of that class –The object in this case denotes an entire set of individuals by describing the set of characteristics true of all individuals in that set. –oav(o_class, a, v_class ): (x) o_class (x) ^ oav(x, a, v) ^ v_class(v) –In our new interpretation, o_class is a predicate, oav just became a 2nd order predicate. What are the implications?

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes The Class Assertion 4 How do we assert that an object should denote a class vs an individual? 4 This is required to apply the right logical interpretation of a assertion: oav(o,a,v) 4 Option 1: Special Predicates –class(object) or individual(object) –Not both - we would not know which interpretation to apply –Implies an object is either a class or an individual –This is how OO languages and most KR languages do it. –Do objects that represent classes ever represent individuals? No. 4 Option 2 –intentional_oav(o, a, v) and extensional_oav(o,a,v) –Objects can have intentional assertions and extensional assertions. –Objects may act as either a class or an individual. –How would this ever be a requirement? If it is what are the implications?

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Instance_of and Inheritance 4 A relation between concepts - Links individuals to classes –ex_oav(tel_101, instance_of, telephone) –ex_oav(harry, instance_of, eagle) 4 Facts –in_oav(telephone, color, beige) –ex_oav(te1_101, instance_of, telephone) 4 The inheritance inference –From the above we would like to infer: ex_oav(tel_101, color, beige) –Requires interpretation of intentional values as values held by all instances not as value classes – (c,x) ex_oav(x, instance_of, c) ^ in_oav(c, a, v) ex_oav(x, a, v)

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Instance_of and Value Restrictions 4 in_oav(telephone, color, telephone_color) – (x,v) ex_oav(x, instance_of, telephone) –ex_oav(x,color,v) ^ v is a telephone_color –v is a telephone_color? We dont know what we mean by this yet. 4 ex_oav(te1_101, instance_of, telephone) –tel_101 does not inherit any particular color on this interpretation 4 How would you accommodate both –Classes as descriptions of common characteristics of all individuals AND –Classes as a source for inherited values –Would we want both? –How would each be used? Recognition. Design. Production.

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Inheritance and Value Restriction 4 Inheritance Inference – (c,x,a) –(ex_oav(x, instance_of, c) ^ in_oav(c, a, v)) – ex_oav(x, a, v) 4 Value Restriction Inference – (c,a,v,vc,x,) % c:class, a:attribute, v:value, vc:value class, x:object –in_oav(c, a, vc) –ex_oav(x, instance_of, c) ex_oav(x,a,v) ^ v is in vc 4 What do we mean by v is in vc –v is a member of the class vc –v satisifies the value restriction vc –ex_oav(v, instance_of,vc)? –vc(v) where vc is a LP rule? –vc is a list and v is a member?

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Representation of Value Classes 4 Use same representation scheme –vc is in v –ex_oav(v, instance_of,vc) –ex_oav(beige, instance_of, telephone_color) 4 Sneak some Prolog –Define telephone_color(X) as a rule that determines if X is a telephone_color. This rule becomes a representation of the potential values. –telephone_color(X) member(X, [white, black, beige]). –Delivers all the power of PROLOG to express value_class and determine value_class membership.

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Value Classes and Inherited Values 4 User value class interpretation as stated above 4 Add explicit representation of default values –Proposal 1: Use current primitives in_oav(telephone, color, telephone_color) in_oav(telephone, default_color, beige) Would this work? –Proposal 2: Have value_class representation emit a default value telephone_color(X) <- X=beige, !. %Default Value telephone_color(X) <- member(X, [beige, black, white]). %Value Restriction –Proposal 3: Add new explicit primitives to representation in_oav_default(telephone, color, beige) Develop inheritance inference to use this relation.

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Programming Workshop 0 Implement what an object-based KR language. Included the following features: –Object, Attribute and Values –Getters and Setters –Class and Instances –Inheritance and Default Values –Implement both proposals –Value Restriction

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes The IS_A Relation. What does it mean? 4 Instance_of –eagle is_a bird eagle instance_of bird? –Harry is_a eagle harry instance_of eagle? 4 Set Membership –eagle is_a bird eagle is a member of the set birds? –eagle is_a bird eagle is a subset of the set bird? –harry is_a eagle harry is a member? Subset? of the set of all eagles? 4 Predication (recognition) –eagle is_a bird bird(eagle) – bird is a predicate –eagle satisfies the predicate bird (however it is defined e.g, has wings) –But is eagle a predicate or an individual? –bald_eagle is_a eagle would suggest that eagle is a predicate. Then bird becomes 2 nd order 4 Conceptual Containment (Construction) –eagle is_a bird bird is used to construct an eagle (inheritance, value restrictions etc.) –whatever is asserted true about a bird may be inferred true about all bald eagles.

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Is-as Extensional Implication Animal MammalCat

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes The IS_A Inferences 4 Instance Inclusion –If A is_a B then if x instance_of A then x instance_of B 4 Transitivity –A is_a B ^ B is_a C A is_a C 4 Property and property value inheritance –oav(B,P,V) ^ A is_a B oav(A,P,V) –What if there are multiple values? –What about subclass overrides 4 Subsumption –Use attributes and value classes to interpret a class as a predicate. –The predicate would be used to determine membership of individuals. –Given classes A and B (and none of there members) determine if the predicate A is_a B. A is subsumed by B. All As instances are Bs instances.

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Meta-Models, Classes & Instances

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Meta^3

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Programming Project 4 Implement an object-based representation language to everything in workshop 0 plus: –Default Value Overrides –The is_a relation and its inferences –Multiple Values –Inheritance over layered models (model and meta model)

Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes The End An OO modeling system represents a fairly complex default-logic. Do you know the semantics of your OO system?

Download ppt "Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Knowledge Structures Building the Perfect Object."

Similar presentations