Title: Knowledge Representations
1Knowledge Representations
- Shyh-Kang Jeng
- Department of Electrical Engineering/
- Graduate Institute of Communication Engineering
- National Taiwan University
2References
- 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
3Goal-Based Agents
Sensors
Environment
State
Environment Model
Options
Decision Maker
Goals
Agent
Effectors
4Knowledge-Based Agents
Sensors
Environment
Knowledge Base Management System
Knowledge Base
Agent
Effectors
5General 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
-
6General 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
-
-
7Knowledge 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)
8Knowledge Representation
- Natural language
- Most easily understood for people
- Not the best for computers because of ambiguity
- Formal logic was the first representation
language
9Procedural 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
10Declarative 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
11Relational 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
12Hierarchical 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
13Frames
- 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
14A Frame Example
isa
isa
isa
isa
isa
15Semantic 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
16A 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
17Resource Description Framework (RDF)
- Enables the encoding, exchanging and reuse of
structured metadata through using common
conventions of semantics, syntax, and structure - Recommended by W3C to model meta-data about the
resources of the web - Can be used in a knowledge representation system
18RDF Data Model
RDF Description
Property Type1
Property Type3
Resource1
Resource2
Resource3
PropertyType2
PropertyType4
Atomic Value
Atomic Value
19RDF Data Model
- The author of Document1 is John Smith
- John Smith is the author of Document1
Document1
Author
John Smith
20RDF Data Model
Document1
Author_001
Author
Email
Name
Affiliation
smith_at_home.com
John Smith
Home, Inc
21RDF Syntax
- lt?xmlnamespace ns http//www.w3.org/RDF/RDF/
prefix RDF ?gt - lt?xmlnamespace ns http//purl.oclc.org/DC/
prefix DC ?gt - ltRDFRDFgt
- ltRDFDescription RDFHREF http//uri-of-Docum
ent-1gt - ltDCCreatorgtJohn Smithlt/DCCreatorgt
- lt/RDFDescriptiongt
- lt/RDFRDFgt
22RDF Syntax (1)
- lt?xmlnamespace ns http//www.w3.org/RDF/RDF/
prefix RDF ?gt - lt?xmlnamespace ns http//purl.oclc.org/DC/
prefix DC ?gt - lt?xmlnamespace ns http//www.w3.org/RDF/RDF/
prefix RDF ?gt - lt?xmlnamespace ns http//person.org/BusinessCa
rd/ prefix CARD ?gt
23RDF Syntax (2)
- ltRDFRDFgt
- ltRDFDescription RDFHREF http//uri-of-Docum
ent-1gt - ltDCCreator RDFHREF
- Creator_001/gt
- lt/RDFDescriptiongt
- ltRDFDescription IDCreator_001gt
- ltCARDNamegtJohn Smithlt/CardNamegt
- ltCARDEmailgtsmith_at_home.net
- lt/CARDEmailgt
- ltCARDAffiliationgtHome,Inc.
- lt/CARDAffiliationgt
- ltRDFDescriptiongt
- lt/RDFRDFgt
24Use of RDF
- Once the web has been sufficiently populated
with rich metadata, what can we expect? First,
searching on the web will become easier as search
engines have more information available, and thus
searching can be more focused. Doors will also
be opened for automated software agents to roam
the web, looking for information for us or
transacting business on our behalf. The web of
today, the vast unstructured mass of information,
may in the future be transformed into something
more manageable and thus something far more
useful. -
-- Ora Lassila
25Knowledge 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
26Logics
- 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
27Propositional Logic Syntax
28Propositional 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
29Truth Tables for Connectives
30Test 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 -
31First-Order Logic Syntax
32Quantifiers
- Universal quantifier
- Existential quantifier
33Some Properties of Quantified Sentences
34First-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
35Accessing First-Order Logic KB
- Assertions
- Example
- Queries or goals
- Example
- Substitution or binding list
- Example
36Sets 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?
37Special Notations for Sets and Lists
38The Wumpus World
39Agent 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
40Acting and Reasoning in the Wumpus World (1)
41Acting and Reasoning in the Wumpus World (2)
42Acting and Reasoning in the Wumpus World (3)
43Acting and Reasoning in the Wumpus World (4)
44Knowledge After the Third Move
45Propositional Knowledge Base After the Third Move
46Finding the Wumpus
47Problems 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
48Reflex Agent
- Action run(Percept percept)
- state
- interprete(percept)
- rule
- kbms.ruleMatch(state)
- action rule.Action()
-
49Reflex Agent for the Wumpus World (1)
- Direct rules
- Example
- Mediated rules
- Example
50Reflex Agent for the Wumpus World (2)
- Limitations
- Unable to know the states
- Example Not knowing when to climb
- Unable to avoid infinity loop
51Model-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
52Knowledge Engineering
- Knowledge engineering
- Process of building knowledge base
- Knowledge engineer
- Knowledge acquisition
- Prior to, or interleaved with, the process of
creating formal representations
53Knowledge Engineering vs. Programming
54Knowledge 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
55General 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
56A General Ontology Hierarchy
57Ontology for Computer Applications
- Defines the terms used to describe and represent
an area of knowledge - Used by people, databases, and applications that
need to share domain information (a domain is
just a specific subject area or area of
knowledge, like medicine, tool manufacturing,
real estate, automobile repair, financial
management, etc.) - Includes computer-usable definitions of basic
concepts in the domain and the relationships
among them
58Semantic Web
- A vision for the future of the Web in which
information is given explicit meaning, making it
easier for machines to automatically process and
integrate information available on the Web - Built on XML's ability to define customized
tagging schemes and RDF's flexible approach to
representing data
59Next Element Required for Semantic Web
- A Web ontology language which can formally
describe the semantics of classes and properties
used in web documents - In order for machines to perform useful reasoning
tasks on these documents, the language must go
beyond the basic semantics of RDF Schema
60Ontology for Semantic Web Applications
- Need to specify descriptions for the following
kinds of concepts - Classes (general things) in the many domains of
interest - The relationships that can exist among things
- The properties (or attributes) those things may
have
61Ontology for Semantic Web Applications
- Usually expressed in a logic-based language, so
that detailed, accurate, consistent, sound, and
meaningful distinctions can be made among the
classes, properties, and relations - Some ontology tools can perform automated
reasoning using the ontologies, and thus provide
advanced services to intelligent applications
such as conceptual/semantic search and
retrieval, software agents, decision support,
speech and natural language understanding,
knowledge management, intelligent databases, and
electronic commerce.
62DAMLOIL
- DAML
- DARPA Agent Markup Language
- Improvement of RDF for semantic web applications
- Not a W3C initiative
- A more expressive schema language
- OIL
- Ontology Inference Layer
- DAML OIL as an ontology language