lecture 6 knowledge representation (1)

Upload: suada-bow-weezy

Post on 04-Jun-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    1/28

    1

    Foundations ofKnowledge-based Systems

    Lecture 2

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    2/28

    2

    Outline

    Recap Knowledge Representation

    Propositional Logic

    Predicate Logic

    Validity and Soundness

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    3/28

    3

    Recap Definition of KBS A knowledge based system (KBS) is a software system

    capable of supporting the explicit representation ofknowledge in some specific competence domain and ofexploiting it through appropriate reasoning mechanismsin order to provide high-level problem-solvingperformance.

    KBS is a specific, dedicated, computer-based problem-solver, able to face complex problems, which, if solved byman, would require advanced reasoning capabilities, suchas deduction, abduction, hypothetical reasoning, model-

    based reasoning, analogical reasoning, learning, etc.

    Typical problems Diagnosis Scheduling Planning

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    4/28

    4

    Recap Components of a KBS

    Knowledge Base

    Problem

    Domain Knowledge

    Reasoning Mechanism

    Working Memory

    Solution Knowledge-Based

    System

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    5/28

    5

    Knowledge Classification Knowledge can be classified into

    Priori knowledge: Universally true and cannot bedenied without contradiction. Examples are mathematical laws, logical statements.

    Posteriori knowledge: Represents information that is

    verified using sensory experiences. This Knowledge can be denied based on new knowledge

    without the need for contradictions.

    Further classification includes Procedural knowledge: Knowing how to do something.

    Declarative knowledge: Knowing that something istrue or false.

    Tacit knowledge: Unconsciously knowing how to dosomething.

    Explicit knowledge:

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    6/28

    6

    Knowledge Representation

    This is the way that knowledge is stored in aprogram. This implies that

    There is a systematic way to store the information.

    The knowledge is coded into the program.

    Knowledge representation and reasoning - thestudy of formal ways of extracting informationfrom symbolically represented knowledge

    Existing computer languages can be used and the

    knowledge is stored in memory.

    The stored knowledge and facts can be used inreasoning.

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    7/28

    7

    Knowledge Representation

    Knowledge can be represented in a varietyof ways.

    The predominant knowledge

    representation schemes are Frames and production rules.

    Connections and weights.

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    8/28

    8

    Knowledge Representation Some desirable features of any knowledge

    representation scheme include: Completeness:Should support the acquisition of all

    aspects of the knowledge.

    Conciseness: Allow efficient acquisition so that

    knowledge is stored compactly and is easily retrieved. Computational efficiency:It should be possible to

    use the knowledge rapidly and without the need forexcessive computation.

    Transparency:Should be such that it is possible to

    understand its behaviour and how it arrives atconclusions.

    Explicity:The important things should be explicit butthe details suppressed but available in case it is

    required in future.

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    9/28

    9

    Why use special tools

    Traditional languages emphasize Efficiency

    Maintainability

    Portability

    Not representational power

    Traditional language control is

    Primitive

    Implicit in statement ordering

    Pretty much fixed at compile time Good for algorithmic work, but knowledge is

    implicit not explicit.

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    10/28

    10

    Why use special tools

    There is no single representation scheme that embodiesall the above characteristics.

    Each of the representation schemes is suitable for certaintypes of application domain.

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    11/28

    11

    Types of representation schemes

    Some popular representation schemes include

    Rule-based schemes:Information is stored asabstract rules that have general applicability.

    Learning is explicit.

    Instance based models:Do not operate on explicitrules. Exhibit rule-like behavior by being exposed to aseries of examples.

    Learning is implicit.

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    12/28

    12

    Logic and other schemes

    Logic:Extensively used in Al programs.

    Main purpose of logic: The soundness or unsoundness ofarguments.

    Typically, an argument consists of statements calledpropositions, from which other statement(s) calledconclusion(s) are claimed to follow.

    This is the basis of propositional logic.

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    13/28

    13

    Propositional Logic

    Proposition:A sentence that is either true orfalse.

    Example: The following are propositions:

    Sam is a happy man" (1)

    "All cats are good pets" (2)

    Propositions, because each is either true or false.

    The following phrases are not propositions:

    "Amy's pet" (3)

    "Oh dear me!" (4)

    Statements in propositional logic are usuallyexpressed symbolically.

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    14/28

    14

    Propositional Logic

    Example:

    The following inference:

    "If Sam is a happy man then Sam is a teacher"

    Could be symbolically expressed as:

    A: Sam is a happy man B: Sam is a teacher

    This could be expressed in propositional logic as:

    if A then B

    Logic notation: A B (meaning proposition Aimplies proposition B).

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    15/28

    15

    Propositional Logic

    This is an example of a rule of inference called modus

    ponens.

    This says that if propositionAis true, and the rule ofinferenceA Bis true, then Bwill also be true.

    Propositions can be combined using logical connectivese.g. "If I listen to music and the room is warm then I fall asleep

    Rewriting this symbolically: PropositionA: I listen to music

    Proposition B: The room is warm

    Proposition C: I fall asleep

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    16/28

    16

    Propositional Logic

    Then this can be written in logic notation as:

    A B C

    Connective symbols

    The symbols shown in the table are used to denote someof the most common connectives used in propositionallogic.

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    17/28

    17

    Propositional Logic

    Symbol Meaning Interpretation-A

    A B

    A B

    A B

    Not A

    A and B

    A or B

    A implies B

    Negation. Negation of propositionAis true ifAis false and vice versaConjunction. Aand Bonly true ifA

    and Bare both true, otherwise falseDisjunction. Aor Bis true ifAistrue or Bis true.Implication. IfAis true andAimplies Bis true, then Bis true. IfA

    is false andAimplies Bis true thenanything goes. That is, Bcould betrue or false, since implication saysnothing about case whenAis false

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    18/28

    18

    Propositional Logic

    Truth table

    The meanings of the connectives and their results aresummarized in the table

    A B A A B A B A B1100

    1010

    0011

    1000

    1110

    1011

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    19/28

    19

    Predicate Logic

    Propositional logic is inadequate for solving some

    problems because a proposition has to be treated as asingle entity that is either true or false.

    Predicate logic overcomes this by allowing a proposition

    to be broken down into two components. Arguments

    Predicates.

    It allows the use of variables, in addition to supporting

    the rules of inference derived from propositional logic(i.e. modus ponens etc.).

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    20/28

    20

    Predicate Logic

    Example

    Consider the proposition:

    Kamau has brown hair.

    This could be written in predicate logic notation

    as: HAS (Kamau, short hair)

    In the example,

    Predicate: HAS Arguments: Kamau and brown hair.

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    21/28

    21

    Predicate Logic

    Quantifiers in predicate logic

    Predicate logic also allows for the use ofquantifiers.

    This means that the language can be extended to

    propositions that refer to a range of a variable. For example, consider the proposition:

    Every man loves a woman.

    This can be expressed in predicate logic using

    quantifiers as:

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    22/28

    22

    Predicate Logic

    x, Man(x) y, s.t. Woman(y) Loves(x, y)

    Which reads: For any object xin the world if xis a Man, then there exists an

    object y, such that yis a woman and xLoves y.

    Quantifiers

    : The universal quantifier since it refers to all objects inthe (male) population.

    : The existential quantifier since it refers to at least oneobject in the (female) population.

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    23/28

    23

    Predicate Logic

    Now consider the proposition: every Welshman is a Man.

    This would be expressed in formal logic as:

    x, Welshman(x) Man(x)

    Which reads: for any object x, if xis a Welshman, then xis a man.

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    24/28

    24

    Predicate Logic

    Then from the two facts it can be concluded, using the

    rules of inference, that the following fact must be true:

    x, Welshman(x) y, s.t. Woman(y) Loves(x, y)

    That is, every Welshman loves a woman.

    The example seems to lead to an obvious conclusion.However, for other examples such intuitive conclusions

    would be less obvious.

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    25/28

    25

    Logic: Validity and Soundness

    Consider the following deductive argument:

    If you are in Chiromo, then you are in Nairobi

    If you are in Nairobi, then you are in Kenya

    Therefore if you are in Chiromo you are in Kenya

    Both premises and conclusion happen to be true

    statements, But if you substitute Kampalafor Nairobi theargument will have false premises.

    Therefore, there are arguments that intuitively seem tobe valid in the sense that the conclusions somehow

    follow from the premises, but which still have somethingmissing.

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    26/28

    26

    Logic: Validity and Soundness

    Validity:

    A deductive argument (or argument form) is valid ifand only if it is impossible for its conclusion to be falsewhen its premises are true.

    Soundness:

    A deductive argument is sound if it is valid and hastrue premises.

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    27/28

    27

    Advantages of formal logic

    There is a set of rules called rules of inferenceby which

    facts that are known to be true can be used to deriveother facts, which must also be true.

    The truth of any new proposition can be checked, in a

    well-specified manner, against the facts that are alreadyknown to be true. Logical inferences will only guarantee the truth of a conclusion if

    the premises leading to the conclusion are also true.

  • 8/13/2019 Lecture 6 Knowledge Representation (1)

    28/28

    28

    Summary

    Knowledge Base Systems

    Components

    Types

    Knowledge Classification

    Knowledge Representation Propositional Logic

    Predicate Logic