0% found this document useful (0 votes)
34 views57 pages

Knowledge Representation and Reasoning: Dr. Anjali Diwan

The document discusses knowledge representation and reasoning in artificial intelligence. It covers several key topics: 1. Humans acquire knowledge through experience and reasoning, and AI aims to do the same through knowledge bases and logical agents. 2. Knowledge representation involves determining how to formally represent knowledge, such as through logic-based languages. Reasoning involves processes for deriving new information. 3. There are different types of knowledge like declarative, procedural, heuristic, and meta-knowledge. Knowledge bases store facts and support inference to derive new information. Logical consistency is important for reasoning.

Uploaded by

Paulos K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views57 pages

Knowledge Representation and Reasoning: Dr. Anjali Diwan

The document discusses knowledge representation and reasoning in artificial intelligence. It covers several key topics: 1. Humans acquire knowledge through experience and reasoning, and AI aims to do the same through knowledge bases and logical agents. 2. Knowledge representation involves determining how to formally represent knowledge, such as through logic-based languages. Reasoning involves processes for deriving new information. 3. There are different types of knowledge like declarative, procedural, heuristic, and meta-knowledge. Knowledge bases store facts and support inference to derive new information. Logical consistency is important for reasoning.

Uploaded by

Paulos K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

KNOWLEDGE

REPRESENTATION AND
REASONING
DR. ANJALI DIWAN
KNOWLEDGE AND REASONING:

humans are very good at acquiring new information by


combining raw knowledge, experience with reasoning.
AI-slogan: “Knowledge is power” (or “Data is power”?)

Examples:
Medical diagnosis --- physician diagnosing a patient
infers what disease, based on the knowledge he/she
acquired as a student, textbooks, prior cases
Common sense knowledge / reasoning ---
common everyday assumptions / inferences
e.g., “lecture starts at four” infer pm not am;
when traveling, I assume there is some way to get from the
airport to the hotel.
Logical agents:
Agents with some representation of the
complex knowledge about the world / its environment,
and uses inference to derive new information from that
knowledge combined with new inputs (e.g. via perception).

Key issues:
1- Representation of knowledge
What form? Meaning / semantics?
2- Reasoning and inference processes
Efficiency.
KNOWLEDGE-BASE AGENTS

• Key issues:
• Representation of knowledge knowledge base
• Reasoning processes inference/reasoning

Knowledge base = set of sentences in a formal language representing
facts about the world(*)

(*) called Knowledge Representation (KR) language


KNOWLEDGE BASES
• Key aspects:
• How to add sentences to the knowledge base
• How to query the knowledge base

Both tasks may involve inference – i.e. how to derive new sentences from old
sentences

Logical agents – inference must obey the fundamental requirement that when one asks
a question to the knowledge base, the answer should follow from what has been
told to the knowledge base previously. (In other words the inference process should
not “make things” up…)
TYPES OF KNOWLEDGE IN AI

• Declarative knowledge: The knowledge which is based on concepts, facts and


objects, is termed as 'Declarative Knowledge'.
• It provides all the necessary information about the problem in terms of simple
statements, either true or false.
• Procedural knowledge: Procedural knowledge derives the information on the basis
of rules, strategies, agendas and procedure.
• It describes how a problem can be solved.
• Procedural knowledge directs the steps on how to perform something.
For example: Computer program.
• Heuristic knowledge: Heuristic knowledge is based on thumb rule.
• It provides the information based on a thumb rule, which is useful in guiding the
reasoning process.
• In this type, the knowledge representation is based on the strategies to solve the
problems through the experience of past problems, compiled by an expert. Hence, it
is also known as Shallow knowledge
• Meta-knowledge: This type gives an idea about the other types of knowledge
that are suitable for solving problem.
• Meta-knowledge is helpful in enhancing the efficiency of problem solving through
proper reasoning process.
• Structural knowledge: Structural knowledge is associated with the information
based on rules, sets, concepts and relationships.
• It provides the information necessary for developing the knowledge structures and
overall mental model of the problem.
INTRODUCTION
• Real knowledge representation and reasoning systems come in several major varieties.
• These differ in their intended use, expressivity, features,…
• Some major families are
• Logic programming languages
• Theorem provers
• Rule-based or production systems
• Semantic networks
• Frame-based representation languages
• Databases (deductive, relational, object-oriented, etc.)
• Constraint reasoning systems
• Description logics
• Bayesian networks
8
• Evidential reasoning
KNOWLEDGE REPRESENTATION

• Requirements:
• Adequacy (I) (also called completeness)
• Correctness (II) I/II/III
• Efficiency (III)

Representational Inferential Acquisitional (learning)


Representation Knowledge

Should be able to represent


Structured (Eg: tables)
everything in scope
(expressive power)

Correct Semi-structured (Eg: Xml


database)

Efficient Unstructured (Eg: Plain text)


• Examine tables as a
knowledge representation Student
Height Weight BMI
scheme name
• How do tables fair in Ram 5.6 76 xyz
terms of Shyam 6.2 63 pqr
-Adequacy John 5.1 56 abc

-Inference
-Acquisition ?
• Consider the question “Which student is the tallest?”
• Without a procedure to calculate max, the question
cannot be answered. (Needs Inferencing)
KNOWLEDGE REPRESENTATION
SCHEMES
1. Propositional calculus
2. Predicate calculus
3. Semantic net
4. Frames

Predicate calculus is considered as the epitome of KR in terms of


adequacy and inferencing
Inferencing in PC

Resolution Forward Backward


chaining chaining
Knowledge

Declarative Procedural

• Declarative knowledge deals with factoid questions (what is the capital


of India? Who won the Wimbledon in 2005? Etc.)
• Procedural knowledge deals with “How”
• Procedural knowledge can be embedded in declarative knowledge
PROPOSITIONAL LOGIC
• The simplest kind of logic is propositional logic Sr.
(PL), in which all statements are made up of Subject Syntax
No
propositions. The term "Proposition"refers to a
declarative statement that can be true or false. Upper Case letters
Simple undividable statement
It's a method of expressing knowledge in logical A, B, C, P, Q, R are
1 represent true or false (not both)
and mathematical terms. used to represent
and it is Boolean in nature
statements
• This logic is synonymous with sentential logic,
provides ways and means of combining or ^, v, →, ↔, ¬ are
changing the propositions to create a used to represent
complicated structure and to build a new logical Logical Connectors or operators
AND, OR,
relationship and properties. 2 used to
Implies,
connect two statements
• PL Language structure consists of simple bi-conditional and
undividable statements joined together with NOT condition.
logical connectors. Complex conditions
• A sentence in any language contains a are handled by
combination of words like the verb, noun, 3 Complex conditions coding
pronoun, prepositions, etc., Syntax of PL connectors within
Language also follows a similar rule, and it parenthesis.
consists of
BASIC FACTS ABOUT PROPOSITIONAL LOGIC

• Because it operates with 0 and 1, propositional logic is also known as Boolean logic.
• In propositional logic, symbolic variables are used to express the logic, and any symbol can be used to represent a
proposition, such as A, B, C, P, Q, R, and so on.
• Propositions can be true or untrue, but not both at the same time.
• An object, relations or functions, and logical connectives make up propositional logic.
• Logical operators are another name for these connectives.
• The essential parts of propositional logic are propositions and connectives.
• Connectives are logical operators that link two sentences together.
• Tautology, commonly known as a legitimate sentence, is a proposition formula that is always true.
• Contradiction is a proposition formula that is always false.
• Statements that are inquiries, demands, or opinions are not propositions, such as "Where is Rohini","How are
you", and "What is your name" are not propositions.
SYNTAX
• See text for formal rules.
• All of propositional + quantifiers, predicates,
functions, and constants.
• Variables can take on values of constants or terms.
• Term = reference to object
• Variables not allowed to be predicates.
• E.G. What is the relationship between Bill and Hillary?
• Text Notation: variables lower case, constants
upper
• Prolog Notation: variables are upper case, etc
SYNTAX OF PROPOSITIONAL LOGIC
The allowed sentences for knowledge representation are defined by the syntax of propositional logic.
• Propositions are divided into two categories:
• Atomic Propositions:
• Simple assertions are referred to as atomic propositions. It is made up of only one proposition sign. These are the sentences that
must be true or untrue in order to pass.

Example: 2+2 is 4, it is an atomic proposition as it is a true fact.


The Sun is cold" is also a proposition as it is a false fact.

• Compound propositions:
• Simpler or atomic statements are combined with parenthesis and logical connectives to form compound propositions.

Example: "It is raining today, and street is wet."


Ankit is a doctor, and his clinic is in Mumbai."
PROPOSITIONAL LOGIC CONNECTIVES
Logical connectives are used to link two simpler ideas Connective Symbol Technical Word Example
or to logically represent a statement. Term
Negation: A statement like ¬P is referred to as a ∧ Conjunction AND P∧Q
negation of P. There are two types of literals: positive
and negative literals. V Disjunction OR PVQ
Example: Rohan is intelligent and hardworking. It can → Implication Implies P→Q
be written as, ⇔ Biconditional If and only If P⇔Q
P = Rohan is intelligent,
Q = Rohan is hardworking. →P ∧ Q. ¬ or ~ Negation Not ¬P or ¬Q
Conjunction:A conjunction is a sentence that
Implication: An implication is a statement such as P → Q. If-then rules
contains ∧ connective such as, P ∧ Q.
are another name for implications. It can be expressed as follows: If it
Example: "Ritika is a doctor or Engineer",
rains, the street is flooded.
Here P = Ritika is Doctor. Q = Ritika is Doctor, so we
Because P denotes rain and Q denotes a wet street, the situation is
can write it as P ∨ Q.
written as P and Q
Disjunction: A disjunction is a sentence with a
Biconditional: A sentence like P Q, for example, is a biconditional
connective ∨ , such as P ∨ Q, where P and Q are the
sentence. I am alive if I am breathing.
propositions.
P= I am breathing, Q = I am alive, it can be represented as P ⇔ Q.
PREDICATE LOGIC

• Predicate logic is an extension of propositional logic that permits concisely


reasoning about whole classes of entities.
E.g., “x>1”, “x+y=10”
• Such statements are neither true or false when the values of the variables are not
specified.

20
LIMITATIONS OF PROPOSITIONAL LOGIC

• This is not possible to represent relations like ALL, some, or none with
propositional logic. Example:
• All the girls are intelligent.
• Some apples are sweet.
• The expressive power of propositional logic is restricted.
• We can't explain propositions in propositional logic in terms of their qualities
or logical relationships.
PROPOSITIONAL LOGIC CAN’T SAY

• If X is married to Y, then Y is married to X.


• If X is west of Y, and Y is west of Z, then X is west of Z.
• And a million other simple things.
• Fix:

• extend representation: add predicates


• Extend operator(resolution): add unification
TERM

• A term with no variables is a ground term.


• Composite Objection: function of terms or primitives
• Convenience: we don’t want to name all objects
• e.g. nounphrase(det(the),adj(tall),noun(tree)).
• E.g. leftLeg(John).
• Successor of 1 may be s(1), but we write 2.
• Successor of 2 s(s(1)), but we write 3.
2

REPRESENTATION
SYSTEMS
KNOWLEDGE 3

● Goal: common sense reasoning

● Need to represent knowledge about


the world

● Types of knowledge
– objects
– events
– procedures
– relations
– mental states
– meta knowledge
PROPERTIES OF 4

REPRESENTATION SYSTEMS
● Representational adequacy
– ability to represent the required knowledge

● Inferential adequacy
– ability to manipulate knowledge
⇒ produce new knowledge

● Inferential efficiency
– ability to direct inference methods into productive directions
– ability to respond with limited resources (time, storage)

● Acquisitional efficiency
– ability to acquire new knowledge
– ideally, automatically
GOLDBACH’S CONJECTURE

• For all n, if integer(n), even(n), greater(n,2) then there


exists p1, p2, integer(p1), integer(p2),
prime(p1),prime(p2), and equals(n,sum(p1,p2)).
• Quantifiers: for all, there exists
• Predicates: integer, greater, prime, even, equals.
• Constants: 2
• Functions: sum.
5

CATEGORIES AND
OBJECTS

Philipp Koehn
CATEGORIES 6

● Specific objects, e.g., my basketball

● General category, e.g., Basketballs(my club)


– categories as relationships: Basketballs(my club)
– reification of predicate: Basketballs
→ use in other predicates Member(my club, Basketballs)
abbreviated to BB9 ∈ Basketballs

● Subcategories
– for instance Subset(Basketballs, Ball)
– abbreviated as Basketballs ⊂ Ball

● Taxomony: System of categories and subcategories


BASIC RELATIONS FOR 7

CATEGORIES

● Disjoint({Animals, Vegetables})

● ExhaustiveDecomposition(
{Americans, Canadians, Mexicans},
NorthAmericans)

● Partition({Males, Females}, Animals)

● These properties can be defined with first order logic


TECHNIQUES OF KNOWLEDGE REPRESENTATION

There are mainly four ways of knowledge


representation which are given as follows:
• Logical Representation
• Semantic Network Representation
• Frame Representation
• Production Rules
SEMANTICS

• Validity = true in every model and every interpretation.


• Interpretation = mapping of constants, predicates, functions into
objects, relations, and functions.
• For Goldbach wrt to standard integer model: interpretation = mapping
n to an even integer. (Context).
SEMANTIC NETWORK
• In Semantic networks, we can represent our knowledge in the form of graphical networks.
• This network consists of nodes representing objects and arcs which describe the relationship
between those objects.
• Semantic networks can categorize the object in different forms and can also link those
objects.
• This representation consist of mainly two types of relations:
• IS-A relation (Inheritance)
• Kind-of-relation
MAIN COMPONENTS OF SEMANTIC NETWORKS
• Lexical component:
• Nodes denoting physical objects or links are relationships between objects; labels denote the
specific objects and relationships
• Structural component:
• The links or nodes from a diagram which is directed.
• Semantic component:
• Here the definitions are related only to the links and label of nodes, whereas facts depend on
the approval areas.
• Procedural part:
• Constructors permit the creation of the new links and nodes. The removal of links and nodes
are permitted by destructors.
SIX MOSTLY USED TYPES OF SEMANTIC NETWORKS

• Definitional Networks
• Assertion Networks
• Implicational Networks
• Executable Network
• Learning Networks
• Hybrid Networks
SIX MOSTLY USED TYPES OF SEMANTIC NETWORKS
Definitional networks:

• Emphasize the subtype or is-a relation


between a concept type and a newly
defined subtype.
• The resulting network, also called a
generalization or subsumption hierarchy,
supports the rule of inheritance for copying
properties defined for a supertype to all of
its subtypes.
• Since definition are true by definition, the
information in these networks is often
assumed to be necessarily true.
SIX MOSTLY USED TYPES OF
SEMANTIC NETWORKS
Assertional networks:

• Are designed to assert propositions.Unlike


definitional network, the information in an
assertional network is assumed to be
contingently true, unless it is explicitly
marked with a modal operator.
• Some assertional networks have been
proposed as models of the conceptual
structures underlying natural language
semantics.
SIX MOSTLY USED TYPES OF SEMANTIC NETWORKS

Implicational networks:

• Use implication as the primary relation for


connecting nodes. They may be used to represent
patterns of beliefs, causality, or inferences.
• Implicational networks emphasize implication, they
are capable of expressing all the Boolean
connectives by allowing a conjunction of inputs to a
propositional node and a disjunction of outputs.
SIX MOSTLY USED TYPES OF SEMANTIC NETWORKS

Executable networks:
• Include some mechanism, such as marker
passing or attached procedures, which can
perform inferences, pass messages, or
search for patterns and associations.
• Executable semantic networks contain
mechanisms that can cause some change to
the network itself.
SIX MOSTLY USED TYPES OF SEMANTIC NETWORKS
Learning networks:
• Build or extend their representations by
acquiring knowledge from examples.The new
knowledge may change the old network by
adding and deleting nodes and arcs or by
modifying numerical values, called weights,
associated with the nodes and arcs.
• The purpose of learning, both from a natural
and AI standpoint, is to create modifications
that enable the system to respond more
effectively within its environment.
SIX MOSTLY USED TYPES OF SEMANTIC NETWORKS
Hybrid networks:
• Combine two or more of the previous
techniques, either in a single network or in
separate, but closely interacting networks..
• System are usually called hybrids if their
component languages have different
syntax... The most widely used hybrid of
multiple network notations is the Unified
Modeling Language (UML), which was by
designed by three authors....who merged
their competing notations.
SEMANTIC NETWORKS ARE MAJORLY USED FOR

• Representing data
• Revealing structure (relations, proximity, relative importance)
• Supporting conceptual edition
• Supporting navigation
EXAMPLE

• Its representation mainly consists of two types of relations: IS-A


relation (Inheritance) and Kind-of-relation.
Advantages Of Using Semantic Nets
• The semantic network is more natural than the logical representation;
Disadvantages Of Using Semantic Nets
• The semantic network permits using of effective inference algorithm • There is no standard definition for
(graphical algorithm) link names
• They are simple and can be easily implemented and understood. • Semantic Nets are not intelligent,
dependent on the creator
• The semantic network can be used as a typical connection application • Links are not alike in function or
among various fields of knowledge, for instance, among computer form, confusion in links that asserts
science and anthropology. relationships and structural links
• Undistinguished nodes that
• The semantic network permits a simple approach to investigate the represent classes and that represents
problem space. individual objects
• The semantic network gives an approach to make the branches of • Links on object represent only binary
related components relations
• Negation and disjunction and general
• The semantic network also reverberates with the methods of the people taxonomical knowledge are not
process data. easily expressed.
• The semantic network is characterized by greater cognitive adequacy
compared to logic-based formalism.
• The semantic network has a greater expressiveness compared to logic.
FRAME REPRESENTATION
• A frame is a record like structure which consists of a collection of attributes and its values to
describe an entity in the world.
• Frames are more structured form of packaging knowledge, - used for representing objects,
concepts etc
• Frames are the AI data structure which divides knowledge into substructures by representing
stereotypes situations.
• It consists of a collection of slots and slot values.
• These slots may be of any type and sizes. Slots have names and values which are called
facets.

Facets: The various aspects of a slot is known as Facets. Facets are


features of frames which enable us to put constraints on the frames
Example
• A frame may consist of -- any number of slots, and
• a slot may include --- any number of facets and
• facets may have - any number of values.

A frame is also known as slot-filter knowledge


representation in artificial intelligence.

Frames are derived from semantic networks and later evolved into our modern-day
classes and objects
DESCRIPTION OF FRAMES

• Each frame represent either a class or an instance.


• Class frame represents a general concept whereas instance frame represents
a specific occurrence of the class instance.
• Class frame generally have default values which can be redefined at lower
levels.
• If class frame has actual value facet then decedent frames can not modify
that value.
• Value remains unchanged for subclasses and instances.
INHERITANCE IN FRAMES

• Suppose we want to know nationality or phone of an instance-frame13.


• These information are not given in this frame.
• Search will start from frame13 in upward direction till we get our answer or
have reached root frame.
• The frame can be easily represented in prolog by choosing predicate name as
frame with two arguments.
• First argument is the name of the frame and second argument is a list of slot -
facet pair.
EXAMPLES OF FRAME
EATURES OF FRAME REPRESENTATIONS

• Frames can support values more naturally than semantic nets (e.g. the value 25)
• Frames can be easily implemented using object-oriented programming
techniques.
• Demons allow for arbitrary functions to be embedded in a representation.
• But a price is paid in terms of efficiency, generality, and modularity !
• Inheritance can be easily controlled.
WHAT IS CONCEPTUAL GRAPHS
• A knowledge modeling approach based on semantic networks and first-order logic, first introduced by Sowa,
whereby knowledge is represented by concepts and relations linked together in a bipartite graph
• Conceptual graphs consist of a formal language to access knowledge and meaning.

• A conceptual graph is a graph or network of two kinds of nodes, concepts and relations.
• They have the full power of first-order logic and can represent model and higher-order logic.
• Conceptual graphs have a direct translation into natural language.
• Conceptual graphs (CGs) are a system of logic based on the existential graphs of Charles Sanders Peirce and the
semantic networks of artificial intelligence.
• They express meaning in a form that is logically precise, humanly readable, and computationally tractable. With
a direct mapping to language, conceptual graphs serve as an intermediate language for translating
computer-oriented formalisms to and from natural languages.
• With their graphic representation, they serve as a readable, but formal design and specification language
HIERARCHIES AND 10

INHERITANCE

● Hierarchy (or taxonomy) is a natural way to structure categories

● Importance of abstraction in remembering and reasoning


– groups of things share properties in the world
– we do not have to repeat definitions

● Example: saying ”elephants are mammals” is sufficient to know a lot about them

● Inheritance is the result of reasoning over paths in a hierarchy:


”does a inherit from b?”
is the same as
”is b in the transitive closure of :IS-A (or subsumption) from a?”
GRAPHICAL REPRESENTATION OF 11

INHERITANCE
● IS relations:

Clyde

Elephant

(category) Gray


(p roperty)

● Clyde is an Elephant, Elephant is Gray

● Reasoning with paths and conclusions they represent (”Transitive relations”)

● Transitive closure
Clyde is Elephant, Elephant is Gray ⇒ Clyde is Gray
STRICT 12

INHERITANCE

● Conclusions produced by complete transitive closure on all paths


(any traversal procedure will do)

● All reachable nodes are implied

Philipp Koehn
LATTICE STRUCTURE WITH 13

STRICT INHERITANCE

● Multiple AND (∧) parents (= multiple inheritance)

● Trees: all conclusions you can reach by any paths are supported

Philipp Koehn
DEFEASIBLE 14

INHERITANCE

● Inherited properties do not always hold, and can be overridden (defeated)

● Conclusions determined by searching upward from focus node


and selecting first version of property you want

Philipp Koehn

You might also like