Escolar Documentos
Profissional Documentos
Cultura Documentos
10
Approaches to KR
2. Inheritable knowledge:
• Objects are organized into classes and classes are
organized in a generalization hierarchy.
• Inheritance is a powerful form of inference, but not
adequate.
• Ex. Property inheritance inference mechanism.
isa handed
Adult male Person Right
instance
3. Inferential knowledge:
• Facts represented in a logical form, which facilitates
reasoning.
• An inference engine is required.
4. Procedural knowledge:
• Representation of “how to make it” rather than “what
it is”.
• May have inferential efficiency, but no inferential
adequacy and acquisitional efficiency.
• Ex. Writing LISP programs
8
Logic
• Logic is an “algebra” for manipulating only two values:
true (T) and false (F)
• Nevertheless, logic can be quite challenging
his talk will cover:
– Propositional logic--the simplest kind
– Predicate logic (predicate calculus)--an extension of
propositional logic
– Resolution theory--a general way of doing proofs in predicate
logic
– Possibly: Conversion to clause form
– Possibly: Other logics (just to make you aware that they exist)
Propositional logic
Propositional logic consists of:
The logical values true and false (Tand F)
Propositions: “Sentences,” which
Are atomic (that is, they must be treated as indivisible units, with no
internal structure), and
Have a single logical value, either true or false
Operators, both unary and binary; when applied to logical
values, yield logical values
The usual operators are and, or, not, and implies
Truth tables
• Logic, like arithmetic, has operators, which apply to one, two,
or more values (operands)
• A truth table lists the results for each possible
arrangement of operands
• Order is important: x op y may or may not give the same
result as y op x
The rows in a truth table list all possible sequences of truth
values for n operands, and specify a result for each sequence
1
Propositional logic
• Statements used in mathematics.
• Proposition :is a declarative sentence whose value is
either true or false.
• We can easily represent real world facts as logical propositions
written as well-formed formulas (wff’s).
Examples:
• “The sky is blue.” [Atomic Proposition]
• “The sky is blue and the plants are green.”
[Molecular/Complex Proposition]
• “Today is a rainy day” [Atomic Proposition]
• “Today is Sunday” [Atomic Proposition]
• “ 2*2=4” [Atomic Proposition]
12
World
A world is a collection of prepositions and logical
expressions relating those prepositions
Example:
Propositions: JohnLovesMary, MaryIsFemale, MaryIsRich
Expressions:
MaryIsFemale MaryIsRich JohnLovesMary
A proposition “says something” about the world, but
since it is atomic (you can’t look inside it to see
component parts), propositions tend to be very
specialized and inflexible
13
Model
A model is an assignment of a truth value to each proposition, for
example:
JohnLovesMary: T, MaryIsFemale: T, MaryIsRich: F
An expression is satisfiable if there is a model for which the
expression is true
For example, the above model satisfies the expression
MaryIsFemale MaryIsRich JohnLovesMary
An expression is valid if it is satisfied by every model
This expression is not valid:
14
Terminologies in propositional algebra
• Statement: sentence that can be true/false.
• Properties:
Satisfiability: a sentence is satisfy able if there is an
interpretation for which it is true.
Eg.”we wear woolen cloths”
becomes:
MaryIsFemale
MaryIsRich
Inference by computer
To do inference (reasoning) by computer is basically a search
process, taking logical expressions and applying inference
rules to them
Which logical expressions to use?
Which inference rules to apply?
Usually you are trying to “prove” some particular statement
Example:
it_is_raining it_is_sunny
it_is_sunny I_stay_dry
it_is_rainy I_take_umbrella
I_take_umbrella I_stay_dry
To prove: I_stay_dry
Forward and backward
reasoning
Situation: You have a collection of logical expressions
(premises), and you are trying to prove some additional
logical expression (the conclusion)
You can:
Do forward reasoning: Start applying inference rules to the
logical expressions you have, and stop if one of your results is
the conclusion you want
Do backward reasoning: Start from the conclusion you want,
and try to choose inference rules that will get you back to the
logical expressions you have
With the tools we have discussed so far, neither is
feasible
Example
Given:
it_is_raining it_is_sunny
it_is_sunny I_stay_dry
it_is_raining I_take_umbrella
I_take_umbrella I_stay_dry
You can conclude:
it_is_sunny it_is_raining
I_take_umbrella it_is_sunny
I_take_umbrella I_stay_dry
Etc., etc. ... there are just too many things you can conclude!
BASICS for Predicate Logic
• Logical expressions are built out of components
– Objects (Constants)
– Variables
– Functions
• The above three are called Terms
– Predicates
– Connectives
– Quantifiers
Objects
• Symbols that denote specific things or
individuals
– JOHN
– MARY
– BASKETBALL
– TRIANGLE
Variables
• Unspecific references to objects: x, y, z
• Functions
– An argument to a function is either an object or a
variable
– Starting with a lowercase letter
– The value of a function is either an object or a variable
– exp(0) = 1
– next-day(THURSDAY) = FRIDAY
– brother(JOHN) = JIM
Predicates
(or functions returning True or False)
• Functions which denote attributes of objects
or relationships between individuals
• - Starting with a uppercase letter
– Loves(JOHN, MARY)
– Man(SOCRATES)
– Sunny(THURDAY)
Connectives
• Logical operators which computes truth values
• ^ AND
• OR
• ¬ NOT
• IMPLIES
• Quantifiers
– Logical operators which assert the scope of a
predicate
– For All (universal quantifier)
– There Exists (existential quantifier)
Examples for Conversionfrom Natural
Language Sentences to Predicate Logic
Distribute disjunctions
Formula Rewrites to
(P | Q) &
P | (Q & R)
(P | R)
(Q | P) &
(Q & R) | P
(R | P)
Example
Example
1st order formula
∀Y (∀X (taller(Y,X) | wise(X)) => wise(Y))
Simplify
∀Y (~∀X (taller(Y,X) | wise(X)) | wise(Y))
Move negations in
∀Y (∃X (~taller(Y,X) & ~wise(X)) | wise(Y))
Move quantifiers out
∀Y (∃X ((~taller(Y,X) & ~wise(X)) | wise(Y)))
Skolemize
∃X ((~taller(Y,X) & ~wise(X)) | wise(Y)) γ = {Y}
(~taller(Y,x(Y)) & ~wise(x(Y))) | wise(Y)
Distribute disjunctions
(~taller(Y,x(Y)) | wise(Y)) & (~wise(x(Y)) | wise(Y))
Convert to CNF
{ ~taller(Y,x(Y)) | wise(Y),
~wise(x(Y)) | wise(Y) }
Non-monotonic Reasoning
• In real world some problems are uncertain
and fuzzy.
• The different approaches to handle these are:
– Non-monotonical reasoning: In which the facts
and the rules of inference are extended to make it
possible to reason with incomplete information.
– Statistical Reasoning: In which the representation
is extended to allow some kind of numeric
measure of certainty to be associated with each
statement.
Key issues in non-monotonic reasoning
• How can the knowledge base be extended to
allow inferences to be made on the basis of lack
of knowledge as well as on the presence of it?
• How can the knowledge base be updated
properly when a new fact added to the system? –
To keep proofs called justification.
• How can knowledge be used to help resolve
conflicts when there are several inconsistent non-
monotonic inferences that can be drawn?
Default Reasoning (Non monotonic
reasoning)
• Draw conclusions based on what is most likely
to be true.
• Two common kinds of non-monotonic
reasoning:
– Abduction
– Inheritance
Abduction
Abduction is the qaulitative,everyday reasoning.
Deduction shows that something must be,
induction shows that something exists, and
abduction shows that something mabye.
Abduction is that starting point of all research.