Docstoc

knowldge

Document Sample
knowldge Powered By Docstoc
					Artificial Intelligence


    Knowledge Representation Problem
    Knowledge Representation
   In symbolic functionalism we represent intelligence via
    manipulation of our beliefs about the surrounding world
    and knowledge we know.
   Therefore we have to address two fundamental issues
      how to represent knowledge
      how to implement the process of reasoning
   State space is a space of possible courses of inference
    when combining
      actual beliefs about current world
      general knowledge
      rules of inference
Knowledge bases




   Knowledge base = set of sentences in a
    formal language
    What is Knowledge?
 data – primitive verifiable facts, of any representation. Data
   reflects current world,often voluminous frequently changing.

 information – interpreted data
 knowledge – relation among sets of data (information), that
   is very often used for further information deduction.
   Knowledge is (unlike data) general. Knowledge contain
   information about behavior of abstract models of the world.
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
Knowledge Representation Schemas

  Logic based representation – first order
   predicate logic, Prolog
  Procedural representation – rules, production
   system
  Network representation – semantic networks,
   conceptual graphs
  Structural representation – scripts, frames,
   objects
    Natural Language
   English appears to be expressive
   But natural language is a medium of communication,
    not a knowledge representation
       Much of the information and logic conveyed by language is
        dependent on context
       Information exchange is not well defined
       Not compositional (combining sentences may mean
        something different)
       It is ambiguous
     Conceptual Graphs
   each concept has got its type and an instance
    general concept – a concept with a wildcard instance
                 dog:*X      colour    brown


    specific concept – a concept with a concrete instance

                dog:Emma     colour    brown
                                                        animal
   there exsists a hierarchy of types subtype:
   concept w is specialisation of concept v if   dog            cat

    type(v)>type(w) or instance(w)::type(v)
Types of Knowledge
   Objects
       both physical & concepts
   Events
       usually involve time
       maybe cause & effect relationships
   Performance
       how to do things
   META Knowledge
       knowledge about how to use knowledge
Stages of Knowledge Use
   Acquisition
     structure of facts
     integration of old & new knowledge

   Retrieval (recall)
     roles of linking and chunking
     means of improving recall efficiency
    Mathematical Logic
 Propositional Logic –
     syntactical primitives: , , , , symbols, true, false
     rule of inference: de morgan rule, modus ponens, …
     semantic interpretation
rains  blows-wind  sun-will-shine
 First Order Predicate Logic –
     enriched by variables, predicates, functions
     quantifiers , 
friends(father(david),father(andrew))
 Y friends(Y, petr)
 X likes(X,ice_cream)
 X  Y  Z parent(X,Y)  parent(X,Z) 
   siblings(Y,Z)
Propositional logic
   Propositional logic is the simplest logic
   The proposition symbols P1, P2 etc are sentences
      If S is a sentence, S is a sentence (negation)
      If S1 and S2 are sentences, S1  S2 is a sentence
       (conjunction)
      If S1 and S2 are sentences, S1  S2 is a sentence
       (disjunction)
      If S1 and S2 are sentences, S1  S2 is a sentence
       (implication)
      If S1 and S2 are sentences, S1  S2 is a sentence
       (biconditional)
Truth tables for connectives
Logical equivalence
   Two sentences are logically equivalent} iff true in same
    models: α ≡ ß iff α╞ β and β╞ α


    First-order logic
 Whereas propositional logic assumes the world
  contains facts,
 first-order logic (like natural language) assumes
  the world contains
 Objects: people, houses, numbers, colors,
  baseball games, wars, …
 Relations: red, round, prime, brother of, bigger
  than, part of, comes between, …
 Functions: father of, best friend, one more than,
 plus, …
Syntax of FOL: Basic elements
 Constants     KingJohn, 2, NUS,...
 Predicates    Brother, >,...
 Functions     Sqrt, LeftLegOf,...
 Variables     x, y, a, b,...
 Connectives   , , , , 
 Equality      =
 Quantifiers   , 
Universal quantification
 <variables> <sentence>
 Everyone at NUS is smart:
x At(x,NUS)  Smart(x)
x P is true in a model m iff P is true with x being each
  possible object in the model

   Roughly speaking, equivalent to the conjunction of
    instantiations of P
                 At(KingJohn,NUS)  Smart(KingJohn)
                 At(Richard,NUS)  Smart(Richard)
                 At(NUS,NUS)  Smart(NUS)
           ...
Existential quantification
   <variables> <sentence>
   Someone at NUS is smart:
   x At(x,NUS)  Smart(x)$
   x P is true in a model m iff P is true with x being some
    possible object in the model
   Roughly speaking, equivalent to the disjunction of
    instantiations of P
         At(KingJohn,NUS)  Smart(KingJohn)
     At(Richard,NUS)  Smart(Richard)
     At(NUS,NUS)  Smart(NUS)
     ...
Properties of quantifiers
   x y is the same as y x

   x y is the same as y x

   x y is not the same as y x
   x y Loves(x,y)
        “There is a person who loves everyone in the world”
        y x Loves(x,y)
        “Everyone in the world is loved by at least one person”
     
   Quantifier duality: each can be expressed using the other
   x Likes(x,IceCream)x Likes(x,IceCream)
   x Likes(x,Broccoli)            x Likes(x,Broccoli)
Using FOL
   Brothers are siblings
    x,y Brother(x,y)  Sibling(x,y)
   One's mother is one's female parent
    m,c Mother(c) = m  (Female(m)  Parent(m,c))
   “Sibling” is symmetric
    x,y Sibling(x,y)  Sibling(y,x)
   A first cousin is a child of a parent’s sibling
    x,y FirstCousin(x,y)   p,ps Parent(p,x) 
    Sibling(ps,p)  Parent(ps,y)
Generalized Modus Ponens
Example knowledge base
   The law says that it is a crime for an
    American to sell weapons to hostile
    nations. The country Nono, an enemy of
    America, has some missiles, and all of its
    missiles were sold to it by Colonel West,
    who is American.

   Prove that Col. West is a criminal
Example knowledge base
... it is a crime for an American to sell weapons to hostile nations:
    American(x)  Weapon(y)  Sells(x,y,z)  Hostile(z)  Criminal(x)
Nono … has some missiles, i.e., x Owns(Nono,x)  Missile(x):
   Owns(Nono,M1) and Missile(M1)
… all of its missiles were sold to it by Colonel West
    Missile(x)  Owns(Nono,x)  Sells(West,x,Nono)
Missiles are weapons:
   Missile(x)  Weapon(x)
An enemy of America counts as "hostile“:
    Enemy(x,America)  Hostile(x)
West, who is American …
   American(West)
The country Nono, an enemy of America …
   Enemy(Nono,America)
Resolution proof: definite clauses




                      
    Consider L be the first-order language with the following primitives:
S(X,L) -- Person X speaks language L.
C(X,Y) -- Persons X and Y can communicate.
I(W,X,Y) -- Person W can serve as an interpreter between persons X and Y.
J, P,E, F --- Constants: Joe, Pierre, English, and French respectively.
     a) Express the following statements in L:
 i. Joe speaks English.                            ii Pierre speaks French.
 iii. If X and Y both speak L, then X and Y can communicate.
 iv. If W can communicate both with X and with Y, then W can serve as
     an interpreter between X and Y.
 v. For any two languages L and M, there is someone who speaks both L
     and M.
 vi. There is someone who can interpret between Joe and Pierre.
 Show how (vi) can be proven from (i)---(v) using backward-
     chaining resolution.
Reasoning
   Retrospective Reasoning
       Why/how explanations are limited in their
        power because only focus on local reasoning
   Counterfactual Reasoning
       “why not” capabilities
   Hypothetical Reasoning
       “what if” capabilities
         Rule Based Reasoning
   The advantages of rule-based approach:
       The ability to use
       Good performance
       Good explanation
   The disadvantage are
       Cannot handle missing information
       Knowledge tends to be very task dependent
Rule-Based Systems
 Also known as “production systems” or
  “expert systems”
 Rule-based systems are one of the most
  successful AI paradigms
 Used for synthesis (construction) type
  systems
 Also used for analysis (diagnostic or
  classification) type systems
             Other Reasoning
   There exist some other approaches as:
       Case-Based Reasoning
       Model-Based Reasoning
       Hybrid Reasoning
         Rule-based + case-based
         Rule-based + model-based

         Model-based + case-based
Forward Chaining
   Remember this from propositional logic?
       Start with atomic sentences in KB
       Apply Modus Ponens
         add new sentences to KB
         discontinue when no new sentences

       Hopefully find the sentence you are looking
        for in the generated sentences
Forward chaining
   Idea: fire any rule whose premises are satisfied in the KB,
       add its conclusion to the KB, until query is found
Forward chaining example
Forward chaining example
Forward chaining example
Forward chaining example
Forward chaining example
Forward chaining example
Forward chaining example
Forward chaining example
Backward chaining example
Backward chaining example
Backward chaining example
Backward chaining example
Backward chaining example
Backward chaining example
Backward chaining example
Backward chaining example
Backward chaining example
Backward chaining example
Reduction to propositional inference
Suppose the KB contains just the following:

      x King(x)  Greedy(x)  Evil(x)
      King(John)
      Greedy(John)
      Brother(Richard,John)

Instantiating the universal sentence in all possible ways, we have:

      King(John)  Greedy(John)  Evil(John)
      King(Richard)  Greedy(Richard)  Evil(Richard)
      King(John)
      Greedy(John)
      Brother(Richard,John)

    The new KB is propositionalized: proposition symbols are

                   King(John), Greedy(John), Evil(John), King(Richard), etc.
Example proof: Did Curiosity kill the cat?
    Jack owns a dog. Every dog owner is an animal lover. No
     animal lover kills an animal. Either Jack or Curiosity killed the
     cat, who is named Tuna. Did Curiosity kill the cat?
    The axioms can be represented as follows:
    A. (x) Dog(x) ^ Owns(Jack,x)
    B. (x) ((y) Dog(y) ^ Owns(x, y)) => AnimalLover(x)
    C. (x) AnimalLover(x) => (y) Animal(y) => ~Kills(x,y)
    D. Kills(Jack,Tuna)  Kills(Curiosity,Tuna)
    E. Cat(Tuna)
    F. (x) Cat(x) => Animal(x)
     Example: Did Curiosity kill the
     cat?
1.   Dog(spike)
2.   Owns(Jack,spike)
3.   ~Dog(y) v ~Owns(x, y) v AnimalLover(x)
4.   ~AnimalLover(x1) v ~Animal(y1) v ~Kills(x1,y1)
5.   Kills(Jack,Tuna) v Kills(Curiosity,Tuna)
6.   Cat(Tuna)
7.   ~Cat(x2) v Animal(x2)
Example: Did Curiosity kill the cat?
 1.    Dog(spike)
 2.    Owns(Jack,spike)
 3.    ~Dog(y) v ~Owns(x, y) v AnimalLover(x)
 4.    ~AnimalLover(x1) v ~Animal(y1) v ~Kills(x1,y1)
 5.    Kills(Jack,Tuna) v Kills(Curiosity,Tuna)
 6.    Cat(Tuna)
 7.    ~Cat(x2) v Animal(x2)
 8.    ~Kills(Curiosity,Tuna) negated goal
 9.    Kills(Jack,Tuna) 5,8
 10.   ~AnimalLover(Jack) V ~Animal(Tuna) 9,4 x1/Jack,y1/Tuna
 11.   ~Dog(y) v ~Owns(Jack,y) V ~Animal(Tuna) 10,3 x/Jack
 12.   ~Owns(Jack,spike) v ~Animal(Tuna) 11,1
 13.   ~Animal(Tuna)         12,2
 14.   ~Cat(Tuna)           13,7 x2/Tuna
 15.   False                14,6
               Expert System
   Uses domain specific knowledge to provide
    expert quality performance in a problem
    domain

   It is practical program that use heuristic
    strategies developed by humans to solve
    specific class of problems
    Expert System Functionality
   replace human expert decision making when not
    available
   assist human expert when integrating various decisions
   provides an ES user with
      an appropriate hypothesis
      methodology for knowledge storage and reuse
   border field to Knowledge Based Systems, Knowledge
    Management
   knowledge intensive × connectionist
   expert system – software systems simulating expert-like
    decision making while keeping knowledge separate from the
    reasoning mechanism
                     Expert System

        User Interface
                             Knowledge editor

       Question&Answer
User                                            General Knowledge
                             Inference Engine
       Natural Language                         Case-specific data


       Graphical interface    Explanation
Generic System Components
   Global Database
       content of working memory (WM)
   Production Rules
       knowledge-base for the system
   Inference Engine
       rule interpreter and control subsystem
    Rule-Based System
   knowledge in the form of if condition then effect
    (production) rules
   reasoning algorithm:
               (i) FR  detect(WM)
               (ii) R  select(FR)
               (iii)WM  apply R
               (iv) goto (i)
   conflicts in FR:
     first, last recently used, minimal WM change, priorities
   incomplete WM – querying ES (art of logical and sensible
    querying)
   examples – CLIPS (OPS/5), Prolog
             Inference Engine
   It applies the knowledge to the solution of
    actual problem

   It is an interpreter for the knowledge base

   It performs the recognize-act control cycle
Weaknesses of Expert Systems
   Require a lot of detailed knowledge
   Restrict knowledge domain
   Not all domain knowledge fits rule format
   Expert consensus must exist
   Knowledge acquisition is time consuming
   Truth maintenance is hard to maintain
   Forgetting bad facts is hard
    Expert Systems in Practice
   MYCIN
      example of medical expert system
      old well known reference
      great use of Stanford Certainty Algebra
      problems with legal liability and knowledge acquisition
   Prospector
      geological system
      knowledge encoded in semantic networks
      Bayesian model of uncertainty handling
      saved much money
Expert Systems in Practice
   XCON/R1
      classical rule-based system
      configuration DEC computer systems
      commercial application, well used, followed by XSEL,
        XSITE
      failed operating after 1700 rules in the knowledge base
   FelExpert
      rule-based, baysian model,
      taxonomised, used in a number of applications
   ICON
      configuration expert system
      uses proof planning structure of methods
  Uncertainty
Let action At = leave for airport t minutes
    before flight
Will At get me there on time?
Problems:
partial observability (road state, other drivers' plans, etc.)
noisy sensors (traffic reports)
uncertainty in action outcomes (flat tire, etc.)

“A25 will get me there on time if there's no
   accident on the bridge and it doesn't rain
   and my tires remain intact etc etc.”
Making decisions under uncertainty
Suppose I believe the following:

     P(A25 gets me there on time | …)     = 0.04
     P(A90 gets me there on time | …)     = 0.70
     P(A120 gets me there on time | …)    = 0.95
     P(A1440 gets me there on time | …)   = 0.9999


   Which action to choose?

    Depends on my preferences for missing flight vs. time spent
    waiting, etc.

        Utility theory is used to represent and infer preferences
     
    Uncertainty in Expert Systems
from correct premises and correct sound rules  correct conclusions
 but sometimes we have to manage uncertain
   information, encode uncertain pieces of knowledge, model

   parallel firing of inference rules, tackle ambiguity

 There is a number of various models of
   uncertain reasoning:
       Bayesian Reasoning  – classical statistical approach
       Dempster-Shafer Theory of Evidence

       Stanford Certainty Algebra – MYCIN
 Bayesian Reasoning
P(a  b)  P(a)  P(b) ……. given that a and b are independent
P(a  b)  P(a | b)  P(b) ……. given that a depends on b

-     prior probability (unconditional) … p(hypothesis)
-     posterior probability (conditional)… p(hypothesis|evidence)



                      P(e|h)                          P(h  e) P(h)  P(e | h)
 P(e)                           P(h)     P(h | e)            
                  P(e | h)                              P(e)        P(e)


                  P(h)  P(e | h)
    P(h | e) 
                  P(hj )  P(e | hj )
                  j
                                                        prospector, dice examples
What is Fuzzy logic

   Fuzzy logic is a superset of conventional
    logic (Boolean)

   It was created by Dr. Lotfi Zadeh in 1960s
    for the purpose of modeling the inherent
    in natural language

   In fuzzy logic, it is possible to have partial
    truth values
• Fuzzy logic driven picture generator
• Massive Engine
• Battle scenes from Lord of the Rings
Reasoning With Uncertainty




Term                         Certainty Factor
Definitely not                   -1.0
Almost certainly not             -0.8
Probably not                     -0.6
Maybe not                        -0.4
Unknown                          -0.2 to +0.2
Maybe                            +0.4
Probably                         +0.6
Almost certainly                 +0.8
Definitely                       +1.0
 Fuzzy Sets
 categorization      of elements xi into a set S
    described through a membership function
      (s) : x  [0,1]
        associates each element xi with a degree of
         membership in S:
         0 means no, 1 means full membership
        values in between indicate how strongly an element
         is affiliated with the set
          Reasoning With Uncertainty




       Conventional set theory
                             38.7°C
38°C
           40.1°C        41.4°C
                                          Fuzzy set theory
              42°C
 39.3°C
            “Strong Fever”                                            38.7°C
37.2°C                                 38°C
                                                 40.1°C           41.4°C

                                                     42°C
                                        39.3°C
                                                 “Strong Fever”

                                       37.2°C
    Degree’s of truth
    The word “fuzzy” can be defined as “imprecisely defined, confused,
     vague”
    Humans represent and manage natural language terms (data) which are
     vague. Almost all answers to questions raised in everyday life are within
     some proximity of the absolute truth
           Sets
  Fuzzyfuzzy
Sets with
boundaries
                  A = Set of tall people

      Crisp set A                   Fuzzy set A
1.0                           1.0
                               .9
                               .5                    Membership
                                                       function


         5’10’’     Heights           5’10’’ 6’2’’     Heights
 Possibility vs.. Probability
 possibility refers to allowed values
 probability expresses expected occurrences of events
 Example: rolling dice
  X is an integer in U = {2,3,4,5,6,7,8,9,19,11,12}
  probabilities
      p(X = 7) = 2*3/36 = 1/6          7 = 1+6 = 2+5 = 3+4
  possibilities
      Poss{X = 7} = 1           the same for all numbers in
     U
  Fuzzy Sets
Formal definition:
  A fuzzy set A in X is expressed as a set of ordered
   pairs:
               A  {( x,  A ( x ))| x  X }

                        Membership              Universe or
   Fuzzy set
                         function          universe of discourse
                           (MF)


           A fuzzy set is totally characterized by a
                 membership function (MF).
Set-Theoretic Operations
     A  B  A  B
Subset:

      A  X  A  A ( x )  1  A ( x )
Complement:
 C  A  B  c ( x )  max( A ( x ), B ( x ))  A ( x ) B ( x )

 Union:
C  A  B  c ( x )  min( A ( x ), B ( x ))  A ( x ) B ( x )


Intersection:
    Rough Sets
   Rough set theory was developed by Zdzislaw Pawlak
    in the early 1980’s.
   The main goal of the rough set analysis is induction of
    approximations of concepts.
   It can be used for feature selection, feature extraction,
    data reduction, decision rule generation, and pattern
    extraction (templates, association rules) etc.
   identifies partial or total dependencies in data,
    eliminates redundant data, gives approach to null
    values, missing data, dynamic data and others.
   Logics in general
     Language             Ontological         Epistemological
                          Commitment           Commitment
Propositional logic   facts                true/false/unknown

First-order logic     facts, objects,      true/false/unknown
                      relations
Temporal logic        facts, objects,      true/false/unknown
                      relations, times
Probability theory    facts                degree of belief

Fuzzy logic           facts+degree of truth known interval value
      facts+degree of truth known interval value

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:7
posted:3/11/2012
language:
pages:82
Description: Artificial intelligence Academic lecture