0% found this document useful (0 votes)
124 views88 pages

Artificial Intelligence - KR

The document discusses artificial intelligence and knowledge-based systems. It covers: 1) The first expert system MYCIN from 1970 and problems in developing knowledge-based systems like knowledge representation, memory organization, and knowledge manipulation. 2) Knowledge-based systems have four phases - knowledge representation, organization, manipulation, and acquisition. 3) Knowledge representation involves representing knowledge in different forms like text, images, rules. Knowledge organization and manipulation involve indexing knowledge for easy retrieval and reasoning.

Uploaded by

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

Artificial Intelligence - KR

The document discusses artificial intelligence and knowledge-based systems. It covers: 1) The first expert system MYCIN from 1970 and problems in developing knowledge-based systems like knowledge representation, memory organization, and knowledge manipulation. 2) Knowledge-based systems have four phases - knowledge representation, organization, manipulation, and acquisition. 3) Knowledge representation involves representing knowledge in different forms like text, images, rules. Knowledge organization and manipulation involve indexing knowledge for easy retrieval and reasoning.

Uploaded by

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

Artificial Intelligence

Knowledge Based System


• 1970 the first expert system MYCIN – the
system to diagnose blood diseases
• The following problems are faced in
development of knowledge based system
– Knowledge representation
– Memory organization
– Manipulation of knowledge
• The power of expert system is the
knowledge that has been coded into facts,
rules, heuristic, and procedure
Knowledge Based System
Interface control
I/O unit Unit Knowledge base
(Interface engine)
Four Phases
• Knowledge Representation
• Knowledge Organization
• Knowledge Manipulation
• Acquisition of Knowledge
Knowledge Representation
• Knowledge consists of
– Facts, concepts, rules etc.
• Knowledge can be represented in different
forms
– Mental images, thoughts, spoken or written
words, graphical or some other pictorial form
Knowledge Representation
• Different levels of knowledge representation

Mental Images

Written Text

Character Strings

Binary

Magnetic spot
Knowledge Organization
• The organization of knowledge in memory
is known as knowledge organization
• It is necessary to retrieve the rules, facts
etc. easily
• Knowledge can be organized in memory
for easy access by method known as
indenxing.
Knowledge Manipulation
• The knowledge manipulation is the
computational equivalent of reasoning.
• This requires a form of inference or deduction
using the knowledge and inferring rules
• Some form of input (keywords) will initiate a
search for a goal or decision. This requires that
known facts in the knowledge-base be located,
compared (matched), and possibly altered in
some way.
Acquisition of Knowledge
• The great bottleneck in building knowledge
in rich systems is the acquisition and
validation of the knowledge can come from
various source, such as expert, textbooks,
reports, technical articles etc.
• To be useful, the knowledge must be
accurate, presented at the right level for
encoding, complete in the sense that all
essential facts and rules are included.
Symbolic Knowledge
• First order predicate logic (FOPL) / predicate
calculus has one of the important way of
knowledge representation.
• FOPL is important because
– Logic offers the only formal approach to
reasoning that has a sound theoretical
foundation. (this is important to attempt to
mechanize or automate the reasoning process
should be correct and logical)
Symbolic Knowledge
– The structure of FOPL is flexible enough to
permit the accurate representation of natural
language reasonably well. (This is required
because most of the knowledge used in AI is
generated and used by human)
– FOPL is widely used by researchers
• Logic is a formal method for reasoning.
• Many concepts which can be verbalized
can be translated into symbolic
representation which closely approximate
the meaning of the concept.
Symbolic Knowledge
• The symbolic structure can then be
manipulated in program to deduce various
facts to carry out a form of automated
reasoning.
• In FOPL , statements from natural
language are translated into symbolic
structure consists of predicates, functions,
variables, constants, qualifiers, and logical
connectives.
Symbolic Knowledge
• The symbol from the basic building blocks for
the knowledge and their combination into valid
structure is accomplished using the syntax.
• Once structure have been created to represent
basic facts or procedure or other type of
knowledge, inference rules may then be applied
to compare, combine and transform these
structures into new deduced structure.
• This is how automatic reasoning or inferring is
performed
Symbolic Knowledge
• Example
“All employees of the XYZ-Software
Company are programmers”
(Vx) (XYZ-co-employee)  programmer (x)

“It is known that Jim is an employee of XYZ-


company
XYZ-co-employee (Jim)

therefore
Programmer (Jim)
Syntax of Propositional Logic (PL)
• Valid Statements or sentences in PL are
determined according to the rules of
propositional syntax.
• Syntax governs the combination of basic
building blocks such as propositions and logical
connectives.
• Propositions are elementary atomic sentences,
also known as formulas or wel-defined formulas
• Propositions may be true or false but do not take
any other value
Examples of propositions
• Simple propositions
– Sun is rising from east
– Colour of my car is golden
– Sachin and Anjali are husband and wife
• Compound propositions are formed from
atomic formulas using logical connectives
not, and, or, if .. Then, if and only if
– It is raining and wind is blowing
– Sunday or Monday is holiday
– If you work hard then you will get good marks
Syntax of PL (cont…)
• Capital letters are used to form
propositions
• T and F are special symbols having values
true and false respectively
• ~ is used for not or negation
• & stands for and or conjunction
• V stands for or or disjunction
 is for if ..then or implication
  is for if and only if or double implication
Syntax of PL (cont…)
• T and F are formulas
• If P and Q are formulas then
– (P)
– ( P & Q)
– (P V Q)
– (P Q)
– (P Q)
Are the symbolic formulas
• All other formulas are generated by finite
number of above operations
Syntax of PL (cont…)
• A compound formula
– (P & (~QVR)  S)
• The precedence rule from highest to
lowest is
–~
– &
–V


Semantics
• The semantics that is meaning of a
sentence is just the value true or false.
• That is semantic is an assignment of a
truth value to the sentence
• An interpretation for a sentence or group
of sentences is an assignment of a truth
value to each propositional symbols
• Give proper interpretation to statements
(P & ~Q)
Semantics (Contd)
• Once an interpretation is assigned its truth
value can be determined
• This is done by repeated application of
semantic rules to larger and larger parts of
statement until a single truth value is
determined
Semantics Rules
• t and t’ are any true statements and f and f’ are
any false statements
• a is any statement
Then semantic rules are
Rule number True Statements False Statements
1 t f
2 ~f ~t
3 t & t’ f&a
4 tVa a&f
5 aVt fVf’
6 at tf
7 fa tf
8 tt’ ft
9 ff’ -
Example
• P is true, Q is false and false to R
((P & ~Q)  R ) V Q)
1.Rule 2 : ~Q is True
2.Rule 3 : T & T is true
3.Rule 6 : T  f is false
4.Rule 5 : f V F is false
Thus interpretation of a compound statement
is false
Properties of Statements
• Satisfiable : a sentence is satisfiable if
there is some interpretation for which it is
true
• Contradiction : A sentence is contradictory
(unsatisfiable) if there is no interpretation
for which it is true
• Valid : A sentence is valid if it is true for
every interpretation
Properties of Statements
• Equivalence : Two sentences are
equivalent if they have the same truth
values under every interpretation
• Logical Consequence : A statement is
logical consequence of other if it is
satisfied by all interpretations which satisfy
the first.
Inference Rules
• The inference rule provides the means to
perform logical proofs or deductions.
• That means inference rule provides logical
conclusions
• Modus Ponens : From P and PQ infer Q
P given : (Sachin is a father)
P  Q and (Sachin is a father) 
(Sachin has a child)
Q conclusion : (Sachin has a child)
Inference Rules
• Chain Rule : From P  Q and Q  R infer
PR

Given : X likes JAVA  X does not likes C


and : X does not likes C  X likes OOPL
Conclusion :

X likes JAVA  X likes OOPL


Inference Rules
• Substitution : If s is a valid sentence, s’
derived from s by consistent substitution in
s, is also valid.

If sentence P V ~P is valid: therefore


Q V ~Q is also valid by substitution rule
Inference Rules
• Simplification : P & Q infers P
• Conjunction : From P and From Q infers P&Q
• Transposition : From P  Q infer
~Q  ~P
• Formal System : A formal system is a set of
axioms S and a set of inference rules L, from
which new statements can be logically derived.
It is denoted by <S,L> and also known as
knowledge base
Inference Rules
• Soundness : Let <S,L> be a formal
system. Then the inference procedure L
are sound if and only if any statements s
that can be derived from <S,L> and is a
logical consequence of <S,L>
• Completeness : Let <S,L> be a formal
system. Then the inference procedure L is
complete if and only if any sentence s
logically implied by <S,L> can be derived
using that procedure
First Order Predicate Logic
• For KR expressiveness is one of the
important requirements.
• It is difficult to express every verbal facts
properly using propositions
• FOPL is an extension of expression of PL
• FOPL permits reasoning about world objects
as relational entities as well as classes or
subclasses of objects
• This is can be done by using predicates
instead of propositions
FOPL
• In predicates we can make use of functions,
variables and variable quantifiers.
• Like proposition logic FOPL is determined
by the allowable symbols and rules of
connections
• The semantics of FOPL are determined by
interpretations assigned to predicates,
rather than propositions.
Syntax for FOPL
• Connectives : All the connectives used in PL, that is ~,
&, V,  and  are used with FOPL
• Quantifiers : There are two quantifiers
  existential quantifier
  universal quantifier
 x means for some x or there exists an x
 x means for all x
 xyz quantifies more than one variables at a time
– Constants : Constants are fixed-value terms that
belongs to a given domain
• They are denoted by numbers, words, and small letters
Syntax for FOPL
• Variables : Variables are terms that can
assume different values over a given domain.
– They are denoted by words and small letters for
example vehicle-type
• Functions : Function symbols denote
relations defined on domain D. They map n
elements (n>=0) to a single element of a
domain. F(x1,x2,..xn).
– A 0ary function a constant
Syntax for FOPL
• Predicates : Predicate symbols denote
relations or functional mapping from the
elements of a domain D to the values true or
false.
– Capital letters and capitalized words such as P,Q,
EQUAL, BROTHER etc are used to represent
predicates.
– Like functions predicates may have n (n>=0)
terms for arguments
– A 0ary predicate is a proposition.
Example
• E1 : All employees earning Rs. 2,50,000
or more per year pay taxes
E2 : Some employees are sick today
E3 : No employee earns more than the
president
Example Cont…
• Predicates
– Employee(x)
– President(x)
– Income(x)
– Greater(,)
– Sick(x)
– Tax(x)
Example Cont…
• E1’ : (x) ((Employee(x) &
Greater(income(x),250000)) 
Tax(x)
E2’ : y (Employee(y)  Sick(y))
E3’ : xy (Employee(x) & President(y)) 
Greater(income(x),income(y))
• Expressions E1’, E2’. E3’ are known as
well formed formulas (wffs)
unification
• Any substitution that makes two or more
expressions equal is called a unifier for
that expression.
• Applying a substitution to an expression
produces an instance
Remember
• Thus the most important things to
remember while KR are
– Expressiveness
– Validity
– Consistency
and
– Inference Methods
An Example
• Profession(Sachin, Cricketer)
• Player(Sachin, Right hand)
• Married(Sachin, Anjali)
• Father-of(Sachin, Arjun, Sara)
• Drives(Sachin, BMW)
• Own(Sachin, Bunglow)
Observations
• Above information is entered in the
knowledgebase
• There is no particular grouping associated with
them
• To represent various facts about Sachin, it is
necessary to repeat Sachin’s name for each
association given.
• All facts appear independent without any linkage
to other facts, even though they may be closely
related
Facts about example
• For small problem this form (FOPL) is very
convenient to handle and manage
knowledge
• It is easy, if KB is small, to add delete,
change knowledge or fact
• When the quantity of information becomes
large and more complex the acquisition,
comprehension, use, and maintenance of
knowledge can become difficult
Real World problems
• Most of the real world problem domains
typically involve
– Number of variety of different objects
– These objects are interactive with each other in
different ways
– The objects required extensive characterization
– The interaction between object is also very
complex
• To handle this structured KR is required
Structured KR Methods
• Associative Network (Semantic Network)
• Conceptual Graphs
• Frames
• Scripts
Associative Network
• Associative networks are directed graphs
with labeled nodes and arcs or arrows
• The language used in constructing a
network is based on selected domain
primitives Run

Can

Properties
A-Kind-of Colour
Object Animal Dog Brown

Has
Tail
Syntax and Semantics of Associative
Network
• There is no formal way and rules for the syntax
and semantics for associative network
• Syntax for any given system is determined by
the object and relation primitive chosen by any
special rules used to connect nodes.
• Schubert & Cercone (1979), Shapiro (1979),
Brachman(1979) are the people who made
attempts to define rules for associative network.
Syntax and Semantics of Associative
Network
• The language of associative network is
formed from letters of alphabets (lower
and uppercase), Relational symbols, set
membership and subset symbols (,),
decimal digits, square and oval nodes, and
directed arcs.
• Nodes are used for objects and nouns and
arcs are used for relationships
Syntax and Semantics of Associative
Network
• For example

Has-a
Sachin Ferrari

• Some of the common relationships are


member-of, subset-of, AKO(A kind of),
Has-a, instance-of, agent, attribute etc..
Syntax and Semantics of Associative
Network
• Less common relationships
– Modality relationship : time, manner, mood
– Linguistics relationships : theme, source, goal
– Logical relationship : or, and, not , implies,
– Quantifiers : all, some
– Set relationships : superset, subset, members
– Attribute
– Quantification : ordinal, count
ISA relationship
• ISA is a special kind of relationship
• It represents fact that an object is of a
certain type (Predication) or to express the
fact one type is a subtype of another
(coordinal or quantifier)
For example
– Sachin is a cricketer
– VNGSU is state university
ISA relationship
• Brachman (1973, 1983) suggested an
interesting description of ISA relationship /
predicate is used to exhibit

– Generic – Generic relationship


– Generic – individual relationship
Generic – generic (isa)
• Subset – superset
– Cricket – Sport
• Generalization – specialization
– Restaurant – Italian
• AKO ( a kind of)
– Shark is a kind of Fish
• Conceptual Containment
– Square is a polygon
• Sets and their types
– a rabbit AND a set of rabbits
• Role value restriction
– Elephant trunk is a cylinder, 1.3 mtrs in length
Generic – Individual (isa)
• Set membership
– Chetak is a horse
• Predication
– White(dog)
• Conceptual containment
– King AND king of BAGDAD
• Abstraction
– “elephant” in “Elephant is a huge animal”
Budget State Policy

State Uni. ISA Institute of


System higher Edu..
 
VNSG
SPU
U
 

Sci. College Eng. Col.


 

E&C Comp. Eng. Location


Eng. Build.
Dept Dept.

Married To ISA
Sachin
Anjali Own Drives Prof.

House SX4
Conceptual Graph
• A conceptual graph is a graphical
representation of mental perception which
consist of basic of primitive concepts and
the relationships that exits between the
concepts.
• A conceptual graph is graphical
representation of natural language
sentence where the words are depicted
with concepts and relationships
Conceptual Graph
• Conceptual graph may be considered as a
formal building blocks for associative
networks which then linked together in
coherent way.
• In conceptual graph the concepts are
enclosed in boxes
• relations are enclosed in ovals.
• The last point is a circle relationship
Conceptual Graph
• “Smit is eating Soup with a spoon”

Person : Smit Agent eat Object Food : Soup

Instrument

Soup
Conceptual Graph
• A concept in conceptual graph may be
individual or generic
• Individual concepts have a type field
followed by a referent field
– [Person : Smit]
• As Smit and soup are specific entities they
are called individual concepts
• Spoon and eat do not have referent field
since they are generic concepts
Conceptual Graph
• Linear form of conceptual graph
[Person : Smit]  (Agent) [Eat] -
(object)  [Food : Soup]
(Instrument) [Spoon]
Here square brackets have replaced
concept boxes and parentheses have
replaced relationships
Syntax of Conceptual Graph
• Upper and lower cases alphabets
• Boxes and Circles
• Directed arcs
• Special symbols -, ?, !, *, #, @, , , ,
[, etc…

Can be used
Syntax of Conceptual Graph
• - (dash) is used for continuation to the next line
• ? Is used for query for any referent field
[House:?]
• ! Is used for emphasis to draw attention to a
concept
• * signifies variable of specified object
[House :*x] this means some house
• # specifies definite article [House : #123] specific
house number 123
Syntax of Conceptual Graph
• @ is used for quantification [House @n] means
n houses
• ~ is used for negation
• “ delimit literal string
• Colon, brackets, parentheses and directed arc
for construction of conceptual graph
Conceptual Graph to FOPL
• Conceptual graphs and FOPL both are
logical system and therefore it is easy to
map from one representation to another
representation
• Conversion requirs unique variable names
to be assigned to every generic concept of
the graph.
– For Example EAT and FOOD must be assigned
two variable names x, and y respectively
Conceptual Graph to FOPL
• All types of labels such as person, food are
converted to predicates which their names
• Conceptual relations like AGENT, OBJECT,
INSTRUMENT etc. are converted to predicates
with as many arguments as there are arcs
connected to the relation
• Concepts referents becomes constants
– For example Smit, and Soup
• Make use of appropriate quantifies
Conceptual Graph to FOPL
• An Example
“Every Car has an Engine”

Conceptual Graph
[CAR : ]  (part) [Engine]

FOPL
x y(car(x)  (engine(y) & part(x,y)))
Frame Structure
• Introduced by Marvin Minsky (1975) as a data
structure to represent mental mode of a
stereo type situation like driving a car,
attending a meeting etc..
• In frames knowledge about an object or event
is stored together in memory as a unit.
• It is a general record type structure which
consists of collection of slots and slot values
Frame Structure
• Slots may be of any size and type
• Slots typically have names and values or subfields
called facets
• Facets may also have names and any number of
values
• Slots in the frame specifies general or specific
characteristics of the entity for which
• Generally slot contains information such as
attribute value pairs, default values, pointer to
other related frames etc.
Frame Structure
• General Form
( <Frame-name>
(<slot1> (<facet1><value1><value2>..<value n>)
(<facet2><value1><value2>..<value n>)
….)
………….
(<slot2> (<facet1><value1><value2>..<value n>)
(<facet2><value1><value2>..<value n>)
….)
)
Frame Structure
• Particular Example
(Sachin
(Profession(Value Cricketer))
(Age(Value 33))
(Wife(Value(Anjali))
(Children(Value Arjun, Sara))
(Adress (Street (Value 16))
(City (Value Mumbai))
(State (Value Maharashtra))
(Pin (Value 123456)) )
Frame Structure
• Like associative Network frames are also
linked together in a network through the
use of special pointers such as AKO (A
kind of)
• Hierarchy of frames have subtype –
subtype or generic-instance relationships
• This makes property inheritance and
reasoning easy
Frame Structure
Transport :
Source : XYZ
Destination : abc

Public Conveyance : Private Conveyance :


Reservation : ----- Plan : -----
Package : ----------- Route : -----------

Air Land Sea Air Land Sea


Transport Transport Transport Transport Transport Transport

Bus Train Car


Scripts
• The script was introduced by Roger Schank
(1977)
• Scripts are mainly used for representing
commonly occurring events.
• They were basically developed to capture
the meaning of story or to understand the
natural language.
• A script is a predefined frame like structure
which contains expectations, inferences,
and other that is relevant to a situation.
Scripts
• Conceptual Dependencies
The conceptual dependencies are the
primitives and related rules used in
building scripts.

– CD theory is based on the use of a limited


number of primitive concepts and rules of
information to represent any natural language
statement.
Conceptual Dependencies
• Different sentences which have the same
meaning should have the same unique CD
representation.
• There are five ontological building blocks
– Entities
– Actions
– Conceptual Cases
– Conceptual Dependencies
– Conceptual Tenses
Conceptual Dependencies
• Entities
– Entities are the Picture Procedures (PP)
which are actors or Physical Objects
(including Human Memory) that perform
different act. Picture Aider (PA) are supporting
properties or attributes of producers.
Conceptual Dependencies
• Actions (ACT)
– ATRANS : Transfer of an abstract entities
– ATTEND : Focusing attention on an object
– CONC : To think about something
– EXPEL : Expulsion of anything front the body
– GRASP: Grasping or holding an object tightly
– INGEST : Ingesting something
– MBUILD : Building on information
– MOVE : Moving a part of a body
– MTRANS : Transfer of mental information
– PROPEL : Application of Force
– PTRANS : Physical transfer from one location to other
– SPEAK : Emitting a sound
Conceptual Dependencies
• Conceptual Cases
All actions involving one or more of the
following.

– Objective Case
– Directive Case
– Instrumental Case
– Recipient Case
Conceptual Dependencies
• Conceptual Dependency
– It is semantic rules for the formation of
dependency structures such as the
relationship between an actor and an event or
between a primitive action and an instrument.
PP  ACT Bird  PTRAN Bird Flew
PP  PP Joe  Student Joe is a student

PP Sachin
ACT  ATRAN
Sachin
PP Anjali
Flower
Sachin gave Anjali a Flower
Conceptual Dependencies
• Conceptual Tenses
– Conditional (c)
– Continuing (k)
– Finished Transition (tf)
– Future (f)
– Interrogative (?)
– Negative(/)
– Past(p)
– Present (nil)
– Start Transition (ts)
– Timeless (delta)
– Transition (t)
Conceptual Dependencies
• Conceptual structure in the form of a
graph are used to represent the meanings
of different Languages
• It is language independent
• The graphs are constructed from
elementary structures in accordance with
basic syntax rules
Conceptual Dependencies
• Syntax Rules
– PP ACT : Some PP perform primitive action
– PP PA : PP have attribute
– ACT  O  PP : Primitive action has object

PP
– ACT R Primitive actions have recipient

PP
LOC
– ACT D Primitive actions Direction
LOC
Conceptual Dependencies
• T : Conceptualizations have times
• LOC : Conceptualizations have location

• ACT I  : Primitive actions have


instruments
Scripts
• Scripts are frame-like structures used to
represent commonly occurring
experiences such as going to the movies,
shopping in a supermarket, eating in
restaurant.
Example
• Script - Food Market
Track - Supermarket
Roles - Shopper
Seafood Attendant
Checkout clerk
Sacking clerk
Other shoppers
Example
Entry Condition – Shopper needs groceries
Food Market is open
Props - Shopping Cart
Display aisles
Market items
Checkout Stand
Cashier
Money
Example
• Scene 1 - Enter Market
Shopper PTRANS shopper into Market
Shopper PTRANS shopping-cart to shopper

• Scene 2 - Shop for item


Shop for item
Shopper MOVE shopper through aisles
Shopper PTRANS items to shopping cart
Example
• Results - Shopper has less money
shopper has grocery items
market has less grocery items

You might also like