CS 461D Dr Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer amp Information Systems Chapter7 Logical Agents Some General Representations Logical Representations ID: 720256
Download Presentation The PPT/PDF document "Artificial Intelligence" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Artificial Intelligence (CS 461D)
Dr. Abeer Mahmoud Computer science Department
Princess Nora University
Faculty of Computer & Information SystemsSlide2
(Chapter-7)
Logical AgentsSlide3
Some General Representations
Logical Representations
Production RulesSemantic Networks
Conceptual graphs,
frames, scripts
Description Logics
(not covered in this course )
3Slide4
Non-Logical Representations?
4Slide5
Non-Logical Representations?Production rules
Semantic networksConceptual graphsFrames
Scripts
5Slide6
Production Rules
6Slide7
Production RulesRule set of <condition,action
> pairs“if condition then action”Match-resolve-act cycleMatch: Agent checks if each rule’s condition holds
Resolve:Multiple production rules may fire at once (conflict set) Agent must choose rule from set (
conflict resolution
)
Act
: If so, rule “fires” and the action is carried
out7Slide8
8
Rules
If Animal has hair And Animal produces milk Then animal is a mammal
IF animal has feather,
THEN animal is bird.
IF animal flies,
AND animal lays eggs,
THEN animal is bird.
.Slide9
IF the interest-rate out look is down,
THEN do not buy money-market funds..
An apple a day keeps the doctor away .
A stitch in time saves nine .
Rules-of-Thumb
9Slide10
IF you’re
old,
THEN you have owned
several
homes .
Fuzzy Rules
IF you have owned
several
homes THEN you have had
numerous
headaches .
IF the interest-rate out look is
up
and the risk you can accept is
low
,
THEN buy a conservative money-market fund .
10Slide11
IF the interest-rate out look is
up and the risk you can accept is high,
THEN buy
aggressive
money-market fund .
IF the patient is sneezing,
AND has a runny nose,
AND has watery eyes,
THEN the patient has cold,
CF=0.5 .
Rules with certainty factors
11Slide12
Production Rules ExampleIF
(at bus stop AND bus arrives) THEN action(get on the bus
)IF (on bus
AND
not paid
AND
have oyster card)
THEN action(pay with oyster) AND add(paid)
IF
(on bus
AND
paid
AND
empty seat)
THEN
sit down
12Slide13
Inference Engine
The inference engine
is a generic control mechanism for navigating through and manipulating knowledge and
deduce results
in an organized manner
It applies a specific task take data and drive conclusions
The inference engine is the part of the system that chooses which facts and rules to apply when trying to solve the user’s querySlide14
Inference
Engine
The
forward chaining
,
backward chaining
and
tree search are some of the techniques used for drawing inferences from the knowledge base
Inferences from rules
Goal driven =
backward chaining
Data driven=
forward chaining Slide15
15
Goal driven or backward chaining
An inference technique which uses IF-THEN rules to repetitively break a goal into smaller sub-goals which are easier to proveSlide16
Example : KB contains Rule set : Rule 1: if A and C then F
Rule 2: if A and E then G
Rule 3: if B then E
Rule
4
:
if
G then DSlide17Slide18
Data driven or Forward chaining
An inference technique which uses IF-THEN rules to deduce a problem solution from initial data Slide19Slide20Slide21
Advantages of RulesRules are easy to understandInference and explanation are easy to derive
Modifications and maintenance are relatively easyUncertainty is easily combined with rulesEach rule is usually independent of all others
21Slide22
Graphical Representation
22Slide23
Graphical RepresentationGraphs easy to store in a computer
To be of any use must impose a formalism
Jason is 15, Bryan is 40, Arthur is 70, Jim is 74How old is Julia?
23Slide24
Semantic NetworksBecause the syntax is the sameWe can guess that Julia’s age is similar to Bryan’s
Formalism imposes restricted syntax
24Slide25
Semantic NetworksGraphical representation (a graph)
Links indicate subset, member
, relation, ...Equivalent to logical statements (usually FOL)Easier to understand than FOL?
Example
: natural language understanding
Sentences with same meaning have same graphs
e.g. Conceptual Dependency Theory (
Schank)
25Slide26
26Semantic Networks
In this scheme , knowledge is represented in terms of objects and relationships between objects The objects are denoted as nodes of a graph. The relationship between two objects are denoted as a link between the corresponding two nodes
The most common form of semantic network uses the link between nodes to represent IS-A and
HAS
relationships between objectsSlide27
Example of semantic network
27Slide28
APPEARANCE
APPEARANCE
ACTIVITY
APPENDANCE
ANIMAL
MAMMAL
BIRD
A-KIND-OF
A Semantic network for animal kingdom
A-KIND-OF
A-KIND-OF
CARNIVORE
SKIN COVER
ACTIVITY
SKIN COVER
ACTIVITY
ACTIVITY
HAIR
MILK PRODUCTION
FORWARD EYES
FORWARD TEETH
EATS MEAT
CLAWS
FEATHERS
FLYS
LAYS EGGS
28Slide29
Example of Semantic Network
head
animal
part of
bird
is a
fly
travel
feathers
covering
fish
is a
wings
part of
ostrich
is a
walk
travel
penguin
travel
is a
color
has
value
brown
canary
color
has
value
yellow
sound
sing
robin
covering
skin
is a
is a
sound
swim
travel
tweety
is a
color
white
has
value
color
has
value
red
opus
is aSlide30
Frames I
n this technique, knowledge is decomposed into highly modular pieces called frames, which are generalized record structuresKnowledge consist of
concepts, situation, attributes
of concepts ,
relationships
between concepts , and
procedure
to handle relationships
Each
concept
may be represented as a separate frame
The
attributes
, the
relationships
between concepts and the
procedures
are allotted to slots in a frame
The contents of a slot may be of any data type –
numbers
,
strings
,
functions
or
procedures
and so on
The frames may be linked to other frames, providing the same kind of inheritance as that provided by a semantic network
30Slide31
Frame RepresentationsSemantic networks where nodes have structure
Frame with a number of slots (age, height, ...)Each slot stores specific item of informationWhen agent faces a new situationSlots can be filled in (value may be another frame)
Filling in may trigger actionsMay trigger
retrieval
of other frames
Inheritance of properties between frames
Very similar to objects in OOP
31Slide32
FramesBasic frame design
Frame Name:
Class:
Properties:
Object1
Object2
***
***
***
***
Value2
Property2
Value1
Property1Slide33
Example: Frame Representation
33Slide34
Frame Representation of the “
animal
kingdom
”
MAMMAL
CARNIVORE
BIRD
A-KIND-OF ANIMAL
A-KIND-OF ANIMAL
A-KIND-OF ANIMAL
SKIN COVER HAIR
ACTIVITY PRODUCES
MILK
APPEARANCE FORWARD
EYES
POINTED
TEETH
APPENDGES CLAWS
ACTIVITY EATS
MEAT
SKIN COVER FEATHER
ACTIVITY FLY
LAYS EGGS
34Slide35
Example of Frame Based System
superclass: vehicle
reg. number
producer
model
owner
truck
class: vehicle
reg. number
producer
model
owner
tonnage
part of
basket
car
class: vehicle
reg. number
producer
model
owner
number
of doors
4
horse-power
John’s
car
class: car
reg. number
LV97
producer
BMW
model
520
owner
John
number
of doors
2
horse-power
150
basket
dimensions
2*3*1.5
material
tin
John
age
22
length of driving
2Slide36
36Chair frame Slide37
Flexibility in FramesSlots in a frame can containInformation for choosing a frame in a situation
Relationships between this and other framesProcedures to carry out after various slots filledDefault information to use where input is missingBlank slots: left blank unless required for a taskOther frames, which gives a hierarchy
37Slide38
Thank you
End of Chapter 7- part2
38