knowledge representation

26
B. Ross Cosc 4f79 1 Knowledge Representation e-based systems: those that use the knowledge structure f premise(s) then conclusion(s) ward and backward chaining are the common inference strategies ical theorem proving is the general inference paradigm when KB is encoded as logical rules using AND, OR, NOT, implication derive the logical truth or falsehood of some expression using the KB as a theory theorem proving is an active area in AI theoretical result: not all deductions are decideable; thus infer is a fundamentally complex and undecideable problem ertainty also used log: form conclusion :- premise, premise, ... conclusion.

Upload: lane

Post on 14-Jan-2016

85 views

Category:

Documents


1 download

DESCRIPTION

Knowledge Representation. • rule-based systems: those that use the knowledge structure if premise(s) then conclusion(s) • forward and backward chaining are the common inference strategies • logical theorem proving is the general inference paradigm - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Knowledge Representation

B. Ross Cosc 4f79 1

Knowledge Representation

• rule-based systems: those that use the knowledge structure

if premise(s) then conclusion(s)

• forward and backward chaining are the common inference strategies

• logical theorem proving is the general inference paradigm

- when KB is encoded as logical rules using AND, OR, NOT, implication, derive the logical truth or falsehood of some expression using the KB as a theory

- theorem proving is an active area in AI

- theoretical result: not all deductions are decideable; thus inference is a fundamentally complex and undecideable problem

• uncertainty also used

• Prolog: form conclusion :- premise, premise, ... conclusion.

Page 2: Knowledge Representation

B. Ross Cosc 4f79 2

Knowledge Representation

Problems with rule-based systems

• multiple evaluation of rule (hence saving of user input)

• large rule sets: inefficient, maintainability

- 50 rule modules maximum

- if problem decomposition is difficult, perhaps change the knowledge representation (eg. add frames)

• uncertainty: choosing a technique, interpreting results

• misfit of problems to rule-based paradigm

- not all problems naturally suited

• procedural code in rules - forcing procedural execution (eg. Oops) can be messy

- Prolog hooks are a good solution

Page 3: Knowledge Representation

B. Ross Cosc 4f79 3

Other techniques

i) Frames and object-oriented programming

ii) multiple contexts and truth-maintenance systems

iii) model-based representations

iv) blackboards

v) Case-based reasoning (CBR)

Rule of thumb:

When a knowledge base is difficult to understand and use,consider changing the representation.

Main goal: close the semantic gap between expert’s knowledge and computer implementation

Page 4: Knowledge Representation

B. Ross Cosc 4f79 4

(i) Frames (review)

• knowledge structuring technique

• "frames": lmowledge representation exploiting structure & inheritence

"object-oriented programming": associating all data and computation with objects (= frames); computation done via message passing

• benefits:

- aids structuring of KB

- more generic rules, therefore reduce size, complexity of KB

- puts data in one area/module (a frame declaration)

- maintainability of KB

- objects, once identified, can contain characteristics, rather than spread this knowledge throughout many rules

- inference engine can more effectively use/modify the data

Page 5: Knowledge Representation

B. Ross Cosc 4f79 5

Frames (cont)

• To use frames during knowledge engineering

i) decide on type of reasoning (forward, backward, other...)

ii) decide on tasks for rules and processing requirements

-iii) sketch a few rules, design a small hierarchy of frames, and test

• AI workstations have graphical frame interfaces

- permits quick definition, debugging

Problems with frames

• learning period for proper use and application

• efficiency: can be lots of execution time overhead - eg. one object change can entail 100's of subsidiary commands

• mis-use: create an inappropriate frame hierarchy/taxonomy - knowledge becomes difficult to understand - can also use too much procedural code, when declarative would be preferred

Page 6: Knowledge Representation

B. Ross Cosc 4f79 6

Frames

p.250

Page 7: Knowledge Representation

B. Ross Cosc 4f79 7

(ii) Multiple contexts

• context: single universe/world in which inference pertains

• some problems have different environments which result in different solutions

eg. time, season, path/direction, geographic location, ....

• multiple context expert system: performs separate inferences for different contexts, using the same ruleset

- otherwise, one inference and rule set to do the same

- complicated KB and rules, that need to reconcile different contexts - inefficient: too much inferencing and backtracking

• one can have multiple "parallel" inferences for all the contexts; then one can inspect the results for each and determine which is best alternative

- each uses identical KB rules, but may require their own environments (variable binding records, run-time databases, ....)

• akin to parallel processing instead of backtracking

Page 8: Knowledge Representation

B. Ross Cosc 4f79 8

Multiple contexts

p.256

Page 9: Knowledge Representation

B. Ross Cosc 4f79 9

Multiple contexts

p.257

Page 10: Knowledge Representation

B. Ross Cosc 4f79 10

Multiple contexts

• Applying multiple contexts

1. selecting context structure for problem

- problem specific - often hierarchical structure are well-suited

2. Reasoning with contexts: "fit" of context to problem <---> reasoning

(i) parallel reasoning: mutually exclusive sub-problems

(ii) pruning: trim computation space (like a "cut") - else resources can be overwhelmed - dominance: once one context is known to be best, then kill others

(iii) merging: when 2 contexts have identical facts and assumptions, incorporate them together

Page 11: Knowledge Representation

B. Ross Cosc 4f79 11

Truth maintenance systems

• monotonic reasoning: set of beliefs grow as inference proceeds

non-monotonic reasoning: adding contexts can reduce belief set (eg. by retracting facts)

• Truth maintenance systems (TMS): (consistency mgmt. systems)

- when one assumption changes, all conclusions from that assumption must be retracted (repeated)

• Three types of TMS:

i) Justification TMS: simplest - set of beliefs in assumption set is monotonic, never shrinks - facts are either believed or not; but not believing a fact is not the same as believing it is false

ii) Logic-based TMS - each predicate is true, false, unknown; represented in logic - contradictions are detected efficiently

iii) Assumption-based TMS - conexts used in parallel (as in previous overheads)

Page 12: Knowledge Representation

B. Ross Cosc 4f79 12

TMS

p.266

Page 13: Knowledge Representation

B. Ross Cosc 4f79 13

TMS

p.267

Page 14: Knowledge Representation

B. Ross Cosc 4f79 14

Multiple contexts

• Searching multiple contexts: a tree of all possible inferences

(i) breadth-first: each level is generated one-by-one, fairly - complete, but resource expensive

(ii) depth-first: Prolog technique - efficient, but possibly non-terminating

(iii) controlled: more arbitrary, can move about tree as required

"general theorem proving"

Page 15: Knowledge Representation

B. Ross Cosc 4f79 15

(iii) Model-based representation

• encode knowledge in a structure which naturally describes it• use: realtime monitoring and diagnosis of machinery - can reason about common and uncommon failures

(i) Static models

• graph, node & arcs

• good for representing connection paths between components/modules/...

supply input: forward chaiing supply output: backward chaining

• benefits:

- clarity: can permit visual representation - a direct simulation of object of interest - familiarity: permits better debugging of KB - maintenance: change components in model, rather than KB rules - simplification: KB is simpler - efficiency: compact representation of domain, smaller than with rules/facts

Page 16: Knowledge Representation

B. Ross Cosc 4f79 16

Static models

p.289

Page 17: Knowledge Representation

B. Ross Cosc 4f79 17

Static models

p.291

Page 18: Knowledge Representation

B. Ross Cosc 4f79 18

Model-based representation

(ii) dynamic models:

• the state of the model changes over time, and this state change is the phenomemon of interest

• simulation language/systems

• supply inputs, system generates output, which is simulated dynamic behavior of whole system

• used when actual domain unavailable, therefore a formal model is used as a substitute

eg. nuclear power plant, earth's ozone layer, aircraft modelling, ...

• used in many AI systems (eg. KEE)

• benefit: can ascertain data that would normally have to be treated as UNKNOWN

Page 19: Knowledge Representation

B. Ross Cosc 4f79 19

(iv) Blackboards

• blackboard: representation of knowledge with a high-level controlling element

• first used in Hearsay II

• components:

knowledge sources (KS) : modules with specific expertise (tests, actions) blackboard: knowledge storage and communication control: overall problem-solving strategy

• some control strategies

- event-driven: react to events

- expectation driven: predict solution based on current BB state, and act appropriately

- request driven: control given to the KS which seems appropriate to a particular request

- goal directed: control given to KS likely to solve some goal

Page 20: Knowledge Representation

B. Ross Cosc 4f79 20

Blackboards

p.304

Page 21: Knowledge Representation

B. Ross Cosc 4f79 21

Blackboards

•Some conditions for BB use•static knowledge sources: KS's don't change structure (BB does)

•decomposable knowledge: get a small number of complex KS's•independence of KS's: run independently without hooks to one another• - BB is a medium that buffers them•hierarchical problems: layer problem domain• - each level taken care of by one or more KS's

Page 22: Knowledge Representation

B. Ross Cosc 4f79 22

Blackboard characteristics

• Diverse approaches to problem solving

– modular, independent

• Common language for interaction

– formal interfaces

• Flexible representation of information

• Efficient storage and retrieval of information

– permits KS’s to inspect BB, and retrieve info as necessary

• Organized participation

– a distributed computing problem

• Iterative problem solving

– KS’s contribute to solution incrementally

Page 23: Knowledge Representation

B. Ross Cosc 4f79 23

Blackboards

• Some conditions for BB use

– static knowledge sources: KS's don't change structure (BB does)

– decomposable knowledge: get a small number of complex KS's

– independence of KS's: run independently without hooks to one another• BB is a medium that buffers them

– hierarchical problems: layer problem domain• each level taken care of by one or more KS's

Page 24: Knowledge Representation

B. Ross Cosc 4f79 24

Blackboards

p.315

Page 25: Knowledge Representation

B. Ross Cosc 4f79 25

Blackboards

When to use BB's

• real-time processing (speach, signal processing)

• some scheduling and planning applications

• problems which naturally decompose into separate independent tasks

• problems which are best handled procedurally

- this is also a pitfall, as BB and procedures can be applied to problems for which declarative rule-based methods would be perfectly suited

Page 26: Knowledge Representation

B. Ross Cosc 4f79 26

(v) Case-based Reasoning (CBR)

• Case: operational description of a past problem and its solution• CBR idea: experts use vast amount of past experiences to derive new solutions

– their compiled knowledge often uses pattern matching on long-past experiences

• CBR records and documents a history of past cases– then attempts to match a given program with closest past case– the more the CBR system is used, the larger it’s case history becomes, and

the more effective it can be• ideal when a problem is difficult to formulate in terms of explicit rule-based

knowledge– often, the closest case matching a new problem is sufficient for correctly

diagnosing the problem• Issue: newer cases are usually more pertinent than older ones

– CBR system should account for case ages• Note: inductive inference (ID3) is one style of CBR

– each example in table is a case