Unit5 AI
Unit5 AI
Knowledge Representation
(23ET6PE2AI)
Introduction
➢ Intelligence is conditioned by knowledge and understanding has been one of the toughest
challenges we face.
➢ Knowledge representation is a field, where we study:
➢ Representation of knowledge and facts about the world.
➢ Reasoning that can be performed using the aforementioned knowledge.
➢ The goals for representing knowledge in an efficient manner are manifold. The aim is to achieve
a good representation that can:
➢ Assimilate enough information/knowledge to be able to provide an accurate solution to the problem at
hand.
➢ Be amenable to efficient computation while being maintainable, compact, and natural.
➢ Be expressive enough to incorporate exploitable features of the problem to achieve computational
gain.
➢ Efficiently trade off computational complexity and accuracy.
Ontologies, Objects, and Events
➢ Ontological engineering is the process of representing abstract concepts.
➢ Most of these ontologies have multiple components, which are as follows:
➢ Objects: Individual components in a problem. E.g.: ball and bat.
➢ Categories: A set or collection of different objects. E.g.: vehicles and subjects.
➢ Attributes: Properties / parameters an object can have. E.g.: color and shape.
➢ Relations: Rules that define which objects are put into what category. E.g.: ‘all cats are animals’
➢ Function terms: Complex relational structures that are formed through reasoning across properties defined by multiple
relations and allow for their direct usage in place of a simple relation. E.g.: If cats are animals and all animals are
organisms then we can deduce all cats are organisms.
➢ Restrictions: Formally stated facts and assertions along with the conditions under which that assumption holds true.
E.g.: in a problem that restricts objects to be only mammals, the fact that all objects reproduce without laying eggs
holds true.
➢ Rules: If – then statements that describe logical inferences that define how objects of different categories are related.
E.g.: if the day is sunny, people go fishing; this rule links two categories i.e. weather and people.
➢ Axioms: Assertions which comprise the overall theory which a particular ontology describes in the domain of its
application.
➢ Events: Processes that change attributes and relations of objects. E.g.: if Tom goes fishing on a sunny day, and the
person object contains the attribute ‘has gone fishing’, it will be set true.
Ontologies, Objects, and Events
Categories and Objects
➢ Categories are sets or collection of similar objects.
➢ The collection of objects is a quintessential component of knowledge representation.
➢ Categories can be used to make predictions about objects belonging to the same category, once rules are either learned or
defined.
➢ Such rules are simpler to interpret and serve to organize the knowledge base by the use of inheritance.
➢ Events
➢ Events are embedded in time and can define different properties and relationships of objects at different points in time.
➢ Predicates are meant to symbolize an event being true at some time so they take time as an argument.
Representations and Mappings
➢ Artificial intelligence problems which are complex to solve require a language
that can easily represent vast quantities of knowledge and has methods to
manipulate this knowledge and infer solutions.
➢ We need to define two distinct type of entities that are commonly used in
ontological expressions:
➢ Facts: These are axioms/truths in the modeled world. These are the rules that need
to be represented in the agent.
➢ Representations of facts in some definitive formation: This formal representation is
able to change the attributes of objects and categories. It is also able to learn and
define events in any particular learning scheme.
➢ These entities can further be divided into two levels:
➢ Knowledge level: This level is used to represent all the axiomatic information about
the domain that needs to be learned, complete with initial rules and conditions.
➢ Symbol level: This level declares symbolic meaning of all the objects in the
knowledge level so that an inference engine is able to manipulate the above
mentioned source.
Representations and Mappings
Soln.:
The above fact could have been generated from the following:
All cars have four wheels.
Every car has four wheels.
A total of four wheels are attached to all cars at the time of manufacturing.
Representations and Mappings
Soln.:
The above fact could have been generated from the following:
Attendance (100, Prof.Gururaj).
Attendance (Prof.Gururaj, 100).
∀x: student (x) → attends(Prof.Gururaj, 100)
Representations and Mappings
➢ A bad representation might result in the output not
corresponding to the solutions in real world.
➢ Following are some important properties of mapping:
➢ Query answerability: to enable the agent to work simultaneously,
it must be able to answer queries pertaining to the domain and
the problem at hand that the agent was designed for. For
ontology, a mapping is adequate if any queries raised can be
answered.
➢ Mapping inference: Defining mappings according to the definition
of formalism enables the ability to reason precisely for any task.
➢ Mapping composition: It means to make new mapping given other
mappings. This may be needed when two domains need to be
programmed into one agent that must reason across these
domains.
Approaches to Knowledge
Representation
➢ Representational adequacy: The ability to represent all varied forms of knowledge that are required in the
domain.
➢ Inferential adequacy: The ability to infer new knowledge.
➢ Inferential efficiency: This deals with the ease to infer new knowledge.
➢ Acquisitional efficiency: This depicts how hard it is to gather information.
➢ Unfortunately, there exists no single representation technique or artificially intelligent agent that can
optimize all of the above capabilities for any kind of knowledge that may be encountered in any domain
where such agents may be applied.
➢ In lieu of this, multiple techniques of data representation exist that focus on optimizing some of the
above properties over others.
Approaches to Knowledge
Representation
Simple Relational Knowledge
Approaches to Knowledge Representation
Inheritable Knowledge
➢ Relational knowledge can be extended to Inheritable knowledge by adding to it the ability of inference
through property inheritance. Property inheritance has the following attributes:
1. Values are inherited by the elements from the class to which it belongs.
2. Organization of data is a hierarchy of classes.
➢ Some of the different semantic networks are as follows:
➢ Definitional networks: These networks emphasize the ‘isa’ relationship between a newly defined subtype and a
concept type.
➢ Assertion networks: These networks assert propositions and generally do not classes and sub-classes.
➢ Implicational networks: These are semantic networks that use implication as the major way of connecting two
nodes.
➢ Executable networks: These networks contain mechanisms which may change the network itself.
➢ Learning networks: These are essentially neural networks. They build their representations through gaining
knowledge from data points.
➢ Hybrid networks: These networks combine previous techniques as closely interacting networks.
Semantic Network
➢ Draw the given prolog facts as a semantic network.
a. Fly (yes, bird)
b. Instance of (vertebrate, bird)
c. Feathers (yes, bird)
d. Fly (no, emu)
e. Isa (emu, ernie)
f. Steals potato crisps (yes, ernie)
Semantic Network
➢ Represent the following using a semantic network.
a. Is a (person, Homosapien)
b. Instance (Gerard, person)
c. Team (Gerard, Barcelona)
Approaches to Knowledge
Representation
Inferential Knowledge
➢ Description logics are designed for easier description of properties and definitions of categories.
➢ We can define some of the goals of description logics as follows:
➢ Subsumption: A knowledge representation must be able to find if one category is a subset of another category
using their definitions.
➢ Classification: Any representation should be able to check the membership of objects to their representative of
classes.
➢ Consistency: Representations should also be able to logically argue whether the subsumption and classification
criteria are valid or not.
Forward versus Backward
Chaining
➢ Forward chaining: Starting from the start states and reasoning until the agent is able to achieve one of the
desired goal states.
➢ Backward chaining: Starting from the goal states and determining which start state axioms need to hold true
in order for the goal to occur.
Forward versus Backward
Chaining
Find the colour of a pet named Fritz, given that it eats flies and croaks. The following
four rules are there in the rule base.
Rule 1: Y eats flies and Y croaks → Y is a frog.
Rule 2: Y sings and Y chirps → Y is a canary.
Rule 3: Y is a canary → Y is yellow.
Rule 4: Y is a frog → Y is green.
Soln.:
If Fritz is substituted in Rule 4, we get to know that Fritz is green if he is a frog.
Simultaneously, we know that Fritz is yellow if he is a canary.
Applying Rule 1, we know that if Fritz is a frog, it croaks and eats flies. This state
matches our initial state exactly, since the antecedent is a conjunction of the two
facts that make up our initial axioms. Therefore Fritz must be green in colour.
Matching and Control Knowledge
Matching
➢ There are multiple ways in which rule selection can be performed.
➢ A few proposed solutions are as follows:
➢ Indexing
➢ Matching with variables
➢ Data is temporal
➢ Rules might be similar structurally
Control
➢ Control knowledge basically centers around the following four pillars:
➢ What are the rules that can be useful in application?
➢ What rules can be applied to a particular situation?
➢ If subgoals are present, which order should be followed in the application of rules in order to solve them in the fastest
way possible?
➢ If there are multiple states to which an inference can lead, which states are more preferable?
Slot and Filler Structures
➢ Slot and filler structures are basically divided into two distinct types:
➢ Weak slot and filler structures
➢ Strong slot and filler structures
➢ Weak Slot and Filler Structures
➢ Weak slot and filler structures consist of semantic nets and frames.
➢ Semantic Nets
➢ Partitioned Semantic Nets
➢ Frames
➢ Frames are incredibly powerful on their own as they do not require any additional data-structure in
order to function.
➢ Due to this property, many frame-oriented languages exist that provide a way to represent declarative
knowledge as frames.
➢ These languages include, but are not limited to, FRL, KRL, RLL, and KL-ONE.
Slot and Filler Structures
➢ Strong Slot and Filler Structures
➢ Conceptual Dependency
➢ Four primitives can be used to describe conceptual dependency structures. These are as follows:
➢ ACTs: Actions
➢ Picture Producers (PPs): Objects
➢ Action Aiders (AAs): Modifiers of actions
➢ Picture Aiders (PAs): Modifiers of PPs
➢ TS: Time of action
Slot and Filler Structures
Slot and Filler Structures
Slot and Filler Structures
Slot and Filler Structures
Represent the statement ‘Joe ate the ice cream with a spoon’ using
conceptual dependency
Slot and Filler Structures
Script
➢ A script has the following various components:
➢ Conditions for entry
➢ Tracks
➢ Result
➢ Props
➢ Roles
➢ Scenes
Issues in Knowledge
Representation
➢ Several issues that arise during data representation are:
➢ Selection of important attributes
➢ Identifying the relationships between attributes
➢ Choice of granularity of representation
➢ Representing categories of objects
Developments in the Field of
Knowledge Representation
➢ W3C has developed new models of semantic representation, such as Resource Description
Framework (RDF) and Web Ontology Language (OWL).
Resource Description Framework (RDF)
➢ The following uses are some of the reasons for the development of RDF:
➢ Metadata on Internet
➢ Applications that require open data model
➢ To process machine information similar to how hypertext is processed in the World Wide Web
➢ Interworking among applications
➢ Automated processing of web information by software agents
Developments in the Field of
Knowledge Representation
➢ The design of RDF is intended to meet the following goals:
➢ Have a simple data model.
➢ Have formal semantics and provable inference.
➢ Use an extensible Universal Resource Identifier (URI) based vocabulary with optional fragment
identifiers. URI references are used for naming all kinds of things in RDF.
➢ Use an XML-based syntax which can be used to encode the data model for exchange of
information among applications.
➢ Support use of XML schema data types, thus assisting the exchange of information between
RDF and other XML applications.
➢ Allow anyone to make statements about any resource.
Developments in the Field of
Knowledge Representation
➢ RDF uses the following key concepts:
➢ Graph data model
➢ URI-based vocabulary
➢ Data types
➢ Literals
➢ XML serialization syntax
➢ Expression of simple facts
➢ Entailment
➢ A Resource is anything that can have a URI
➢ A Property is a Resource that has a name, such as author or homepage.
➢ A Property Value is the value of a Property, such as Jan Egil Refunes
Developments in the Field of
Knowledge Representation
Web Ontology Language (OWL)
➢ Complex knowledge about objects, their classes, and the relations that bind them is rich.
➢ Languages in the OWL family are capable of creating classes, properties, defining instances and its
operations.
➢ The OWL language management system (LMS) has concept as its only primary data type.
➢ The following set of relations hold, while their inverses do not:
➢ Every legal OWL Lite ontology is a legal OWL DL ontology.
➢ Every legal OWL DL ontology is a legal OWL Full ontology.
➢ Every valid OWL Lite conclusion is a valid OWL DL conclusion.
➢ Every valid OWL DL conclusion is a valid OWL Full conclusion.
➢ The OWL abstract syntax presents an ontology as a sequence of annotations, axioms, and facts.
➢ Annotations carry machine and human-oriented metadata.
➢ Axioms specify the characteristics of classes and properties.
Summary
➢ There are different types of knowledge representation techniques such as relational knowledge,
inheritable knowledge, inferential knowledge, and procedural knowledge.
➢ There are different levels of knowledge representation (i.e., symbol level and fact level) and issues in
knowledge representation.
➢ Forward reasoning is when we start with initial state and try to reach the goal state.
➢ Backward reasoning is when we begin with the goal state and try to reach the initial state.
➢ Weak slot and filler structures such as semantic nets and frames are used to represent sentences in first
order predicate logic.
➢ Strong slot and filler structures such as conceptual dependency and scripts can represent natural
language sentences which have causal relationships with each other.
➢ Recent advances in knowledge representation include resource description framework (RDF) and Web
Ontology Language (OWL).
➢ The underlying structure of any expression in RDF is a collection of triples, each consisting of a subject,
a predicate, and an object.
➢ The OWL abstract syntax presents an ontology as a sequence of annotations, axioms, and facts.