3Elements of a Representation Represented world: about what?Representing world: using what?Representing rules: how to map?Process that uses the representation: conventions and systems that use the representations resulting from above.A representation will always be missing some property of the real world entity it is trying to model.
4Marr’s levels of description Computational: What is the goal of the computation, why is it appropriate, and what is the logic of the strategy by which it can be carried out?Algorithmic: How can this computational theory be implemented? In particular, what is the representation for the input and output, and what is the algorithm for the transformation?Implementation: How can the representation and algorithm be realized physically?
5Marr’s levels of description cont. Computational: a lot of cognitive psychologyAlgorithmic: a lot of cognitive scienceImplementation: neuroscience
6Overview How knowledge representation works Basics of logic (connectives, model theory, meaning)Basics of knowledge representationWhy use logic instead of natural language?QuantifiersOrganizing large knowledge basesOntologyMicrotheoriesResource: OpenCyc, WordNet, UMLS
7The CYC ProjectIt now ‘knows’ a huge collection of fragments of real-world knowledge such as:Mothers are older than their children.You have to be awake to eat.You can usually know people’s noses, but not their hearts.If you cut a lump of peanut butter in half, each half is a lump of peanut butter, but if you cut a table in half, neither half is a table.
8The CYC ProjectThe ultimate objective is to give it enough knowledge to understand ordinary books, so that it can read them and expand its own knowledge.So far, it’s got to a stage where, when asked to find photos of “risky activities”, it located photos of people climbing mountains and doing white-water rafting.
9How Knowledge Representation Works Intelligence requires knowledgeComputational models of intelligence require models of knowledgeUse formalisms to write down knowledgeExpressive enough to capture human knowledgePrecise enough to be understood by machinesSeparate knowledge from computational mechanisms that process itImportant part of cognitive model is what the organism knows
10How knowledge representations are used in cognitive models Questions,requestsAnswers,analysesExamples,StatementsContents of KB is part of cognitive modelSome models hypothesize multiple knowledge bases.InferenceMechanism(s)LearningMechanism(s)KnowledgeBase
11Expert SystemsKBS on a domain that requires expertise (mainly rule-based, but not always)Rules capture “shallow” knowledge; alternative is to reason about “first principles” or “deep” knowledge (e.g. “Ohm’s law”)Handling “uncertainty” in rulesMYCIN:“certainty factor”
12Knowledge Representation: revisited Production Rulesif leaves are yellowed ANDsoil is moist ANDsmall white spots on undersides of leavesthenplant is infested with spider mitestreat with DIANTHONINEPredicate Calculuscolor(ball, red).Semantic netcolorball23red
13Semantic Net bill “Bill is a cat.” inst feline species cat dog mammal animallivingpawclawcaninehairisahas-partfoot
14Knowledge Representation using structured objects Frames
15Frames Devised by Marvin Minsky, 1974. Incorporates certain valuable human thinking characteristics:Expectations, assumptions, stereotypes. Exceptions. Fuzzy boundaries between classes.The essence of this form of knowledge representation is typicality, with exceptions, rather than definition.
17How frames are organized A frame system is a hierarchy of framesEach frame has:a name.slots: these are the properties of the entity that has the name, and they have values. A particular value may be:a default valuean inherited value from a higher framea procedure, called a daemon, to find a valuea specific value, which might represent an exception.
18Frames: some examplesWe will start with a simple piece of information: there is a category of things called cars.Given this information, we can start to build a frame:
20More information: a car has 4 wheels, is moved by an engine, and runs on petrol or diesel. We can now add three slots to the frame.The last of these has a restriction rather than a specific value.
21“a car has 4 wheels, is moved by an engine, and runs on petrol or diesel.” car subclass_ofthingwithwheels: 4,moved_by: engine,fuel:[value:unknown,type:[petrol,diesel]].Name: car Subclass of: thingSlots:Name: Value: Restrictions:wheels 4moved by enginefuel ? petrol or diesel
22More information: there is a particular type of car called a VW, manufactured in Germany. We can add a second frame to our system, with one slot. We don’t need to repeat the slots and values in the previous frame: they will be inherited.
23“there is a particular type of car called a VW, manufactured in Germany.” ‘VW’ subclass_ofcarwithmade_in:‘Germany’.Name: VW Subclass of: carSlots:Name: Value: Restrictions:made in Germany
24More information: there is a particular type of VW called a Golf, which has a sun-roof. We can add a third frame to our system, with one slot. Once again, we don’t repeat the slots in the previous frames, because they will be inherited.
25“there is a particular type of VW called a Golf, which has a sunroof.” ‘Golf’ subclass_ofVWwithtop: sunroof.Name: Golf Subclass of: VWSlots:Name: Value: Restrictions:top sunroof
26More information: there is a particular type of Golf called a TDi, which runs on diesel. A TDi has 4 cylinders, and an engine capacity of 1.8 litres.We can add a fourth frame to our system, with three slots. One of the slots (fuel) was already in the system, but appears here because it now has a specific value rather than a restriction.
27“there is a particular type of Golf called a TDi, which runs on diesel, has 4 cylinders, and has a 1.8 litre engine.”‘TDi’ subclass_of‘Golf’withfuel: diesel,engine_capacity:1.8,cylinders: 4.Name: TDi Subclass of: GolfSlots:Name: Value: Restrictions:fuel dieselenginecapacity litrescylinders 4
28ScriptsKnowledge representation researchers - particularly Roger Schank and his associates - devised some interesting variations on the theme of structured objects.In particular, they invented the idea of scripts (1973).A script is a description of a class of events in terms of contexts, participants, and sub-events.
29Plans and Scripts Roger Schank Example: Restaurant Script “John went to a restaurant. He ordered lobster. He paid the bill and left.”What did John eat?
30ScriptsRather similar to frames: uses inheritance and slots; describes stereotypical knowledge, (i.e. if the system isn't told some detail of what's going on, it assumes the "default" information is true), but concerned with events.Somewhat out of the mainstream of expert systems work. More a development of natural-language-processing research.
31Scripts Why represent knowledge in this way? Because real-world events do follow stereotyped patterns. Human beings use previous experiences to understand verbal accounts; computers can use scripts instead.Because people, when relating events, do leave large amounts of assumed detail out of their accounts. People don't find it easy to converse with a system that can't fill in missing conversational detail.
32Scripts Scripts predict unobserved events. Scripts can build a coherent account from disjointed observations.
33ScriptsCommercial applications of script-like structured objects: work on the basis that a conversation between two people on a pre-defined subject will follow a predictable course.Certain items of information need to be exchanged.Others can be left unsaid (because both people know what the usual answer would be, or can deduce it from what's been said already), unless (on this occasion) it's an unusual answer.
34What’s in a knowledge base? Facts about the specifics of the worldFordham is a private universityThe first thing Andrea did at the party was talk to John.Rules (aka axioms) that describe ways to infer new facts from existing factsAll triangles have three sidesAll elephants are greyFacts and rules are stated in a formal languageGenerally some form of logic (aka predicate calculus)
35Propositional logic A step towards understanding predicate calculus Statements are just atomic propositions, with no structurePropositions can be true or falseStatements can be made into larger statements via logical connectives.Examples:C = “It’s cold outside” ; C is a propositionO = “It’s October” ; O is a propositionIf O then C ;if it’s October then it’s cold outside
36Model Theory Meaning of a theory = set of models that satisfy it. Model = set of objects and relationshipsIf statement is true in KB, then the corresponding relationship(s) hold between the corresponding objects in the modeled worldThe objects and relationships in a model can be formal constructs, or pieces of the physical world, or whateverMeaning of a predicate = set of things in the models for that theory which correspond to it.E.g., above means “above”, sort of
37Representations as Sculptures How does one make a statue of an elephant?Start with a marble block. Carve away everything that does not look like an elephant.How does one represent a concept?Start with a vocabulary of predicates and other axioms. Add axioms involving the new predicate until it fits your intended model well.Knowledge representation is an evolutionary processIt isn’t quick, but incremental additions lead to incremental progressAll representations are by their nature imperfect
38NL vs. Logic: Expressiveness Jim’s injury resulted from his falling.Jim’s falling caused his injury.Jim’s injury was a consequence of his falling.Jim’s falling occurred before his injury.NL: Write the rule for every expression?Knowledge representation requires a representation language. Candidate representation languages range from natural languages (such as English or Turkish) to logic-based langauges to object-oriented programming languages and others. CycL, the language used for knowledge representation in Cyc, is a (high-level) logic-based language. This section explores the reasons for that choice, and the advantages of logic-based knowledge representation.One issue in the choice of representations is expressiveness. Since we want a great deal of expressiveness for the kind of knowledge Cyc is going to contain, it is sometimes suggested that we use natural language. The expressiveness of natural language, though, goes beyond what we need. It also gives rise to special problems if one wants not only to store, but also to reason with, the represented knowledge. Logic-based representation, in contrast, gives us enough expressiveness, and facilitates the reasoning as well.Natural language is obviously very expressive. But this can lead to problems. Consider the first three sentences on the slide. Each of these means roughly the same thing and each of them has the implication that Jim’s falling occurred before his injury. If we want to represent that implication, do we write a rule for every natural language expression that could possibly express this point?Logic-based languages offer a simplified, more efficient approach. First, we identify the common concepts – for example, the relation “x caused y” – at the heart of the English sentences. Then, we use logical relationships to formulate rules about those common concepts. For example, “if x caused y, then x temporally precedes y”.Logic: identify the common concepts, e.g.the relation: x caused yWrite rules about the common concepts, e.g.x caused y x temporally precedes y
39NL vs. Logic: Ambiguity and Precision x is at the bank.river bank?financial institution?x is running.changing location?operating?a candidate for office?NL:AmbiguousLogic:Precisex is running-InMotion x is changing locationx is running-DeviceOperating x is operatingx is running-AsCandidate x is a candidateAnother issue in the choice of a knowledge representation language is ambiguity. Natural language is highly ambiguous. For example, if we say, “x is at the bank,” we don’t know whether what is meant is the riverbank or a financial institution. If we say that x is running, we don’t know whether x is changing location, operating (like a piece of machinery), or running as a candidate for office. On the other hand, with a logical representation we can precisely define the concepts we use. We can, for example, define a distinct concept corresponding to each of these three senses of "running." This allows us to place the appropriate rules on their respective concepts, whereas they could not all be placed on the one ambiguous word.This matters greatly for representation of knowledge in the Cyc Knowledge Base. After all, we are representing the knowledge for a purpose: we want to use the represented knowledge in reasoning. Reasoning means, at least in part, figuring out what must be true, given what is known. In order to reliably figure out what follows from what you know, you must be able to specify the starting point. Reasoning requires a clear understanding of exactly what knowledge you have. In other words, reasoning requires precision of meaning.Reasoning: Figuring out what must be true, given what is known. Requires precision of meaning.
40NL vs. Logic:Calculus of Meaning Logic: Well-understood operators enable reasoning:Logical constants: not, and, or, all, someNot (All men are taller than all women).All men are taller than 12”.Some women are taller than 12”.Logic also has the advantage of offering us a calculus of meaning. Logic features several well understood logical operators, such as those listed on the slide. They are well understood in the sense that they have been studied for years and their operation is well-documented.For example, consider the sentences: “It is not the case that all men are taller than all women.” And also: “It is the case that all men are taller than twelve inches.” It follows from these two sentences that some women are taller than twelve inches.You can express the format of these sentences and find the conclusion based on the logical constants alone, without knowing what the particular non-logical words (such as men, taller, and women) mean. This is very helpful for reasoning.Not (All A are F than all B).All A are F than x.Some B are F than x.
41Syntax: Terms (aka Constants) Terms denote specific individuals or collections(relations, people, computer programs, types of cars )Each Terms is a character string prefixed byA sampling of some constants:Dog, SnowSkiing, PhysicalAttributeBillClinton,Rover, DisneyLand-TouristAttractionlikesAsFriend, bordersOn, objectHasColor, and, not, implies, forAllRedColor, Soil-SandyThese denote collectionsThese denote individuals :Partially Tangible IndividualsRelationsAttribute ValuesCycL constants denote specific individuals or collections, such as individual relations, individual people, types of computer programs, or types of cars. Each CycL constant is prefixed by the string ‘’ (pronounced “hash-dollar”).Here’s a sampling of some constants. Each constant in the first group denotes a collection. For example, Dog denotes the collection of all dogs, SnowSkiing denotes the collection of all snow skiing events, and PhysicalAttribute denotes the collection of physical attributes.Each constant in the second group denotes an individual. For example BillClinton, Rover, and DisneyLand-TouristAttraction denote partially tangible individuals, individuals you can physically pick out. likesAsFriend, bordersOn, objectHasColor, and, not, implies, and forAll also denote individuals, but these are individual relations, rather than tangible objects.Each constant in the final group denotes an attribute value. Attribute values are specific properties that something can have, such as being red in color or being sandy-soiled.
42Syntax: PropositionsPropositions: a relation applied to some argumentsAlso called formulas, sentences…Examples:(isa GeorgeWBush Person)(likesAsFriend GeorgeWBush AlGore)A CycL formula is a relation applied to some arguments, with parentheses around the group. The slide contains three examples of CycL formulas.The first two of these formulas are CycL sentences. They are well-formed formulas with a truth-function in the first position (a.k.a the arg0 position). [We'll say more about truth functions shortly.] All sentences have a truth value; that is, it may be true or false. The first sentence says that GeorgeWBush is an instance of Person. The second sentence says that GeorgeWBush likes AlGore as a friend.The third formula is not a sentence, and cannot be true or false. Instead, it is a Non-Atomic Term (also known as a “NAT”). Instead of denoting a sentence, this formula gives us a new term, referring to a particular event: the birth of Jacqueline Kennedy Onassis.The next two slides look at CycL Sentences and CycL Non-Atomic Terms in more detail.
43Why constraints are important They guide reasoning(performedBy PaintingTheHouse Brick2)(performedBy MarthaStewart CookingAPie)They constrain learning
44Variables and Quantifiers General statements can be made by using variables and quantifiersVariables in logic are like variables in algebraSentences involving concepts like “everybody,” “something,” and “nothing” require variables and quantifiers:Everybody loves somebody.Nobody likes spinach.Some people like spinach and some people like broccoli, but no one likes them both.Putting variables, connectives, predicates, and quantifiers together gives us expressive power to represent many things about the world that would be too complex to represent without them. Many pieces of ordinary knowledge involve concepts like everything, something, and nothing, or everybody, somebody, and nobody.