Autonomy Knowledge Representation - PowerPoint PPT Presentation

1 / 79
About This Presentation
Title:

Autonomy Knowledge Representation

Description:

Representation and reasoning support the operation of a knowledge-based agent ... Given a knowledge base KB, an inference procedure can generate new sentences ... – PowerPoint PPT presentation

Number of Views:62
Avg rating:3.0/5.0
Slides: 80
Provided by: shyhka
Category:

less

Transcript and Presenter's Notes

Title: Autonomy Knowledge Representation


1
Autonomy Knowledge Representation
  • Shyh-Kang Jeng
  • Department of Electrical Engineering/
  • Graduate Institute of Communication Engineering
  • National Taiwan University

2
References
  • J. P. Bigus and J. Bigus, Constructing
    Intelligent Agents with Java, Wiley Computer
    Publishing, 1998
  • S. Russell and P. Norvig, Artificial
    Intelligence A Modern Approach, Englewood
    Cliffs, NJ Prentice Hall, 1995

3
Goal-Based Agents
Sensors
Environment
State
Environment Model
Options
Decision Maker
Goals
Agent
Effectors
4
Knowledge-Based Agents
Sensors
Environment
Knowledge Base Management System
Knowledge Base
Agent
Effectors
5
Knowledge Base
  • A set of representation of facts about the world
  • Each individual representation is a sentence
  • Sentences are expressed in a knowledge
    representation language
  • Knowledge representation languages are composed
    of symbols
  • Representation and reasoning support the
    operation of a knowledge-based agent
  • Accessed through a knowledge base management
    system (KBMS)

6
General Knowledge-Based Agent (1)
  • class KBAgent
  • KnowledgeBase kb
  • KBMS kbms
  • counter t // indicating time
  • public KBAgent()
  • kb new KnowledgeBase()
  • kbms new KBMS( kb )
  • t 0

7
General Knowledge-Based Agent (2)
  • public Action run(Percept percept)
  • kbms.tell(new
  • PerceptSentence(percept, t))
  • Action action kbms.ask( new
  • ActionQuery(t) )
  • kbms.tell( new
  • ActionSentence(action,t) )
  • t return action

8
Description Levels
  • Knowledge level (epistemological level)
  • Most abstract
  • Example Taipei is in the north of I-Lan
  • Logical level
  • Knowledge is encoded into sentences
  • Example North( Taipei, Taiwan )
  • Implementation level
  • Physical representation of the sentences at the
    logical level
  • Important to the efficient performance of the
    agent

9
Knowledge Representation
  • Natural language
  • Most easily understood for people
  • Not the best for computers because of ambiguity
  • Formal logic was the first representation
    language

10
Some Kinds of Knowledge
  • Simple facts or complex relationships
  • Mathematical formulas or rules for natural
    language syntax
  • Associations between related concepts
  • Inheritance hierarchies between classes of objects

11
Choosing Knowledge Representations
  • Each type of knowledge places special
    requirements on both human comprehension and
    computer manipulation
  • A good knowledge representation
  • Easy to use
  • Easily modified and extended

12
Procedural Representation
  • Encodes facts and defines sequence as well as the
    control structure of operations for using and
    manipulating those facts
  • Example FORTRAN programs
  • hardcoded logic
  • Not considered to be part of AI per se
  • Few AI programs exist which do not contain some
    amount of procedural control code

13
Declarative Representation
  • Simply states facts, rules, and relationships
  • Separate the knowledge and the manipulation of
    the knowledge
  • Still needs to be processed by some procedural
    code
  • More easily modified
  • Allows for optimization and reuse inferencing
    procedures

14
Relational Representation
  • Knowledge is stored in a table and manipulated
    through relational calculus
  • Information of an item is represented by tuples
    or records
  • Each tuple contains a set of fields or columns
    defining specific attributes and values of the
    item
  • Flexible but not good at representing complex
    relationships between concepts or objects in the
    real world

15
Hierarchical Representation
  • Represents relationships and shared attributes
    between kinds or classes of objects
  • Use categories or types to give structure to the
    world by grouping similar objects together
  • Allows for compact representation
  • Allows reasoning algorithms to process at
    different levels of abstraction or granularity

16
Frames
  • As a collection of attributes which defines the
    state of an object and its relationship to other
    frames
  • Also called slot-and-filler data representations
  • Slots are the data values
  • Fillers are attached procedures which are called
    before, during, or after the slots value is
    changed
  • Often linked to a hierarchy

17
A Frame Example
isa
isa
isa
isa
isa
18
Semantic Nets
  • Defines the meaning of a concept by its
    relationships to other concepts
  • Uses a graph data structure, where nodes hold
    concepts and links show the relationships
  • Both frames and semantic nets can be transformed
    to predicate logic

19
A Semantic Net Example
has-part
Vehicle
Wheels
has-part
isa
has-part
Motor
Doors
Automobile
num-wheels
isa
size
4
Sports Car
Small
num-doors
2
instance
Corvette
20
Knowledge Representation Language
  • Syntax
  • describes the possible configurations that
    constitute sentences
  • Semantics
  • determines the facts in the world to which the
    sentences refer
  • Logic
  • A language with the syntax and semantics defined
    precisely

21
Entailment
  • A set of sentences entails a sentence if the fact
    represented by the sentence follows the facts
    represented by the set of sentences

22
Inference Procedure
  • Given a knowledge base KB, an inference procedure
    can generate new sentences that purport to be
    entailed by KB
  • Given a knowledge base KB and another sentence a,
    an inference procedure can report whether or not
    a is entailed by KB
  • An inference procedure that generates only
    entailed sentences is called sound or
    truth-preserving

23
Proof, Complete Procedure, and Proof Theory
  • The record of operations of a sound inference
    procedure is called a proof
  • An inference procedure is complete if it can find
    a proof for any sentence that is entailed
  • Proof theory specifies a set of rules for
    deducing the entailments of a set of sentences

24
Logics
  • A logic consists of
  • A formal system for describing states of affairs,
    consisting of the syntax and the semantics of the
    language
  • A proof theory
  • The ontological commitments of a logic have to do
    with the nature of reality in the related world
  • The epistemological commitments of a logic have
    to do with states of knowledge an agent can have

25
Some Formal Languages
26
Propositional Logic Syntax
27
Propositional Logic Semantics
  • Defined by specifying the interpretation of the
    symbols and constants, and specifying the
    meanings of the logical connectives
  • A complex sentence has a meaning derived from the
    meaning of its parts
  • Each connective can be thought of as a function
    and defined by truth tables

28
Truth Tables for Connectives
29
Test for Valid Sentences
  • A valid sentence is true for every possible
    combination of truth values for the propositional
    symbols in the sentence
  • Truth table can be used to test for valid
    sentences
  • This can be used to determine if the conclusion
    (consequent) is true given some premises
    (antecedent). Just test if the following sentence
    is valid


30
Models (1)
  • Any world in which a sentence is true under a
    particular interpretation is called a model of
    the sentence under that interpretation
  • The meaning of a sentence can be defined by means
    of set operations on sets of models
  • Another view is to regard a model as a mapping
    from proposition symbols to truth and falsehood,
    and the models of a sentence are those mappings
    that make the sentence true

31
Models (2)
32
Inference Rules (1)
  • The soundness of an inference can also be
    established through truth tables
  • Inference rules are some inference patterns that
    occur frequently
  • Inference rules can be used to make inferences
    without going through the tedious process of
    building truth tables
  • The inference rule that b can be derived from a
    is denoted as

33
Inference Rules (2)
  • Conjunctions and conjuncts
  • Disjunctions and disjuncts

34
Inference Rules (3)
  • Modus Ponens or Implication-Elimination
  • And Elimination

35
Inference Rules (4)
  • And-Introduction
  • Or-Introduction

36
Inference Rules (5)
  • Double-Negation Elimination
  • Unit Resolution

37
Inference Rules (6)
  • Resolution
  • b cannot be both true and false, one of the
    other disjuncts must be true in one of the
    premises
  • Or, equivalently, implication is transitive

38
Completeness and Complexity of Propositional
Inference
  • The truth-table method of inference is complete
  • For any proof involving n proposition symbols, 2n
    rows of the table is enumerated
  • Complexity is O(2n)
  • A more efficient inference procedure relies on
    the monotonicity

39
Monotonicity
  • A logic is monotonic if when we add some new
    sentences to the knowledge base, all the
    sentences entailed by the original knowledge base
    are still entailed by the new larger knowledge
    base
  • This is true regardless of the contents of the
    new knowledge base it can be irrelevant or even
    contradictory to the original knowledge base
  • Propositinal logic and first-logic are monotonic
    in this sense

40
A Knowledge Base Example
41
An Inference Example
42
The Wumpus World
43
Agent in the Wumpus World
  • The agent starts in the lower left corner labeled
    1,1, facing to the right
  • Goal Find the gold, return to 1,1 and climb
    out of the cave as soon as possible
  • Actions Forward, Turn(Right), Turn(Left), Grab,
    Release, Shoot, Climb
  • Percepts Stench, Breeze, Glitter, Bump, Scream

44
Acting and Reasoning in the Wumpus World (1)
45
Acting and Reasoning in the Wumpus World (2)
46
Acting and Reasoning in the Wumpus World (3)
47
Acting and Reasoning in the Wumpus World (4)
48
Knowledge After the Third Move
49
Propositional Knowledge Base After the Third Move
50
Finding the Wumpus
51
Propositional Agent Action
  • Action rule example
  • Action Query
  • while(actionIterator.hasNext())
  • if( kb.ask( new
  • ActionQuery(t, action) )
  • t
  • return action

52
Problems with Propositional Agent
  • Too many propositions to handle
  • Example 64 propositions for the rule dont
    forward if the wumpus is in front of you
  • Dealing with change over time
  • Example

53
First-Order Logic Syntax
54
Quantifiers
  • Universal quantifier
  • Existential quantifier

55
Some Properties of Quantified Sentences
56
First-Order Logic vs.Higher-Order Logic
  • In first-order logic one can quantify over
    objects but not over relations or functions on
    those objects
  • Higher-order logic allows us to quantify over
    relations and functions as well as over objects
  • Example

57
Axioms, Definitions, and Theorems
  • Axioms Basic facts about a domain
  • Definition Basic description of concepts in a
    domain
  • Example Definition of P
  • Theorem Sentences proved through axioms and
    definitions
  • Independent axioms and redundant axioms

58
Sets and Lists
  • Sets
  • Constant EmptySet
  • Predicates Set, Member, Subset
  • Functions Intersection, Union, Adjoint
  • Lists
  • Constant Nil
  • Functions Cons, Append, First, Rest
  • Predicates Find, Member, List?

59
Special Notations for Sets and Lists
60
Accessing First-Order Logic KB
  • Assertions
  • Example
  • Queries or goals
  • Example
  • Substitution or binding list
  • Example

61
General Knowledge-Based Agent (1)
  • class KBAgent
  • KnowledgeBase kb
  • KBMS kbms
  • counter t // indicating time
  • public KBAgent()
  • kb new KnowledgeBase()
  • kbms new KBMS( kb )
  • t 0

62
General Knowledge-Based Agent (2)
  • public Action run(Percept percept)
  • kbms.tell(new
  • PerceptSentence(percept, t))
  • Action action kbms.ask( new
  • ActionQuery(t) )
  • kbms.tell( new
  • ActionSentence(action,t) )
  • t return action

63
Reflex Agent
  • Action run(Percept percept)
  • state
  • interprete(percept)
  • rule
  • kbms.ruleMatch(state)
  • action rule.Action()

64
Reflex Agent for the Wumpus World (1)
  • Direct rules
  • Example
  • Mediated rules
  • Example

65
Reflex Agent for the Wumpus World (2)
  • Limitations
  • Unable to know the states
  • Example Not knowing when to climb
  • Unable to avoid infinity loop

66
Model-Based Agent
  • Maintain an internal model of the world
  • Any system that makes decisions on the basis of
    past percepts can be rewritten to use instead a
    set of sentences about the current world state
  • Example My keys are in my pocket
  • Diachronic rules
  • Rules describing the way in which the world
    changes or does not change

67
Situational Calculus
68
Representing Changes
  • Relations or functions
  • Examples
  • Function Result
  • Examples
  • Effect axioms
  • Examples

69
Defining Time-Varying Predicates
  • Frame axioms
  • Examples
  • Successor-state axioms
  • Example

70
Describing the Map
71
Synchronic Rules
  • Causal Rules
  • Examples
  • Diagnostic Rules
  • Examples

72
Diagnostic Rules vs. Model-Based Reasoning
  • Reasoning that a square is OK
  • Diagnostic rules
  • Model-based reasoning

73
Action-Value System
  • Example
  • Great, Good, Medium, Risky, Deadly
  • Recommending an action

74
Agent Exploration Policy
  • Great to pick up the gold when found and climbing
    out of the cave with the gold
  • Good to move to an OK square that has not been
    visited
  • Medium to move to an OK square that has been
    visited
  • Risky to move to a square that is not deadly, but
    is not known to be OK either
  • Deadly to move to a square that is known to
    contain a pit or a live wumpus

75
Knowledge Engineering
  • Knowledge engineering
  • Process of building knowledge base
  • Knowledge engineer
  • Knowledge acquisition
  • Prior to, or interleaved with, the process of
    creating formal representations

76
Knowledge Engineering vs. Programming
77
Knowledge Engineering Methodology
  • Ontological engineering
  • Decide what to talk about
  • Decide on a vocabulary of predicates, functions,
    and constants (ontology of the domain)
  • Encode general knowledge about the domain
  • Encode a description of the specific problem
    instance
  • Pose queries to the inference procedure and get
    answers

78
General Ontology
  • Ontology
  • Particular theory of the nature of being or
    existence
  • General ontology
  • Applicable in more or less any special-purpose
    domain, with the addition of domain-specific
    axioms
  • Examples Categories, measures, composite
    objects, time, space, change, events, processes,
    physical objects, substances, mental objects,
    beliefs

79
A General Ontology Hierarchy
Write a Comment
User Comments (0)
About PowerShow.com