Knowledge Representation for Artificial Intelligence (CIS 479)
Prolog
logic- predicate logic or propositional logic
P º "the apple is red" [propositional logic example]
red (apple) [predicate logic example]
isa (bear, mammal) [predicate logic example]
Declarative Programming - use depth-first search & pattern matching instead of through conventional programming.
Production Systems
Procedural knowledge
aka "How to knowledge"
Relational Database
- static
- constraints – attributes to sets of values
- Predicate Logic – Rules & Relationships
- Concept Hierarchy (object library, class library)
Semantic Networks
Perspective
Semantic Networks
Frames
- Preestablished semantic networks
Scripts
Conceptual Dependency
Types of Knowledge
- objects – physical & concepts
- Events- maybe time, maybe cause & effect
- Performance (how to)
- META Knowledge – knowledge about how to use knowledge
Stages of knowledge use
- Acquisition
- Structure of facts
- integration of old & new knowledge
- Retrieval (recall)
- Reasoning
- Formal reasoning – deductive theorem proving
- Procedural Reasoning – Expert System
- Reasoning by Analogy – Very hard for machines
- Generalization – Reasoning from examples
- Abstraction – Simplification
Knowledge Representation Issues
- Grain Size – Resolution Detail
- Scope
- Modularity
- Understandability
- Explicit Vs. Implicit Knowledge
- Procedural Vs. Declarative knowledge
Advantage of Procedural Knowledge
- Store each fact once
- Easy to add new facts
Advantage of Procedural Knowledge
- Easy to Represent "how to"
- Easy to represent any knowledge not fitting declarative format
- Relatively easy to implement heuristic stuff
Good Knowledge Representation Scheme
- Represential Adequacy – all knowledge in problem domain
- Inferential Adequacy – ability to manipulate structures to desire new structures
- Inferential Adequacy – Incorporate new knowledge & focus attention
- Acquisition – Easy to add facts
- Semantic Power
- Support Truth theory
- Constraint Satisfaction
- Cope with incomplete or uncertain knowledge
- Some Common Sense Reasoning Capability
Knowledge Representation
- Properties in every domain? - if so what are they...
- At what level should knowledge be represented?
- Given a large amount of knowledge, how do you access the relevant parts quickly
®
= is a
¬
= a kind of
dog ® pet ® living think
®
= is part of
¬
= has a part
finger ® hand ® body
Knowledge Representation Problems
- Initial selection at best structure
- Fill in details from current situation
- Find better structure if first choice is bad
- None of available structures are appropriate
- When to create and remember a new structure
Slot & Filler
(putprop ‘dog ‘animal ‘isa)
(putprop ‘animal ‘dog ‘ako)
x = lobster
y = animal
n = scallop
(defun isatest ( x y n)
(cond ((EQ x y) 7)
(( ? group n) nil)
((member y(get x ‘isa)) y)
(t (ary mapcar #’lambda (xx)
(isatest x x y)
(1 – n))
(get x ‘isa))
)
)
(defun any (l)
(cond ((null l) nil)
((car l) t)
(T (any (cdr l))
)
)
Relationship Matrix
Value Inheritance Procedure
[f = node, s = slot / property]
- Form a queue consisting of node f and all class nodes found in f’s isa state
- Until queue is empty or value found if queue front has value in s then value found else remove first queue element and add nodes related by isa
- If value found then repeat it else announce fail.
If Needed Inheritance
[f = node, s = slot / property]
- Form a queue consisting of node f and all class nodes found in f’s isa state
- Until queue is empty or value found if queue front has procedure to compute S value then value found else remove first queue element and add nodes related by isa
- If value found then repeat it else announce fail.
Default Inheritance
[f = node, s = slot / property]
- Form a queue consisting of node f and all class nodes found in f’s isa state
- Until queue is empty or value found if queue front has default value in s then value found else remove first queue element and add nodes related by isa
- If value found then repeat it else announce fail.
N-Inheritance
This method uses all three inheritance methods previously mentioned
"veritcally". First uses "value" leaf to root, then "if-needed" leaf to
root, and lastly "default" leaf to root.
Z-Inheritance
Uses all three inheritance type "horizontally" - at each level tries
"value", "if-needed", and "default".
Frame- preprinted semantic network
- Stereotypes
- Slot & Filler
- If-Needed Inheritance
- Use current explanation until current view is proven to be invalid
- Procedural Attachment (demon)
Infer unobserved attributes
- Frame contains information that can be used even if not observed
- Frame contain attributes true of all instances
- Frames contain typical instances of the object
What happens if "fleshing out" fails?
- Select fragments of current situation that match and match against other frame candidate.
- Make excuse for failure and use frame anyway.
- Refer to list of stored links.
- Inheritance links
dog ® mammal ® animal(living things)
Weakness of Frames
- Tend to not be frame like
- Definitions are important
- Cancellation of default properties is tricky
Scripts
- collection of slots
- active type information
Script attributes
- Entry condition
- Result
- Props
- Rules
- Tracks
- Scenes
Strengths
- Scripts can predict events and answer questions
- Provide a framework for integrating observations into coherent interpretation
- Provide means for detecting unusual events
Criticisms
- Ad hoc
- Either scripts only account for details in a restricted domain so they are not interesting or they apply everywhere which is not likely.
Relational Database
Relations ® tables
first second third
object relation object
- comet isa horse
- comet is-parent-of prancer
- prancer is fast
if X? isa horse
X? is-parent-of Y?
Y? is fast
then X? is valuable
- Select data with second equal to isa and third equal to horse {creates temp set}
- Project result will be first and call it A1 {horses}
- Select data with second equal to is parent
- Project result over? first and third and call it A2 {gives parent child}
- Select data with second is and third equal fast
- Project result over first
- Join A1 and A2 with A1 first equal A2 first {horses with children}
- Join B1 with A3 with B1 third A3 first.
- Project result with first
For A Data Sets
- n-1 selections
- n-1 projections
For B Data Sets
- n-1 joins
- n-1 projections
with m rules
- m*n select
- m(2n-1) projects
- m(n-1) joins