Download kb1

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Ecological interface design wikipedia , lookup

Linear belief function wikipedia , lookup

Logic programming wikipedia , lookup

History of artificial intelligence wikipedia , lookup

Personal knowledge base wikipedia , lookup

Expert system wikipedia , lookup

Knowledge representation and reasoning wikipedia , lookup

Transcript
Knowledge Representation
• General problem-solving techniques are useful, but
effectiveness often depends on extensive, domainspecific knowledge.
• Knowledge-based systems use a KNOWLEDGE
BASE (KB) of facts about the world
• Knowledge usually comes from “experts” who have
experience solving problems in the domain.
• A language is needed to describe the knowledge and
dictate how it can be used – this is the knowledge
representation (KR) language.
How knowledge representations
are used in artificial intelligence
Questions,
requests
• Contents of KB is
part of cognitive
model
• Some models
hypothesize
multiple
knowledge
bases.
Answers,
analyses
Inference
Mechanism(s)
Examples,
Statements
Learning
Mechanism(s)
Knowledge
Base
Examples of Data
• Age
– Integer,float?
– Unit?
– Range?
• Jobs
– What attributes do you need
– What descriptors are best
Examples of knowledge
• Is it possible to see a person’s skill level in a
job description?
– If so, how can you get the computer to understand this?
• How about a diagnosis for a programming
bug?
• How about managing programmers?
• And, the fast-increasing knowledge about
computers, operating systems, web
applications, etc.
Properties of a knowledge
representation language
• Expressiveness – can all the knowledge required for
the problem be represented adequately?
• Naturalness – Does the representation allow the
knowledge to be input and manipulated in a natural
fashion?
• Efficiency – Can the system access and process the
domain knowledge efficiently?
• Inference – Does the representation support the
generation of inferences? (new knowledge)
Levels of knowledge
We can talk about knowledge at different levels:
• The knowledge level describes what is known
independent of the representation. (e.g., knowing
that robins are birds)
• The logical level describes the statement(s) in the
KR model that represent a fact. (e.g., knowing that
isa(robin,bird).
• The implementation level refers to the way in which
the knowledge is encoded, (e.g., isa(robin,bird)
might be encoded as a list, array, database record,
etc.)
Getting started
• What types of information need to be
represented?
• Which knowledge representation model
should we use?
• How should information be encoded in the
knowledge representation model?
• How will the information be accessed?
Knowledge Representation
• Closed World Assumption: Most AI systems
assume that all true assertions about the
world are contained in the KB (directly or
inferable). This assumption can cause major
problems if relevant information is omitted.
• The Frame Problem: During problem-solving
a program must keep track of which facts
change and which do not.
Types of Knowledge
•
•
•
•
•
Declarative: facts about the world.
– EX: Robins have wings
Procedural: Operations embodying knowledge
– EX: an algorithm for addition
Analogy: Associating knowledge about different things.
– EX: Robins can fly. Robins are like sparrows. So I suspect that
sparrows can fly too.
Generalization: Making generalizations from specific examples:
– EX: Robins can fly, sparrows can fly, cardinals can fly…I suspect all
birds can fly.
Meta-level Knowledge: Knowledge about what is known.
– EX: I don’t know Jim Rogers, so I probably don’t know his phone
number.
Explicit vs. Implicit
Knowledge
• Explicit knowledge is information that is
encoded directly in the representation.
– EX: robin has-part wing
• Implicit knowledge is information that can be
derived from the representation.
– EX: bird has-part wing and robin isa a bird, therefore robin
must have a wing too.
Trade-off: Relying on implicit knowledge can
reduce the size of the knowledge base, but it
can increase the access time….
Knowledge Representation
Models
•
•
•
•
•
•
Propositional Logic
Predicate Calculus
Production Systems (rule-based systems)
Semantic networks
Frames
Bayesian Networks
Logic
• Logic is a formal representation model.
Logical statements are precise and
unambiguous.
• A logical system consists of:
1. A language for expressing propositions about the world.
2. Rules for inferring new facts (propositions) from those
already known.
• Rules of inference are syntactic. Inference
can be done mechanically without knowing
the meaning of the statements.
Propositional Logic
• In propositional logic, a symbol represents a whole proposition
(facts). For example, P might mean that ``Elvis is alive''.
• Boolean connectives can generate complex statements.
Propositional logic does not use variables or quantifiers.
• A propositional logic consists of:
Logical Constants: true false
Proposition Symbols: P, Q, R, ...
Logical connectives: ^, -,=>, 
Parentheses: ( )
Propositional logic is an extremely simple representation language!
The Logical Connectives
 represents a conjunction, such as P  Q. The
components are called conjuncts.
 represents a disjunction, such as P  Q. The
components are called disjuncts.
 represents implication, such as P  Q. P is the
antecedent and Q is the consequent. (Essentially an
if then statement!)
 represents equivalence (sometimes called
biconditional), such as P  Q and Q  P.
 represents negation, such as  P. Negation is the
only unary connective (i.e., operates on a single
proposition).
Syntax Rules for Propositional
Logic
• The constants true and false are propositions by
themselves.
• A proposition symbol such as P or Q is a proposition
by itself.
• Wrapping parentheses around a proposition
produces a proposition.
• A proposition can be formed by using a logical
connective to combine two propositions.
Constants or proposition symbols by themselves make atomic
propositions.
Propositions containing a connective are called complex
propositions.
A Grammar for Propositional
Logic
• Sentence AtomicSentence 
ComplexSentence
• AtomicSentence  true  false  P  Q  R 
...
• Connective      
• ComplexSentence  (Sentence)
• ComplexSentence  Sentence Connective Sentence
• ComplexSentence  Sentence
Ambiguity
• The grammar can be ambiguous, for
example: P  Q  R.
• It is best to use parentheses to eliminate
ambiguity.
• When ambiguity is present, we resolve it with
operator precedence:
(highest)      (lowest)
• For example: P  Q  R  S
is equivalent to: (( P)  (Q  R))  S
Validity and Satisfiability
• Logical inference (or deduction) is the process that determines
the relationship between propositions.
• A proposition is valid if it must be true. That is, if it is true under
all possible interpretations of all possible worlds (a tautology).
Example: (Elvis is alive) or (Elvis is not alive)
• A proposition is satisfiable if it can be true. That is, if there is an
interpretation in some world for which it is true.
Example: Elvis is alive.
• A proposition is unsatisfiable if it cannot be true. That is, if there
is no interpretation in any world for which it is true. Unsatisfiable
propositions are called selfcontradictory.
Example: (Elvis is alive) and (Elvis is dead).
Formal Inference
• Although the computer does not know the
meaning of propositions, it can deduce facts
that must be true from its knowledge base.
• The power of formal inference is twofold:
1. The KB can be extremely large and propositions can be
arbitrarily complex.
2. The computer only reports valid conclusions, so whatever
propositions are returned must be true.
Other informal representation languages can be
used to capture probability and uncertainty.
Semantics of Propositional
Logic
• A proposition symbol can meaning anything
at all. The computer has no understanding of
its meaning.
• The semantics of propositional logic specifies
the meaning of the logical connectives and
how they combine propositions.
• A truth table can be used to specify the
semantics of the logical connectives.
Truth table for logical
connectives
Inference Rules
Rules of inference can be used to deduce validity without building a
truth table. Some simple inference rules:
AndElimination: From a conjunction you can infer any of the
conjuncts.
P1 P2  P3  P i
AndIntroduction: From a list of propositions you can infer their
conjunction.
P1, P2, P3  P1  P2  P3
OrIntroduction: From a proposition you can infer its disjunction
with anything else!
P1  P1  P2  P3
More Inference Rules
• DoubleNegation Elimination: From a doubly
negated proposition you can infer a positive
proposition.
 P  P.
• Unit Resolution: If one disjunct is false, then
you can infer that the other one is true.
(P  Q), ( Q)  P.
Even More Inference Rules
1. Modus Ponens:
If:
P  Q If raining, then soggy courts.
and
P It is raining.
Then:
Q Soggy courts.
2. Modus Tollens:
If:
P  Q If raining, then soggy courts.
and
 Q No soggy courts.
Then:
 P It is not raining.
Resolution Inference Rule
One of the most important inference rules is
resolution.
The intuition is that Q cannot be both true and
false, so one of the other disjuncts must be
true.
(P  Q), ( Q  R)  (P  R)
Using inference rules
• “On winter days in Chicago, it is either bitterly
cold or dark and damp outside. Today is a
winter day in Chicago and it is not terribly
cold outside.”
Formalizing a situation
“On winter days in Chicago, it is either bitterly
cold or dark and damp outside. Today is a
winter day in Chicago and it is not terribly
cold outside.”
• Winter = “It is a winter day in Chicago”
• Cold = “It is bitterly cold outside”
• Dark = “It is dark outside”
• Damp = “It is damp outside”
(=> Winter (or Cold
(and Dark Damp)))
(and Winter (not Cold))
Using the Inference Rules
1. (=> Winter (or Cold
(and Dark Damp))) Given
2.(and Winter (not Cold)) Given
3. Winter [AE 2]
4.(or Cold (and Dark Damp)) [MP 1,3]
5.(not Cold) [AE 2]
6.(and Dark Damp)[UR 4,5]
7. Dark [AE 6]
8. Damp [AE 6]
Properties of inference rules
• They are sound if when the premises are
true, the consequence is true
• Many different sets of inference rules have
been created with the same expressive
power (i.e., complete)
• Sometimes restricted sets of inference rules
used for tractability
– Example: Horn clauses in Prolog
(=> (and A1 … An) C)
Problems with propositional
logic
• Hard to identify “individuals” E.g., Mary, 3
• Can’t directly talk about properties of
individuals or relations between individuals
e.g., tall(bill)
• Generalizations, patterns, regularities can’t
easibly be represented. E.g., all triangles
have 3 sides
• First-Order Logic (FOL or FOPC) is
expressive enough to concisely represent..
Summary
• Intelligent agents need knowledge about the world for
making good decisions
• The knowledge of an agent is stored in a knowledge
base in the form of sentences in a knowledge
representation language
• A knowledge-based agent needs a knowledge base
and an inference mechanism. It operates by storing
sentences in its knowledge base, inferring new
sentences with the inference mechanism, and using
them to deduce which actions to take.
• The interpretation of a sentence is the fact to which it
refers. If this fact is part of the actual word, then the
fact is true.
Summary cont.
•
•
•
•
The process of deriving new sentences from old ones is called inference.
– Sound inference processes derives true conclusions give true premises.
– Complete inference processes derive all true conclusions from a set of
premises.
A valid sentence is true in all worlds under all interpretations.
If an implication sentence can be shown to be valid, then – known its premise –
its consequent can be derived.
Propositional logic commits only to the existence of fact that may or may not be
the case in the world being represented.
– It has a simple syntax and a simple semantic. It suffices to illustrate the
process of inference
– Propositional logic quickly becomes impractical, even for small worlds.