Presentation is loading. Please wait.

Presentation is loading. Please wait.

Specification and Knowledge Representation

Similar presentations


Presentation on theme: "Specification and Knowledge Representation"— Presentation transcript:

1 Specification and Knowledge Representation
CIS 488/588 Bruce R. Maxim UM-Dearborn 11/16/2018

2 Specification Seeks to find a way to represent the analysis concepts using formal notation or data structures Dealing with specification explicitly is a huge advantage when AI needs to be scaled up 11/16/2018

3 Procedural View of AI Consider the AI as a single procedure that needs to be passed information to return results or produce outputs In C++ prototypes are used to describe function interfaces which describe the relationships among variables external to the function At the end of the specification phase, an interface or scaffold is defined to describe how the AI fits into the rest of the system 11/16/2018

4 Types of Knowledge Objects Events Performance META Knowledge
both physical & concepts Events usually involve time maybe cause & effect relationships Performance how to do things META Knowledge knowledge about how to use knowledge 11/16/2018

5 Stages of Knowledge Use - 1
Acquisition structure of facts integration of old & new knowledge Retrieval (recall) roles of linking and chunking means of improving recall efficiency 11/16/2018

6 Stages of Knowledge Use - 2
Reasoning Formal reasoning deductive theorem proving Procedural Reasoning expert system Reasoning by Analogy very hard for machines Generalization reasoning from examples Abstraction simplification 11/16/2018

7 Knowledge Representation
Theory for expressing information in computer systems The task of defining an interface is essentially KR How should information passed to AI modules be encoded? 11/16/2018

8 Representation Set of syntactic and semantic conventions which make it possible to describe things Syntax specific symbols allowed and rules allowed Semantics how meaning is associated with symbol arrangements allowed by syntax 11/16/2018

9 Knowledge Representation Issues
Grain size or resolution detail Scope or domain Modularity Understandability Explicit versus implicit knowledge Procedural versus declarative knowledge 11/16/2018

10 Advantages Procedural representation Declarative representations
Easy to represent "how to do things" Easy to represent any knowledge not fitting declarative format Relatively easy to implement heuristic stuff on doing thing efficiently Declarative representations Store each fact once Easy to add new facts 11/16/2018

11 Good Knowledge Representations
Important things made clear /explicit Expose natural constraints Must be complete Are concise Transparent (easily understood) Information can be retrieved & stored quickly Detail suppressed (can be found as needed) Computable using existing procedures 11/16/2018

12 River Puzzle Problem Constraints
There are four items a farmer, wolf, goose, and corn. The farmer can only take one item across the river at a time. Constraints Wolf will eat the goose if left alone with it Goose will eat the corn if left alone with it 11/16/2018

13 F=Farmer W=Wolf G=Goose C=Corn ~=River
W F ~ W F G F W F G ~ G F ~ W C W C C ~ G F G ~ C F ~ W C F ~ C F W W G ~ G G ~ G C C C F C W ~ G W 11/16/2018

14 Solution Once graph is constructed finding solution is easy (simply find a path) AI programs would rarely construct the entire graph explicitly before searching AI programs would generate nodes as needed and restrict the path search to the nodes generated May use forward reasoning (initial to goal) or backward reasoning (goal to initial) 11/16/2018

15 State Space Representation
How can individual objects and facts be represented? How do you combine individual object descriptions to form a representation of the complete problem state? How can the sequences of problem states that arise be represented efficiently? 11/16/2018

16 Attributes of Good KR Schemes -1
Representational Adequacy works for all knowledge in problem domain Inferential Adequacy provides ability to manipulate structures to desire new structures ability to incorporate additional information in knowledge structures to help focus attention of promising new directions 11/16/2018

17 Attributes of Good KR Schemes - 2
Acquisitional Efficiency easy to add new knowledge Semantic Power Supports truth theory Provides for constraint satisfaction Can cope with incomplete or uncertain knowledge Contains some commonsense reasoning capability 11/16/2018

18 KR Languages - 1 Provide means for formalizing representation
Expressiveness How well language represents knowledge in general Information can expressed in notational (explicit) form or inferential (deduced from existing knowledge) form 11/16/2018

19 KR Languages - 2 Efficiency tradeoffs
Disk storage limits the use of notational forms Computational power limits the use of highly inferential forms Inference support as basis for understanding Well-defined syntax (sentence structure) Well-defined semantics (sentence meanings) 11/16/2018

20 KR Language Attributes - 1
Consistent Guarantees that statements are valid and conclusions drawn by systems are sound Complete How well does the language express the required knowledge? Extensible How easy is it to customize to particular problems? 11/16/2018

21 KR Language Attributes - 2
Natural Easy to understand by humans (esp. domain experts) Easy for humans to write when communicating with the computer There is a strong link between reasoning and representation However, most KR formalisms can be converted from one to another 11/16/2018

22 Representation Types Symbols Object-Attribute-Value (OAV)
Relational databases Constraints Predicate logic Concept hierarchies Semantic networks Frames Scripts 11/16/2018

23 Symbols Facts can be stored as text strings or numbers
This scheme can be implemented using any standard programming data types The disadvantage is that every concept needs its own variable Examples: [left_obstacle_distance 4.0] [right_obstacle “unknown”] 11/16/2018

24 OAV Objects or concepts can have multiple variables associated with them Implemented as C structs, C++ classes, Lisp property lists, Prolog predicates, database records,hash tables Generally notated as A(O,V) Examples: distance(left_obstacle,4.0) presence(right_obstacle,”unknown”) 11/16/2018

25 Semantic Networks A declarative representation in which complex entities are described as collections of attributes and associated values Sometimes called a “slot and filler” type structure To assist in their implementation AI languages provide some type of associative memory in which object can be stored as OAV triples 11/16/2018

26 Decomposition Most complex sets of objects can be decomposed into smaller subsets These decompositions often contain two types of relations “isa” and “ispart” dog isa pet isa animal isa living thing finger ispart hand ispart body 11/16/2018

27 Inverse Relations Sometimes it is also useful to define inverse relationships “ako” (a kind of) as inverse of “isa” “haspart” as inverse of “ispart” dog ako pet ako animal ako living thing finger haspart hand haspart body 11/16/2018

28 Animal Hierarchy 11/16/2018

29 Inheritance These relations form a partial ordering of the network
This allows us to use transitivity relations to aid in search Storage of information is more efficient since inheritance can be used to “copy” information from a class to its subclasses 11/16/2018

30 Inheritance 11/16/2018

31 Value Inheritance Form a queue consisting of node F and
all class nodes found in F’s “isa” slot Until queue is empty or value found if queue front has value in slot S then value found else remove first queue element and add nodes related by “isa” slot If value found then report value found in slot S announce failure. 11/16/2018

32 Semantic Nets How do semantic networks differ from ordinary directed graphs? In semantic networks there must be some underlying meeting associated with the representation (especially the edge or link labels) 11/16/2018

33 Semantic Network feathers wings bird eagle falcon has has isa isa
11/16/2018

34 Semantic Nets in C++ 1. bird 2. falcon 3. eagle 4. wings 5.feathers
has 2.falcon isa 3.eagle 4.wings 11/16/2018

35 Problems with Semantic Nets
When do you have enough semantic primitives? How do you know the selected primitives are correct? What is the smallest number of link types needed to span all human knowledge? How do you represent quantified knowledge? 11/16/2018

36 Frames Can be looked at as being similar to a “pre-defined” semantic network Frames contain information that can be used even if not observed Frames contain attributes true of all instances of object or events Frames contain stereotypical instances of objects or events 11/16/2018

37 Frame Attributes Based on stereotypes
Slot & filler type static representation Make use of procedural attachment (demons) to fill in missing values Allow us to use current explanation provided by frame until the “current view” is proven to be incorrect 11/16/2018

38 How are frame used? People may select a frame from a list of proposed frames candidates based on a small amount of partial evidence (e.g. bigot) The attributes of a selected frame are instantiated with observed attributes from the current object or event description 11/16/2018

39 How are frame used? As values for slots are found they are copied to the evolving frame description If slot values cannot be found or begin to contradict slot constraints a new frame candidate may need to be selected You may also need to be alert for changes in the object or event while the frame is being instantiated 11/16/2018

40 What happens when frame instantiation fails?
You may be able to follow pre-defined links between frames in a frame system bench table no back, too big no back, too wide drawers chair no back, too high desk stool dresser no kneehole 11/16/2018

41 What happens when frame instantiation fails?
Another option is to follow the inheritance links in the hierarchical structure formed by the frames (e.g. dog  mammal  animal) until a sufficiently “general” frame that does not conflict with the evidence is found 11/16/2018

42 Problems with Frames Frames are not very frame-like (e.g. there are more atypical mammals than typical mammals) Definitions are more important than most people think Cancellation of default properties is very a tricky business 11/16/2018

43 Scripts If frames can be viewed as using semantic networks to structure static information Scripts can be viewed as using a series of related frames to represent dynamic information as a sequence a stereotypic events from a some context 11/16/2018

44 Script Attributes Entry conditions Result Props Roles Track Scenes
When does the script apply? Result What will be true once script is completed Props Roles Track Variation or specialization of usual script pattern Scenes Actual event sequences 11/16/2018

45 Restaurant Script Track: Coffee Shop
Props: Tables, menu, food (F), check, money Roles: Customer (S), waiter (W), cook (C), casher (M), owner (O) Entry conditions: S is hungry, S has money Results: S has less money, O has more money, S not hungry, S happy (optional) 11/16/2018

46 Scripts Are useful because they record patterns of the occurrence of events from the real world These patterns are based on causal relationships between events (e.g. agents perform one action to be able to perform another action) The sequence of script events define a causal chain that will facilitate reasoning about unobserved events 11/16/2018

47 Scripts Can be used in question answering program (e.g. story comprehension) Why did a waiter bring John a menu? Scripts can also help to focus attention on unusual events as script departures John went to a restaurant, was shown to a table, ordered a large steak waited for a long time, got angry, and left. Why did John get angry? 11/16/2018

48 Scripts When a script is known to be appropriate to a given situation it can be used to predicate the occurrence of future events Example: I went to a restaurant, ordered food, paid my bill, and left Did I eat? 11/16/2018

49 Strengths of Scripts Can be used to predicate events and answer questions Provide a framework for integrating observations into a coherent interpretation Scripts provide scheme for detecting unusual events 11/16/2018

50 Weaknesses of Scripts Less general than frames so not appropriate for some knowledge types If scripts can only account for all details in a restricted domain It is unlikely that scripts can account for every real life scenario 11/16/2018

51 Introspection For KR formalisms to have any impact they need to be implemented in such a way as to allow introspection Introspection means that the AI is allowed to query knowledge properties dynamically This may require the use of extra variables or data structures that can be examined during active game play 11/16/2018

52 Specification Phases Sketching Rationalization
Typical brainstorming activity Ideas are collected and described informally Rationalization Ideas are checked for consistency with existing requirements Valid ideas are formalized by converting the sketch into some KR The KR is checked for consistency with requirements 11/16/2018

53 Role of Sketching - 1 Context Input
What goes on behind the interfaces that allows the problem to be solved? Which variables are involved and how can their complexity be minimized? Input Select relevant inputs by asking “what info does human use in this case? What problem variables for a programmer to solve this problem? 11/16/2018

54 Role of Sketching - 2 Output
How can a problem be decomposed into a sequence of actions? 11/16/2018

55 Inspiration Where do the idea for sketching come from?
Research (journals and conference proceedings) Reading (look for developer reviews and game postmortems) Relative work (look for open source projects to examine) Borrowing idea (look for things that work in other domains) 11/16/2018

56 Formalizing Involves selecting a KR language
Determining data structures needed to implement the KR in the target programming language Outputs are often easier to formalize than inputs (do this first) Failing to create good formalisms for inputs is a frequent cause of failures later The supporting variables from the context are often defined abstractly (they can be done last) 11/16/2018

57 Rationalizing Does each model allow case studies to be satisfied and do they match the informal requirements? How does model affect other requirements? (e.g. HW and SW) Is the specification consistent with the rest of the design (interfaces and hierarchical dependencies)? Are the interfaces flexible enough to handle all propose, applicable implementations? 11/16/2018

58 Specification Benefits
High-level understanding Separates implementation and design, allowing focus to be on architecture rather than programming Abstraction Only need to be concerned with module inputs and outputs Comparison If interface remains constant alternative prototype implementations can be investigated 11/16/2018

59 Sir Tank Uses straight forward reactive behaviors to bounce off of obstacles Sir Tank’s behavior does not take orientation into account This allows movement to be separated from other capabilities such as aiming 11/16/2018


Download ppt "Specification and Knowledge Representation"

Similar presentations


Ads by Google