Chp02 KR Complete

download Chp02 KR Complete

of 62

Transcript of Chp02 KR Complete

  • 8/7/2019 Chp02 KR Complete

    1/62

    KNOWLEDGE

    REPRESENTATION

    1

  • 8/7/2019 Chp02 KR Complete

    2/62

    Knowledge,

    like love,is one of those words that

    everyone knows the meaning

    of, yet finds hard to define.

    Like love, knowledge has

    many meanings.

    Giarratano and Riley (1998)

  • 8/7/2019 Chp02 KR Complete

    3/62

    Intelligence requires knowledgeIntelligence refers to the capacity to

    acquire and apply knowledge.

  • 8/7/2019 Chp02 KR Complete

    4/62

    Knowledge is an understanding which is gained

    through

    experience; familiarity with the way to do something to

    perform a task;

    an accumulation of facts, procedural rules or

    heuristics.

  • 8/7/2019 Chp02 KR Complete

    5/62

    Knowledge can have many meanings. It is not justthe body of facts and principles accumulated by

    human-kind or the act, or state of knowing, but alsothe familiarity with languages, concepts,procedures, rules, ideas, abstractions, places,customs, facts and associations as well as

    information(Patterson, 1990)

  • 8/7/2019 Chp02 KR Complete

    6/62

    Facts

    Procedural

    Rules

    HeuristicKNOWLEDGE

  • 8/7/2019 Chp02 KR Complete

    7/62

    Facts

    A statement that relates a certain element of

    truth about a subject matter or a domain Example:

    milk is white

    the sun rises in the East

    and sets in the West

  • 8/7/2019 Chp02 KR Complete

    8/62

    Procedural rules

    A rule that describes a sequence of relations

    relative to the domain Example:

    If the gas gauge shows

    quarter-full or less,

    then look for a gasoline

    station

  • 8/7/2019 Chp02 KR Complete

    9/62

    Heuristic

    Is a rule of thumb based on years of experience.

    Example: If a person drives no more

    than 5 miles above the

    speed limit, then that

    person is not likely to be

    stopped for speeding.

  • 8/7/2019 Chp02 KR Complete

    10/62

    Priori

    Knowledge which cannot be denied

    Considered to be universally true

    Logic statements, mathematical laws

    e.g. everybody will die, ice is cold

    Posteriori

    Knowledge derived from the senses, which can be true or false.

    The truth can be denied by sensory experience or on the basis of newknowledge

  • 8/7/2019 Chp02 KR Complete

    11/62

    Tacit

    Unconscious knowledge that cannot be expressed by language spontaneous actions without any significant amount of effort

    Eyes blinking, breathing

    Explicit

    Documented knowledge

  • 8/7/2019 Chp02 KR Complete

    12/62

    Basic Types of

    Knowledge

    Procedural(how to do)

    Structural

    (mental model)

    Meta

    Knowledge(about other)

    Heuristic

    (shortcut)

    Declarative

    (what it is)

  • 8/7/2019 Chp02 KR Complete

    13/62

    Procedural

    Knowledge on the process of doing something

    It provides direction on how to do something via rules, strategies,

    agendas as well as procedures

    Declarative

    A passive knowledge expressed as statements of facts about theworld

  • 8/7/2019 Chp02 KR Complete

    14/62

    Meta-knowledge

    Knowledge about knowledge

    Knowledge on knowing which knowledge to use to solve a problem Always used by experts to enhance the efficiency of problem solving

    Heuristic

    Knowledge which is gained through experience and translated into

    instinct or intuition

    Often displayed individual expertise

  • 8/7/2019 Chp02 KR Complete

    15/62

    Procedural knowledge to boil an egg we must do then

    Declarative knowledge

    my room no. is 2103

    Meta-knowledge if you want to know about heart attack, please read this book

    Heuristic knowledge the clouds looks dark and heavy, heavy rain might fall

    Structural Knowledge a cat has four legs

  • 8/7/2019 Chp02 KR Complete

    16/62

    Data

    Information

    + CT

    Knowledge

    This is

    CTsphone

    no.!

  • 8/7/2019 Chp02 KR Complete

    17/62

    Meta

    Knowledge

    Knowledge

    Information

    Data

    Noise

  • 8/7/2019 Chp02 KR Complete

    18/62

    DocumentedExp:printed &

    electronic media

    Not documented

    Exp: experience

  • 8/7/2019 Chp02 KR Complete

    19/62

    Knowledge representation is

    a science of translating

    actual knowledge intoa format that can be

    used by the computer.

  • 8/7/2019 Chp02 KR Complete

    20/62

    Knowledge Source

    Knowledge

    Representation

    Knowledge Usage

  • 8/7/2019 Chp02 KR Complete

    21/62

    Why needs to represent knowledge?...

    You are given a projectto develop a systemthat can diagnoseheart attack?

    How can you get information about heart attack?

    How do you understand the knowledge?

    Which knowledge to get into computer?

  • 8/7/2019 Chp02 KR Complete

    22/62

    KnowledgeRepresentation

    Methods Logic

    ject

    Rule

  • 8/7/2019 Chp02 KR Complete

    23/62

    OAV ObjectAttributeValue

    Color Gold

    Object Attribute Value

  • 8/7/2019 Chp02 KR Complete

    24/62

    Using fact : form of declarative knowledge

  • 8/7/2019 Chp02 KR Complete

    25/62

    Refer to particular properties value of object Eg: The balls color is red (assign red to the balls

    color) The object can be physical (eg: car, books) or

    abstract (eg: love, hobby).

    The value can be numerical, string or Boolean!.

    It could be either single or multi valued fromdifferent attributes and objects.

  • 8/7/2019 Chp02 KR Complete

    26/62

    Colour Gold

    Object Attribute Value

    Car Colour

    Gol

    d

  • 8/7/2019 Chp02 KR Complete

    27/62

    Fact :=: The chairs color is red and priced at RM35.00

    CHAIR

    RED

    RM 35.00

    Color

    Price

    Object Attribute Value

  • 8/7/2019 Chp02 KR Complete

    28/62

    Fact :=: I have a brother named Johnny. The 8years-old brother likes to play tennis and football.

    johnny

    male

    8 years old

    gender

    age

    tennis

    hobby

    football

  • 8/7/2019 Chp02 KR Complete

    29/62

    Discussion Describe aboutDoraemon

  • 8/7/2019 Chp02 KR Complete

    30/62

    Semantic Network

    Animals

  • 8/7/2019 Chp02 KR Complete

    31/62

    Definition method of knowledge representation using a graph made up

    of nodes and arcs

    Graphical view of problems important objects,properties and relationships.

    Nodes represent objects & arcs represent therelationship.

    Arcs are commonly labeled with terms IS-A orHAS

  • 8/7/2019 Chp02 KR Complete

    32/62

    FACT : Parrot is a bird. Typically bird has wings and travel by

    flying. Bird category falls under animal kingdom. All animalrequires air to breathe. Ostrich is a bird but travels by walking.

    AirAnimalBird

    Wings

    Parrot

    Ostrich

    Walk

    Fly

    is-a

    trave

    l

    trave

    l

    has

    is-a

    breathe

  • 8/7/2019 Chp02 KR Complete

    33/62

    Mammals

    Human

    Female

    Male

    Two legs

    Mariam

    AhmadSystem

    Analyst

    Wheel

    chair

    Degree

    BIT(Hons)

    Walkis-a

    has

    mother-of

    has

    is-a

    is-ais-a

    is-a

    travel-by

    travel-by

  • 8/7/2019 Chp02 KR Complete

    34/62

    Frame

    Definition :: a datastructure for representingstereotypical knowledge ofsome concept or object

  • 8/7/2019 Chp02 KR Complete

    35/62

    An extension version of semantic network calledschema (proposed by Barlett, 1932).

    Basic concept of object oriented programming

    (proposed byMinsky, 1975). Class frame general characteristics of some

    common objects (Eg: class frame bird refer tocommon properties of bird).

    Instance frame to describe unique characteristicfrom class frame (Eg: class ostrich from classframe bird)

  • 8/7/2019 Chp02 KR Complete

    36/62

    Example

    Frame Name:

    B

    IRDProperties:

    Color =

    Wings = 2

    Flies = True

    Frame Name: OSTRICH

    Properties:

    Color =

    brown/dark

    Wings = 2

    Flies = False

    Class Name: BIRD

  • 8/7/2019 Chp02 KR Complete

    37/62

    Two l t

    of fr

    Slot

    Is the characteristic

    that describe an

    object

    Exp: color, food, no.of wings,

    Facet

    Value for slot

    Exp: yellow, 1,

    worm,

  • 8/7/2019 Chp02 KR Complete

    38/62

    Example

    Frame Name:

    BIRDProperties:

    Color =

    Wings = 2

    Flies = True

    Slot Facet

  • 8/7/2019 Chp02 KR Complete

    39/62

    Rule

    Definition :: Rules a knowledge structure thatrelates some known information to other

    information and that can be concluded or inferredto be known

  • 8/7/2019 Chp02 KR Complete

    40/62

    Is a form of procedural knowledge associates given information to some action.

    Structure connects antecedents (premises)and consequents (conclusions).

  • 8/7/2019 Chp02 KR Complete

    41/62

    Statement IF antecedent and THEN consequent

    IF THEN

    IFthirsty THEN drink_a_water

  • 8/7/2019 Chp02 KR Complete

    42/62

    Example: Diagnosing strep throat (knowledge base)

    Rule 1:

    IF x has a sore throatAND suspect bacterial infectionTHEN patient has strep throat

    Rule 2:IF x temperature is > 37 cTHEN x has a fever

    Rule 3:IF x has been sick > a monthAND x has a feverTHEN suspect bacterial infection

  • 8/7/2019 Chp02 KR Complete

    43/62

    Logic

  • 8/7/2019 Chp02 KR Complete

    44/62

    Oldest form of KR in computer Concerned with the truthfulness of a chain of

    statements 2 kinds of logic:

    Propositional Logic

    Predicate Calculus

    Implemented in PR

    OLOG

    (Programming inLogic) language

  • 8/7/2019 Chp02 KR Complete

    45/62

    E.g.it_is_raining

    kitty_is_outside

    kitty_gets_wet

    Elementary propositions or atomic sentences cannot bebroken down into smaller meaningful units.

    Often represented using symbols, e.g. P, Q,A etc.

  • 8/7/2019 Chp02 KR Complete

    46/62

    Manipulate basic Boolean logic operations (AND,OR, NOT, IMPLIES, EQUIVALENCE.)

    E.g.:

    Normal :Today is raining, therefore I will miss theclass

    Logic : today_raining i_will_miss_class

    Combining two or more PL forms compound propositions(CP) or formulae.

    CP consists of propositions and logical operators.

  • 8/7/2019 Chp02 KR Complete

    47/62

    Logical operators:

    General Name Formal Name Symbols

    Not Negation

    And Conjunction

    Or DisjunctionIf Then/Implies Conditional

    If and only if Biconditional

    m

    p

  • 8/7/2019 Chp02 KR Complete

    48/62

    Propositional Logic Example Example 1:

    Normal:The sky is blue and windy. It is really great for picnic

    Logic: sky_blue windy great_for_picnic

    Example 2: Normal: If the weather is cloudy, then it will be raining. If it is

    raining, people will stay at home.

    Logic: (weather_cloudy raining) (raining people_stay_home).

    Example 3: Normal: I will rather stay if and only if it is raining.

    Logic: i_will_staym raining

  • 8/7/2019 Chp02 KR Complete

    49/62

    Propositional Logic Discussion

    Question: Transform each of the following statements

    into propositional logic:

    a) Today is Tuesday and it is a very lovely day.

    b) It rained yesterday, therefore I've missed my lecture.

    c) All men are mortals.

    d) Sintok is a district within Kedah

  • 8/7/2019 Chp02 KR Complete

    50/62

    Nested formulae important to express the actual meaning

    of a wff. E.g:

    it_is_raining kitty_is_outsidepkitty_gets_wet

    (1) (it_is_raining kitty_is_outside) pkitty_gets_wet

    (2) it_is_raining (kitty_is_outsidepkitty_gets_wet)

  • 8/7/2019 Chp02 KR Complete

    51/62

    Order of precedence

    m

    p

    The above determines the principal operator to split aformulae into smaller units.

    Purpose: to indicate the actual meaning of a formulae. E.g.:

    P PpQpQ

    A BCm P QpR

  • 8/7/2019 Chp02 KR Complete

    52/62

    Truth table a common method to prove the

    truth value of any statement written in PL.

    P Q P PQ PQ PpQ PmQ

    T T F T T T T

    T F F F T F F

    F T T F T T F

    F F T F F T T

  • 8/7/2019 Chp02 KR Complete

    53/62

    Truth table determines the category of formula Tautology formula is always T regardless of the truth

    values of its propositions.

    E.g. (P(PpQ))pQ Contingent formula is sometimes T and sometimes F,

    depending on the truth values of its propositions E.g. (AB)pC

    Inconsistent formula is always F regardless of the truth

    values of its propositions E.g. P(P)

  • 8/7/2019 Chp02 KR Complete

    54/62

    Limitation Cannot express universality of objects

    E.g.

    all computers have processor; all birds fly.

    Cannot express existence / inexistence / partial

    quantity of objects E.g. there are some birds which cannot fly

    none of us is immortal

  • 8/7/2019 Chp02 KR Complete

    55/62

    Also known as First Order Predicate Logic (FOPL).

    This method overcomes the limitations of

    propositional logic through use of quantifiers andvariables.

    Main structure

    argument (i.e. variables and/or constants) islinked by operator (i.e. functor).

  • 8/7/2019 Chp02 KR Complete

    56/62

    A predicatefunctor(argument1, argument2)

    A predicate consists offunctor and zero or more arguments Functor (or predicate name) relates the arguments

    Argument can be variables or constant

    Variables

    A symbol in capital letter or a word begins with uppercase letter

    Represent general classes of objects or properties

  • 8/7/2019 Chp02 KR Complete

    57/62

    E.g.:

    teach(X,Y)

    X and Y can be substituted with any value/constantsuch as:

    dave and comp5346,

    resulting in:

    teach(dave,comp5346)

  • 8/7/2019 Chp02 KR Complete

    58/62

    Constant

    A symbol or string of letters begins with lower caseletter

    Represent specific classes of objects or properties

    E.g.:

    dave and comp5436 are constants

    dAVe and coMP5436 are also valid constants

    What about Dave and COMP5436? Are they thevalid constants? Why?

  • 8/7/2019 Chp02 KR Complete

    59/62

    Basic ideafunctor(variable_1, variable_2, .) E.g.

    she likes chocolatelikes(she, chocolate)

    tweety is a bird

    isa(tweety,bird) ORbird(tweety)

  • 8/7/2019 Chp02 KR Complete

    60/62

    Universal quantifier (X) means for all

    Indicates the expression is T (i.e. true) forALL values of

    designated variables E.g.:X likes(X,icecream)

    For all values ofX, the statement X likes ice cream is true

    E.g.: all birds fly is represented asX (bird(X) flies(X))

    This also means no birds do not fly, thus it can also berepresented asXflies(X).

  • 8/7/2019 Chp02 KR Complete

    61/62

    Existential quantifier (X) means there exist.

    Indicates the expression is T (i.e. true) forSOME values

    of designated variables (at least one value exists thatmakes the statement T)

    E.g.: some children like ice cream

    Is represented as:

    X likes(X,icecream) ORChildren likes(Children,icecream)

    Can also be represented asX likes(X,icecream) .As thestatement also means not all children like ice cream.

    E.g.: some birds do not fly is represented as X (bird(X) flies(X))

  • 8/7/2019 Chp02 KR Complete

    62/62

    E.g. 1: Normal: If it doesnt rain today,Ahmad will go to the beach

    FOPL: rain(today) go(Ahmad, beach)

    E.g. 2:

    Normal: All volleyball players are tall FOPL: X (volleyball_player (X) tall (X))

    E.g. 3: Normal:Some people like durian.

    FOPL: X (person(X) likes(X, durian))

    E.g. 4: Normal: Nobody likes war

    FOPL: X likes (X, war) OR X likes(X,war)