Knowledge Representation In which we show how to use first-order logic to represent the most important aspects of the real world. This is a treatise of.

Slides:



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

Knowledge Representation
Artificial Intelligence Knowledge Representation
Knowledge Representation CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Knowledge Representation
Knowledge Representation
Copyright © Cengage Learning. All rights reserved.
CLASSICAL LOGIC and FUZZY LOGIC. CLASSICAL LOGIC In classical logic, a simple proposition P is a linguistic, or declarative, statement contained within.
Instructor: Hayk Melikya
Of 27 lecture 7: owl - introduction. of 27 ece 627, winter ‘132 OWL a glimpse OWL – Web Ontology Language describes classes, properties and relations.
Semantic Nets, Frames, World Representation. Knowledge Representation as a medium for human expression An intelligent system must have KRs that can be.
For Friday Finish chapter 10 No homework (get started on program 2)
OOP - Object Oriented Programming Object Oriented Programming is an approach to programming that was developed to make large programs easier to manage.
Chapter 8: Web Ontology Language (OWL) Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley, 2005.
Knowledge Representation using First-Order Logic (Part II) Reading: Chapter 8, First lecture slides read: Second lecture slides read:
Objects Objects are at the heart of the Object Oriented Paradigm What is an object?
Part 6: Description Logics. Languages for Ontologies In early days of Artificial Intelligence, ontologies were represented resorting to non-logic-based.
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name Position (123) University Name.
Protege OWL Plugin Short Tutorial. OWL Usage The world wide web is a natural application area of ontologies, because ontologies could be used to describe.
INF 384 C, Spring 2009 Ontologies Knowledge representation to support computer reasoning.
For Friday Exam 1. For Monday No reading Take home portion of exam due.
USCISIUSCISI Background Description Logic Systems Thomas Russ.
Alternative representations: Semantic networks
Knowledge Representation CPTR 314. The need of a Good Representation  The representation that is used to represent a problem is very important  The.
For Wednesday Read chapter 13 Homework: –Chapter 10, exercise 5 (part 1 only, don’t redo) Progress for program 2 due.
1 Chapter 10 Knowledge Representation. 2 KR previous chapters: syntax, semantics, and proof theory of propositional and first-order logic Chapter 10:
Temporal Reasoning and Planning in Medicine Frame-Based Representations and Description Logics Yuval Shahar, M.D., Ph.D.
1 Knowledge Representation CS 171/CS How to represent reality? Use an ontology (a formal representation of reality) General/abstract domain Specific.
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
Artificial Intelligence Chapter 18. Representing Commonsense Knowledge.
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Knowledge Representation Semantic Web - Fall 2005 Computer.
Object Oriented Software Development
Semantic Nets, Frames, World Representation CS – W February, 2004.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
1 CS 2710, ISSP 2610 Chapter 12 Knowledge Representation.
Copyright © Cengage Learning. All rights reserved.
2.1 Sets 2.2 Set Operations –Set Operations –Venn Diagrams –Set Identities –Union and Intersection of Indexed Collections 2.3 Functions 2.4 Sequences and.
Some Thoughts to Consider 8 How difficult is it to get a group of people, or a group of companies, or a group of nations to agree on a particular ontology?
Lecture 2 (Chapter 2) Introduction to Semantics and Pragmatics.
1 CS 385 Fall 2006 Chapter 7 Knowledge Representation 7.1.1, 7.1.5, 7.2.
For Wednesday Read chapter 13 No homework. Program 2 Any questions?
ece 627 intelligent web: ontology and beyond
For Monday after Spring Break Finish chapter 12 Homework –Chapter 12, exercise 7.
1 CS 2710, ISSP 2160 Chapter 12, Part 1 Knowledge Representation.
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
EntityRelationshipDiagrams. Entity Relationship Models The E-R (entity-relationship) data model views the real world as a set of basic objects (entities)
Reasoning Systems For Categories By Franklyn O. Reasoning Systems For Categories Categories are the primary building blocks of any large-scale knowledge.
Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250.
Of 29 lecture 15: description logic - introduction.
Knowledge Representation. So far... The previous chapters described the technology for knowledge-based agents: – the syntax, semantics, and proof theory.
Artificial Intelligence Knowledge Representation.
16 April 2011 Alan, Edison, etc, Saturday.. Knowledge, Planning and Robotics 1.Knowledge 2.Types of knowledge 3.Representation of knowledge 4.Planning.
1 CS 2710, ISSP 2160 Chapter 12 Knowledge Representation.
Artificial Intelligence Logical Agents Chapter 7.
OWL (Ontology Web Language and Applications) Maw-Sheng Horng Department of Mathematics and Information Education National Taipei University of Education.
COP Introduction to Database Structures
Knowledge Representation Techniques
LECTURE 11 Knowledge Representation
ece 720 intelligent web: ontology and beyond
Knowledge Representation
Business Process Measures
UML Class Diagrams: Basic Concepts
ece 720 intelligent web: ontology and beyond
Ontology.
Issues in Knowledge Representation
ITEC 3220A Using and Designing Database Systems
Weak Slot-and-Filler Structures
Knowledge Representation
Presentation transcript:

Knowledge Representation In which we show how to use first-order logic to represent the most important aspects of the real world. This is a treatise of chapter 12 of Russel & Norvig: AIMA (Ed.3) The notation for FOL will be in implicative normal form, which makes the examples executable.

Categories and Objects The organization of objects into categories is a vital part of KR. Important relationships are subclass relation (AKO - a kind of) AKO. instance relation ( ISA - is a) ISA.

The upper ontology(*) Anything AbstractObjects GeneralizedEvents Sets Numbers Representations Intervals Places PhysicalObjects Processes Categories Sentences Measurements Moments Things Stuff Times Weights Animals Agents Solid Liquid Gas Humans (*) This is AIMA ’s version. Other authors have other partitions. See bus_semantics

Bus semantics % thing top node unkn ako thing. event ako thing. set ako thing. cardinality ako number. member ako thing. amount ako thing. abstract ako thing. activity ako thing. agent ako thing. company ako agent. % e.g. TT contact ako thing. content ako thing. group ako thing. identity ako thing. information ako thing. list ako thing. mass ako thing. % => stuff measure ako thing. meta ako thing. % lexical object object ako thing. % class. part ako thing. place ako thing. river ako thing. % (water but no area) story ako thing. study ako activity. subset ako thing. version ako abstract. accident ako activity. activation ako activity. % start of it addition ako abstract. address ako place. advice ako abstract. age ako year. % (measure) agreement ako abstract. % air ako place. % kan bussen gå i lufta ? analysis ako abstract. animate ako agent. application ako activity. area ako measure. % ….. % + (750 ako items)

Categories Category is a kind of set and denotes a set of objects. A category has a set of properties that is common to all its members. Categories are formally represented in logic as predicates, but we will also regard categories as a special kind of objects. We then actually introduce a restricted form of second order logic, since the the terms that occur may be predicates. Example: Elephants and Mammals are categories. The set denoted by Elephants is a subset of the set denoted by Mammals. The set of properties common to Elephants is a superset of the set of properties common to Mammals.

Taxonomy Subcategory relations organize categories into a taxonomy or taxonomic hierarchy. Other names are type hierarchy or class hierarchy. We state that a category is a subcategory of another category by using the notation for subsets Basketball  Ball We will also use the notation ako(basketball,ball).

Category representations There are two choices of representing categories in first order logic: predicates and objects. That is, we can use the predicate Basketball(b) or we can reify the category as an ”object” basketball. We could then write member(x,basketball) or x  basketball We will also use the notation isa(x,basketball). Basketball is a subset or subcategory of Ball, which is abbreviated Basketball  Ball We will also use the notation ako(basketball,ball).

Inheritance Categories serve to organize and simplify the knowledge base through inheritance. If we say that all instances of Food is edible (edible is in the property set of Food), and if we assert that Fruit is a subcategory of Food, and Apple is a subcategory of Fruit, then we know that every apple is edible. We say that the individual apples inherit the property of edibility, in this case from their membership in the Food category.

Reifying properties An individual object may have a property. For example, a specific ball, BB9 can be round. In ordinary FOL, we write Round(BB9). As for categories, we can regard Round as higher order object, and say BB9 has the property Round We will also use the notation hasprop(BB9,round).

Reifying Property Values Some properties are determined by an attribute and a value. For example, the diameter of my basketball BB 9 has diameter 9.5: Diameter(BB 9 )=9.5 We can also use the notation has(bb9,diameter,9.5). An alternative representation for properties, when regarded as Boolean attributes is has(BB9,round,true). In the same manner, we can express that a red ball has colour = red. has(BB9,colour,red).

Logical expressions on categories An object is a member of a category isa(bb9,basketball). A category is a subclass of another category ako(basketball,ball). All members of a category have som properties isa(X,basketball) => hasprop(X,round). Members of a category can be recognized by some properties, for example: hasprop(X,orange) and hasprop(X,round) and has(X,diameter,9.5) and isa(X,ball) => isa(X,basketball) A category as a whole has some properties isa(teacher,profession). Here, it is a fallacy to conclude that isa(tore,teacher) and isa(teacher,profession)=>isa(tore,profession).

Category Decompositions We can say that both Male and Female is a subclass of Animal, but we have not said that a male cannot be a female. That is expressed by Disjoint({Male,Female}) If we know that all animals are either male or female, (they exhaust the possibilities) Exhaustive({Male,Female},Animals). A disjoint exhaustive decomposition is known as a partition Partition({Male,Female},Animals).

Physical Compositions One object can be a part of another object. Example, declaring direct parts part(bucharest,romania). part(romania,eastern_europe). part(europe,earth). We can make a transitive extension partof part(Y,Z) and partof(X,Y) => partof(X,Z). and reflexive (*) partof(X,X). Therefore we can conclude that partof ( bucharest,earth) (*) depending on definition

Bunch It is also useful to define composite objects with definite parts but no particular structure. For example, we might say ”The apples in the bag weigh two pounds” It is adviced that we don’t regard these apples as the set of (all) apples, but instead define them as a bunch of apples. For example, if the apples are Apple1,Apple2 and Apple3, then BunchOf({Apple1,Apple2,Apple3}) Denotes the composite object with three apples as parts, not elements.

More about bunches The category of deodorant actually denotes the set of all deodorants in the world. A subset of this, e.g. mydeodorants is a subset of these, i.e. ako(mydeodorants,deodorant). However, we are often interested in a set as being a composite object, with properties connected to the collected properties of the elements, like the cardinalty of the set, weight, price etc. To make this distinction, we can use the concept "bunch". A bunch is both similar to a category and to an unstructured composite object. mydeodorants isa “bunch of “ deodorant (o bjects) isa(mydeodorants,deodorant). We shall introduce the notation as a combination: bunch(mydeodorants,deodorant). We also allow various expressions for the bunch objects: bunch({apple1,apple2,apple2},apple). bunch({apples,tomatoes},fruit). partof(twopoundoftomatoes,sometomatoesandbeef).

Substances and Objects The real world can be seen as consisting of primitive objects (particles) and composite objects. A common characteristic is that they can be counted (individuated) However, there are objects that cannot be individuated like Butter, Water, Nitrogen, Wine, Grass, etc. They are called stuff, and are denoted in English without articles or quantifiers (not ”a water”). Typically, they can be divided without loosing their intrinsic properties. When you take a part of a substance, you still have the same substance. isa(X,butter) and partof(Y,X)=>isa(Y,butter). We can say that butter melts at 30 degrees centigrade isa(X,butter) =>has(X,meltingpoint,30).

Measures, Abstracts,Mentals In the common world, objects have height, mass, cost and so on. The values we assign for these properties are called measures. We imagine that the universe includes abstract ”measure objects” such as length. Measure objects are given as a number of units, e.g. meters. Logically, we can combine this with unit functions Length(L1) = Inches(1.5) = Centimeters(3.81) Another way is to use predicates Length(L1,1.5,inches) Abstract concepts like ”autonomy”, ”quality” are difficult to represent without seeking artificial measurements. (e.g. IQ). Mental concepts are beliefs, thoughts, feelings etc.

Reasoning systems for categories Semantic networks and Description Logics are two closely related systems for reasoning with categories. Both can be described using logic. Semantic networks provide graphical aids of visualizing the knowledge base, together with efficient algoritms for inferring properties of an object on the basis of its category membership. Description logics provide a formal language for constructing and combining category definitions, and efficient algorithms for deciding subsets and superset relationships between categories.

Semantic Networks Example Mammal Person Male Female Mary John 2 HaveMother Legs isa ako brother sister 1 ako

Link types in semantic nets There are 3 types of entities in a semantic nets categories, objects and values (other than these) Then there could be 9 different types of relations between these. They are drawn with certain conventions. Note that objects can act as values also. category  category ako(C1,C2) every C1 is a.k.o. C2 category  category haveatt(C1,R,C2) every C1has a R a.k.o C2 category  value have(C1,R,V) every C1 has attribute value R = V object  category isa(O,C) O is a C object  object has(O1,R,O2) O1 has relation R to O2 object  value has (O,R,V) O has attribute value R=V object  object partof (O1,O2) O1 is a part of O2 In addition, we have all kinds of relations between values. value* V1 > 2*V2 +5

Further comments on link types We know that persons have female persons as mothers, but we cannot draw a HasMother link from Persons to FemalePersons because HasMother is a relation between a person and his or her mother, and categories do not have mothers. For this reason, we use a special notation – the double boxed link. In logic, we have given it the name haveatt, e.g. haveatt(person,mother,femaleperson). Compare this to haveatt(lion,mother,lioness). We also want to express that persons normally have two legs.As before, we must be careful not to assert that categories have legs; instead we use a single-boxed link. In logic, we have given it the name have, e.g. have(person,legs,2).

Content of semantic net A paraphrase of the knowledge All persons are mammals All females are persons All males are persons Persons have a mother who is female Persons have normally 2 legs John has 1 leg Mary isa female John is a male John has a sister Mary Mary has a brother John Logic representation ako(person,mammal). ako(female,person). ako(male,person). haveatt(person,mother,female). have(person,legs,2). has(john,legs,1). isa(mary,female). isa(john,male). has(john,sister,mary). has(mary,brother,john).

Inheritance and inference in semantic nets The rules of inheritance can now be automated using our logic representation of semantic nets. isa(X,Y) and ako(Y,Z) => isa(X,Z). have(Y,R,V) and isa(X,Y) => has(X,R,V). haveatt(C,R,M) and isa(X,C) and has(X,R,V) => isa(V,M). With these definitions, we can prove that Mary has two legs, even if this information is not explicitly represented.

Example of inheritance isa(X,Y)and ako(Y,Z)=>isa(X,Z) have(X,Y,Z)and isa(A1,X)=>has(A1,Y,Z) haveatt(X,Y,C) and isa(A1,X) and has(A1,Y,V) => isa(V,C). t=>ako(person,mammal) t=>ako(female,person) t=>ako(male,person) t=>haveatt(person,mother,female) t=>have(person,legs,2) t=>isa(mary,female) t=>isa(john,male) t=>has(john,legs,1) t=>has(john,sister,mary) t=>has(mary,brother,john) PROOF: has(mary,legs,2) because have(person,legs,2) and isa(mary,person) have(person,legs,2) is true isa(mary,person) because isa(mary,female) and ako(female,person) isa(mary,female) is true ako(female,person) is true

Multiple inheritance in a hierarchy An attribute of a class can be given an attribute value. This is a default value that can be redefined in any of its subclasses. In the example, it is stated that persons normally have 2 legs, while John, who is a person, has 1 leg. Actually, there are conflicting evidence, but the ambiguity is solved by stating that the innermost definition, most specific definition takes place, i.e. John’s definition. This will be made precise later.

Multiple Inheritance We have described a type of semantic nets that can be characterized as a hierarchy: Each category is a subclass of exactly one superclass. However, things are not that simple. Take for instance a girl, who is both a child and a female. Such networks are called a heterarchy. Inheritance in heterarchies is a bit more complicated. The following semantic network is an extension of the previous example.

Example of heterarchy Mammal Person Male Female Mary John 2 Legs isa ako 1 Child ako Boy Girl Height Legs AliceRobert isa Height 100 HaveMother omitted What is the height of Mary,Alice,Robert and John?

Heterarchy in Logic ako(person,mammal). ako(female,person). ako(male,person). ako(child,person). ako(girl,female). ako(girl,child). ako(boy,male). ako(boy,child). haveatt(person,legs,number). haveatt(person,height,centimeter). isa(mary,female). isa(john,male). isa(alice,girl). isa(robert,boy). has(john,legs,1). have(person,legs,2). have(person,height,175). have(female,height,170). have(child,height,100). % have(male,height,180). % omitted for sake of demonstration

Inheritance results 1. Mary has legs = 2 % default inheritance from person 2. John has legs = 1 % explicitly stated 3. Mary has height = 170 % default inheritance from female 4. John has height = 175 % default inheritance from person 5. Robert has height = 100 % default inheritance from child, priority over % inheritance from person 6. Alice has height = 100 and height=170. % contradicting values, no priority

Description Logics Description logics are notations that are designed to make it easier to describe definitions and properties of categories. The most important inference task is subsumption checking if one category is a subset of another classification checking if an object belongs to a category consistency checking if a description is satisfiable Small example Bachelor = And(Unmarried,Adult,Male) The equivalent first-order logic woul be Bachelor(x)  Unmarried(x)  and Adult(x)  Male(x)

Description Logic example Example: Describe the set of men with at least three sons who are all unempoyed and married to doctors and at most two daughters who are all professors in physics ot math departments And(Man,AtLeast(3,Son),AtMost(2,Daughter), All(Son,And(Unemployed,Married,All(Spouse,Doctor))), All(Daughter,And(Professor,Fills(Department,Phusics,Math)))). As the example shows, Description Logic is a kind of variable-free logic that can be translated to FOL (”exercise”)