0% found this document useful (0 votes)
148 views17 pages

Scsa1702 - Ai - Unit V

The document provides an introduction to artificial intelligence including: 1) Four approaches to AI - systems that think like humans, think rationally, act like humans, and act rationally. 2) What AI can do today including autonomous planning, game playing, diagnosis, robotics, and language understanding. 3) Searching techniques used in AI problems including defining a problem with states, successor functions, goal tests, and path costs. The 8-puzzle is provided as an example problem.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
148 views17 pages

Scsa1702 - Ai - Unit V

The document provides an introduction to artificial intelligence including: 1) Four approaches to AI - systems that think like humans, think rationally, act like humans, and act rationally. 2) What AI can do today including autonomous planning, game playing, diagnosis, robotics, and language understanding. 3) Searching techniques used in AI problems including defining a problem with states, successor functions, goal tests, and path costs. The 8-puzzle is provided as an example problem.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

UNIT:V

ARTIFICIAL INTELLIGENCE 10 hrs. Introduction – Searching techniques – First order Logic –


Forward reasoning – Backward reasoning – Semantic – Frames.

1.1 Introduction

What is artificial intelligence?

Artificial Intelligence is the branch of computer science concerned withmaking computers


behave like humans.
JohnMcCarthy, who coined the term in 1956, defines it as "the science and engineering ofmaking
intelligent machines, especially intelligent computer programs." The definition of AI is categorized
into four approaches which is shown in the table below.

Systems that think like humans“The Systems that think rationally


exciting new effort to make computers “The study of mental faculties through the
think as if machines with minds, in the use of computer models.”
full and literal sense.”(Haugeland,1985) (Charniak and McDermont,1985)

Systems that act like humans Systems that act rationally


The art of creating machines that “Computational intelligence is the
performfunctionsthat require studyofthedesignofintelligentagents.”(Poole
intelligence when performed by
et al.,1998)
people.”(Kurzweil,1990)

The four approaches in more detail are as follows :


(a) Acting humanly : The Turing Test Approach
o Test proposed by Alan Turing in 1950
o The computer is asked questions by a human interrogator.
The computer passes the test if a human interrogator, after posing some writtenquestions, cannot tell
whether the written responses come from a person or not.Programming a computer to pass , the
computer need to possess the followingcapabilities :

 Natural language processing to enable it to communicate successfully in English.


 Knowledge representation to store what it knows or hears.
 Automated reasoning to use the stored information to answer questions and to draw
new conclusions.
 Machine learning to adapt to new circumstances and to detect andextrapolate patterns

To pass the complete Turing Test, the computer will need


Computer vision to perceive the objects, and
Robotics to manipulate objects and move about.

Problem: Turing test is not reproducible, constructive, or amenable to mathematicalanalysis.


b) Thinking humanly : The Cognitive Modeling Approach
A machine program is constructed to think like a human but for that we need to get inside actual
working of the human mind :
(a) through introspection – trying to capture our own thoughts as they go by;
(b) through psychological experiments
Eg. Allen Newell and Herbert Simon, who developed GPS, the “GeneralProblem Solver” tried to
trace the reasoning steps to traces of human subjects solvingthe same problems.
The interdisciplinary field of cognitive science brings together computermodels from AI and
experimental techniques from psychology to try to constructprecise and testable theories of the
workings of the human mind. In 1960s CognitiveRevolution: information-processing psychology
replaced prevailing orthodoxy ofbehaviorism.
It Requires scientific theories of internal activities of the brain :-
* What level of abstraction? – “Knowledge" or circuits"?
* How to validate? - Requires
1) Predicting and testing behavior of human subjects (top-down)
or 2) Direct identification from neurological data (bottom-up)

(c) Thinking rationally: The “Laws of Thought Approach”


It is Normative (or prescriptive) rather than descriptive
The Greek philosopher Aristotle was one of the first to attempt to codify“right Thinking” that is
irrefutable reasoning processes. His syllogism providedpatterns for argument structures that always
yielded correct conclusions when givencorrect premises—for example, ”Socrates is a man; all men
are mortal; thereforeSocrates is mortal.”. These laws of thought were supposed to govern the
operationof the mind; their study initiated a field called logic.
Problems:
1) Not all intelligent behavior is mediated by logical deliberation
2) What is the purpose of thinking? What thoughts should I have out of all thethoughts (logical or
otherwise) that I could have?
(d) Acting rationally : The Rational Agent Approach
Rational behavior: doing the right thing
The right thing: that which is expected to maximize goal achievement, giventhe available
information.
Doesn't necessarily involve thinking (e.g.) blinking reflex - thinking should bein the service of
rational action
An agent is something that acts. Computer agents are not mere programs ,butthey are expected to
have the following attributes also : (a) operating underautonomous control, (b) perceiving their
environment, (c) persisting over a prolongedtime period, (e) adapting to change.
A rational agent is one that acts so as to achieve the best outcome.

What can AI do today?


Autonomous planning and scheduling:
Ahundred million miles from Earth, NASA's Remote Agent program becamethe first on-board
autonomous planning program to control the scheduling ofoperations for a spacecraft (Jonsson et al.,
2000). Remote Agent generated plans fromhigh-level goals specified from the ground, and it
monitored the operation of thespacecraft as the plans were executed-detecting, diagnosing, and
recovering fromproblems as they occurred.

Game playing:
IBM's Deep Blue became the first computer program to defeat the worldchampion in a chess match
when it bested Garry Kasparov by a score of 3.5 to 2.5 inan exhibition match (Goodman and Keene,
1997).
Diagnosis:
Medical diagnosis programs based on probabilistic analysis have been able toperform at the level of
an expert physician in several areas of medicine.
Robotics:
Many surgeons now use robot assistants in microsurgery. HipNav (DiGioia etal., 1996) is a system
that uses computer vision techniques to create a three-dimensional model of a patient's internal
anatomy and then uses robotic control toguide the insertion of a hip replacement prosthesis.
Language understanding and problem solving:
PROVERB (Littman et al., 1999) is a computer program that solves crosswordpuzzles better than
most humans, using constraints on possible word fillers, a largedatabase of past puzzles, and a variety
of information sources including dictionariesand online databases such as a list of movies and the
actors that appear in them.
Searching Techniques

Problem and Solution


A problem can be formally defined by four components:
1) The initial state that the agent starts in .
2) A Successor Function returns the possible actions available to the agent.Given a state x,
SUCCESSOR-FN(x) returns a set of {action, successor}ordered pairs where each action is one of the
legal actions in state x, and eachsuccessor is a state that can be reached from x by applying the action.
i)State Space: The set of all states reachable from the initial state. The statespace forms a graph in
which the nodes are states and the arcs between nodes areactions.
ii) A path in the state space is a sequence of states connected by a sequence ofactions.
3) Goal Test : It determines whether the given state is a goal state. Sometimesthere is an explicit set of
possible goal states, and the test simply checks whether thegiven state is one of them. For example, in
chess, the goal is to reach a state called"checkmate," where the opponent's king is under attack and
can't escape.
4) Path Cost : A path cost function assigns numeric cost to each action.
(a) The step cost of taking action a to go from state x to state y is denoted byc(x,a,y). It is assumed
thatthe step costs are non negative.
(b) A solution to the problem is a path from the initial state to a goal state.
(c) An optimal solution has the lowest path cost among all solutions.

Example
The 8-puzzle
An 8-puzzle consists of a 3x3 board with eight numbered tiles and a blank space. Atile adjacent to the
blank space can slide into the space. The object is to reach thegoal state ,as shown in figure 5.1
Example: The 8-puzzle

Figure 5.1 A typical instance of 8-puzzle.


The problem formulation is as follows :
o States : A state description specifies the location of each of the eight tiles andthe blank in one of the
nine squares.
o Initial state : Any state can be designated as the initial state. It can be notedthat any given goal can
be reached from exactly half of the possible initialstates.
o Successor function : This generates the legal states that result from trying thefour actions(blank
moves Left, Right, Up or down).
o Goal Test : This checks whether the state matches the goal configuration.
o Path cost : Each step costs 1,so the path cost is the number of steps in the path.

The 8-puzzle belongs to the family of sliding-block puzzles, which are oftenused as test problems for
new search algorithms in AI. This general class isknown as NP-complete.
The 8-puzzle has 9!/2 = 181,440 reachable states and is easily solved.
The 15 puzzle (4 x 4 board ) has around 1.3 trillion states, an the randominstances can be solved
optimally in few milli seconds by the best searchalgorithms.
The 24-puzzle (on a 5 x 5 board) has around 1025 states ,and random instancesare still quite
difficult to solve optimally with current machines and algorithms.

REAL-WORLD PROBLEMS
AIRLINE TRAVEL PROBLEM
The airline travel problem is specifies as follows :
o States: Each is represented by a location(e.g., an airport) and the currenttime.
o Initial state: This is specified by the problem.
o Successor function: This returns the states resulting from taking anyscheduled flight (further
specified by seat class and location),leaving laterthan the current time plus the within-airport transit
time, from the currentairport to another.
o Goal Test : Are we at the destination by some pre specified time?
o Path cost: This depends upon the monetary cost, waiting time, flight time,customs and immigration
procedures, seat quality, time of dat, type of airplane, frequent-flyer mileage awards, and so on.

1.2 Searching Techniques


Breadth-first search
Breadth-First search(BFS) is like traversing a tree where each node is a state which may be a
potential candidate for solution. It expands nodes from the root of the tree and then generates one
level of the tree at a time until a solution is found. It is very easily implemented by maintaining a
queue of nodes. Initially the queue contains just the root. In each iteration, node at the head of the
queue is removed and then expanded. The generated child nodes are then added to the tail of the
queue.
Breadth-first search is useful when
 space is not a problem.
 you want to find the solution containing the fewest arcs.
 few solutions may exist, and at least one has a short path length.
 infinite paths may exist, because it explores all of the search space, even with infinite paths.

ALGORITHM: BREADTH-FIRST SEARCH

1.Create a variable called NODE-LIST and set it to the initial state.


2.Loop until the goal state is found or NODE-LIST is empty.
a. Remove the first element, say E, from the NODE-LIST. If NODE-LIST
was empty then quit.
b. For each way that each rule can match the state described in E do:

i) Apply the rule to generate a new state.


ii) If the new state is the goal state, quit and return this state.
iii) Otherwise add this state to the end of NODE-LIST

Since it never generates a node in the tree until all the nodes at shallower levels have been
generated, breadth-first search always finds a shortest path to a goal. Since each node can be
generated in constant time, the amount of time used by Breadth first search is proportional to the
number of nodes generated, which is a function of the branching factor b and the solution d. Since the
number of nodes at level d is bd, the total number of nodes generated in the worst case is b + b 2 + b3 +
… + bd i.e. O(bd) , the asymptotic time complexity of breadth first search.

Breadth First Search

Look at the above tree with nodes starting from root node, R at the first level, A and B at the second
level and C, D, E and F at the third level. If we want to search for node E then BFS will search level
by level. First it will check if E exists at the root. Then it will check nodes at the second level. Finally
it will find E a the third level.

ADVANTAGES OF BREADTH-FIRST SEARCH

1.Breadth first search will never get trapped exploring the useless path forever.
2.If there is a solution, BFS will definitely find it out.
3.If there is more than one solution then BFS can find the minimal one that requires less
number of steps.

DISADVANTAGES OF BREADTH-FIRST SEARCH 

1.The main drawback of Breadth first search is its memoryrequirement. Since each level of the
tree must be saved in order to generate the next level, and the amount ofmemory is
proportional to the number of nodes stored, the space complexity of BFS is O(b d).
2.If the solution is farther away from the root, breath first search will consume lot of time.

Depth First Search(DFS) 

Depth First Search (DFS) searches deeper into the problem space. Breadth-first search always
generates successor of the deepest unexpanded node. It uses last-in first-out stack for keeping the
unexpanded nodes. Depth-first search is implemented recursively, with the recursion stack taking the
place of an explicit node stack.

ALGORITHM: DEPTH FIRST SEARCH

1.If the initial state is a goal state, quit and return success.
2.Otherwise, loop until success or failure is signaled.
a) Generate a state, say E, and let it be the successor of the initial state. If there is no successor, signal
failure.
b) Call Depth-First Search with E as the initial state.
c) If success is returned, signal success. Otherwise continue in this loop.

ADVANTAGES OF DEPTH-FIRST SEARCH

 The advantage of depth-first Search is that memoryrequirement is only linear with respect to the
search graph. This is in contrast with breadth-first search which requires more space. The reason is
that the algorithm only needs to store a stack of nodes on the path from the root to the current node. 

 The time complexity of a depth-first Search to depth d is O(b^d) since it generates the same set of
nodes as breadth-first search, but simply in a different order. The depth-first search is time-limited
rather than space-limited.  

 If depth-first search finds solution without exploring much in a path then the time and space it takes
will be very less.

DISADVANTAGES OF DEPTH-FIRST SEARCH

 The disadvantage of Depth-First Search is that there is a possibility that it may go down the left-most
path forever. Even a finite graph can generate an infinite tree. One solution to this problem is to
impose a cutoff depth on the search. Although the ideal cutoff is the solution depth d and this value is
rarely known in advance of actually solving the problem. If the chosen cutoff depth is less than d, the
algorithm will fail to find a solution, whereas if the cutoff depth is greater than d, a large price is paid
in execution time, and the first solution found may not be an optimal one.

 Depth-First Search is not guaranteed to find the solution.

 And there is no guarantee to find a minimal solution, if more than one solution exists.

Bidirectional Search
It searches forward from initial state and backward from goal state till both meet to identify a
common state.

The path from initial state is concatenated with the inverse path from the goal state. Each search is
done only up to half of the total path.

Uniform Cost Search


Sorting is done in increasing cost of the path to a node. It always expands the least cost node. It is
identical to Breadth First search if each transition has the same cost.

It explores paths in the increasing order of cost.

Disadvantage − There can be multiple long paths with the cost ≤ C*. Uniform Cost search must
explore them all.

Iterative Deepening Depth-First Search


It performs depth-first search to level 1, starts over, executes a complete depth-first search to level 2,
and continues in such way till the solution is found.

It never creates a node until all lower nodes are generated. It only saves a stack of nodes. The
algorithm ends when it finds a solution at depth d. The number of nodes created at depth d is bd and
at depth d-1 is bd-1.

Heuristic Search Strategies


To solve large problems with large number of possible states, problem-specific knowledge needs to
be added to increase the efficiency of search algorithms.

Heuristic Evaluation Functions


They calculate the cost of optimal path between two states. A heuristic function for sliding-tiles
games is computed by counting number of moves that each tile makes from its goal state and adding
these number of moves for all tiles.

Pure Heuristic Search


It expands nodes in the order of their heuristic values. It creates two lists, a closed list for the already
expanded nodes and an open list for the created but unexpanded nodes.

In each iteration, a node with a minimum heuristic value is expanded, all its child nodes are created
and placed in the closed list. Then, the heuristic function is applied to the child nodes and they are
placed in the open list according to their heuristic value. The shorter paths are saved and the longer
ones are disposed.

A * Search
It is best-known form of Best First search. It avoids expanding paths that are already expensive, but
expands most promising paths first.

f(n) = g(n) + h(n), where

 g(n) the cost (so far) to reach the node


 h(n) estimated cost to get from the node to the goal
 f(n) estimated total cost of path through n to goal. It is implemented using priority queue by
increasing f(n).
Greedy Best First Search
It expands the node that is estimated to be closest to goal. It expands nodes based on f(n) = h(n). It is
implemented using priority queue.

Disadvantage − It can get stuck in loops. It is not optimal.

Local Search Algorithms


They start from a prospective solution and then move to a neighboring solution. They can return a
valid solution even if it is interrupted at any time before they end.

Hill-Climbing Search
It is an iterative algorithm that starts with an arbitrary solution to a problem and attempts to find a
better solution by changing a single element of the solution incrementally. If the change produces a
better solution, an incremental change is taken as a new solution. This process is repeated until there
are no further improvements.

Disadvantage − This algorithm is neither complete, nor optimal.


Local Beam Search
In this algorithm, it holds k number of states at any given time. At the start, these states are generated
randomly. The successors of these k states are computed with the help of objective function. If any
of these successors is the maximum value of the objective function, then the algorithm stops.

Otherwise the (initial k states and k number of successors of the states = 2k) states are placed in a
pool. The pool is then sorted numerically. The highest k states are selected as new initial states. This
process continues until a maximum value is reached.

Simulated Annealing
Annealing is the process of heating and cooling a metal to change its internal structure for modifying
its physical properties. When the metal cools, its new structure is seized, and the metal retains its
newly obtained properties. In simulated annealing process, the temperature is kept variable.

Initially set the temperature high and then allow it to ‘cool' slowly as the algorithm proceeds. When
the temperature is high, the algorithm is allowed to accept worse solutions with high frequency.

Start

 Initialize k = 0; L = integer number of variables;


 From i → j, search the performance difference ∆.
 If ∆ <= 0 then accept else if exp(-/T(k)) > random(0,1) then accept;
 Repeat steps 1 and 2 for L(k) steps.
 k = k + 1;
Repeat steps 1 through 4 till the criteria is met.

End

Travelling Salesman Problem


In this algorithm, the objective is to find a low-cost tour that starts from a city, visits all cities en-
route exactly once and ends at the same starting city.

Start
Find out all (n -1)! Possible solutions, where n is the total number of cities.
Determine the minimum cost by finding out the cost of each of these (n -1)! solutions.
Finally, keep the one with the minimum cost.
end

1.3 First Order Logic


First-order logic is symbolized reasoning in which each sentence, or statement, is broken
down into a subject and a predicate. The predicate modifies or defines the properties of the subject. In
first-order logic, a predicate can only refer to a single subject. First-order logic is also known as first-
order predicate calculus or first-order functional calculus.

A sentence in first-order logic is written in the form Px or P(x), where P is the predicate and x is the
subject, represented as a variable. Complete sentences are logically combined and manipulated
according to the same rules as those used in Boolean algebra.

In first-order logic, a sentence can be structured using the universal quantifier (symbolized  ) or the
existential quantifier (  ). Consider a subject that is a variable represented by x. Let A be a predicate
"is an apple," F be a predicate "is a fruit," S be a predicate "is sour"', and M be a predicate "is mushy."
Then we can say

x : Ax  Fx

which translates to "For all x, if x is an apple, then x is a fruit."

Basic entities in FOL

Propositional logic assumes world contains facts, first-order logic (like natural language)
assumes the world contains
• Objects: people, houses, numbers, theories, Ronald McDonald, colors, baseball games,
wars, centuries . . .
• Relations: red, round, bogus, prime, multistoried . . ., is the brother of, is bigger than, is
inside, is part of, has color, occurred after, owns, comes between, . . .
• Functions: father of, best friend, third inning of, one more than, end of

Syntax of FOLBasic elements

Constant symbols KingJohn, 2, UniversityofMaryland, . . .

Predicate symbols Brother, >, . . .

Function symbols Sqrt, LeftLegOf , . . .

Variable symbols x, y, a, b, . . .

Connectives ∧ ∨ ¬ ⇒ ⇔

Equality =

Quantifiers ∀ ∃

Punctuation ( )

Atomic sentences

Atomic sentence = predicate(term1, . . . , termn) or term1 = term2

Term = function(term1, . . . , termn) or constant or variable


E.g., Brother(KingJohn, RichardT heLionheart) > (Length(LeftLegOf (Richard)), Length(LeftLegOf
(KingJohn)))

Complex sentences

Complex sentences are made from atomic sentences using connectives ¬S, S1 ∧ S2, S1 ∨ S2,
S1 ⇒ S2, S1 ⇔ S2

E.g., Sibling(KingJohn, Richard) ⇒ Sibling(Richard, KingJohn) >(1, 2) ∨ ≤(1, 2) >(1, 2) ∧


¬ >(1, 2)

Universal quantification

∀<variables><sentence>

Everyone at the University of Maryland is smart

: ∀ x At(x, UMD) ⇒ Smart(x)

A common mistake to avoid

Common mistake with ∀:

using ∧ when you meant to use ⇒

∀ x At(x, UMD) ∧ Smart(x)

means “Everyone is at UMD and everyone is smart”

Probably you meant to say

∀ x At(x, UMD) ⇒ Smart(x)

Everyone at UMD is smart.

Existential quantification

∃<variables><sentence>

Someone at UMD is smart:

∃ x At(x, UMD) ∧ Smart(x)

Another common mistake to avoid

A common mistake with ∃:

using ⇒ when you meant to use ∧:

∃ x At(x, UMD) ⇒ Smart(x)

This is equivalent to ∃ x ¬At(x, UMD) ∨ Smart(x)


There’s someone who either is smart or isn’t at UMD. That’s true if there’s anyone who is not at
UMD. Probably you meant to say this instead: ∃ x At(x, UMD) ∧ Smart(x).There’s someone who is at
UMD and is smart.

Properties of quantifiers

∀ x ∀ y is the same as ∀ y ∀ x

∃ x ∃ y is the same as ∃ y ∃ x

∃ x ∀ y is not the same as ∀ y ∃ x

“There is a person who loves everyone in the world”

∃ x ∀ y Loves(x, y)

“Everyone in the world is loved by at least one person”

∀ y ∃ x Loves(x, y)

Quantifier duality: each can be expressed using the other

∀ x Likes(x, IceCream) ¬∃ x ¬Likes(x, IceCream)

∃ x Likes(x, Broccoli) ¬∀ x ¬Likes(x, Broccoli)

Examples of sentences

Brothers are siblings

∀ x, y Brother(x, y) ⇒ Sibling(x, y)

“Sibling” is symmetric

∀ x, y Sibling(x, y) ⇔ Sibling(y, x)

One’s mother is one’s female parent

∀ x, y Mother(x, y) ⇔ (F emale(x) ∧ P arent(x, y))

A first cousin is a child of a parent’s sibling

∀ x, y FirstCousin(x, y) ⇔∃ px, py P arent(px, x) ∧ Sibling(px, py) ∧ P arent(py, y)

1.4 Forward Reasoning(Data-driven Reasoning):


Construct a goal state starting from the initial state.

For example, suppose that the goal is to conclude the color of a pet named Fritz, given that he croaks
and eats flies, and that the rule base contains the following four rules:

1. If X croaks and X eats flies - Then X is a frog


2. If X chirps and X sings - Then X is a canary
3. If X is a frog - Then X is green
4. If X is a canary - Then X is yellow

Let us illustrate forward chaining by following the pattern of a computer as it evaluates the rules.
Assume the following facts:

 Fritz croaks
 Fritz eats flies

With forward reasoning, the inference engine can derive that Fritz is green in a series of steps:

1. Since the base facts indicate that "Fritz croaks" and "Fritz eats flies", the antecedent of rule #1 is
satisfied by substituting Fritz for X, and the inference engine concludes:
Fritz is a frog

2. The antecedent of rule #3 is then satisfied by substituting Fritz for X, and the inference engine
concludes:
Fritz is green

The name "forward chaining" comes from the fact that the inference engine starts with the data and
reasons its way to the answer, as opposed to backward chaining, which works the other way around.
In the derivation, the rules are used in the opposite order as compared to backward chaining. In this
example, rules #2 and #4 were not used in determining that Fritz is green.

1.5 Backward Reasoning(Goal driven Reasoning)


 prove a goal statement using initially valid facts

For example, suppose a new pet, Fritz, is delivered in an opaque box along with two facts about Fritz:

 Fritz croaks
 Fritz eats flies

The goal is to decide whether Fritz is green, based on a rule base containing the following four rules:
An Example of Backward Chaining.

1. If X croaks and X eats flies – Then X is a frog


2. If X chirps and X sings – Then X is a canary
3. If X is a frog – Then X is green
4. If X is a canary – Then X is yellow

With backward reasoning, an inference engine can determine whether Fritz is green in four steps. To
start, the query is phrased as a goal assertion that is to be proved: "Fritz is green".

1. Fritz is substituted for X in rule #3 to see if its consequent matches the goal, so rule #3 becomes:
If Fritz is a frog – Then Fritz is green

Since the consequent matches the goal ("Fritz is green"),the rules engine now needs to see if the
antecedent ("If Fritz is a frog") can be proved. The antecedent therefore becomes the new goal:
Fritz is a frog

2. Again substituting Fritz for X, rule #1 becomes:


If Fritz croaks and Fritz eats flies – Then Fritz is a frog

Since the consequent matches the current goal ("Fritz is a frog"), the inference engine now needs to
see if the antecedent ("If Fritz croaks and eats flies") can be proved. The antecedent therefore
becomes the new goal:
Fritz croaks and Fritz eats flies

3. Since this goal is a conjunction of two statements, the inference engine breaks it into two sub-goals,
both of which must be proved:
Fritz croaks
Fritz eats flies

4. To prove both of these sub-goals, the inference engine sees that both of these sub-goals were given
as initial facts. Therefore, the conjunction is true:
Fritz croaks and Fritz eats flies

therefore the antecedent of rule #1 is true and the consequent must be true:
Fritz is a frog

therefore the antecedent of rule #3 is true and the consequent must be true:
Fritz is green

This derivation therefore allows the inference engine to prove that Fritz is green. Rules #2 and #4
were not used.
1.6 Semantic Networks

A semantic net (or semantic network) is a knowledge representation technique  used for


propositional information. So it is also called a propositional net. Semantic nets convey meaning.
They are two dimensional representations of knowledge. Mathematically a semantic net can be
defined as a labelled directed graph.

Semantic nets consist of nodes, links (edges) and link labels. In the semantic network
diagram, nodes appear as circles or ellipses or rectangles to represent objects such as physical objects,
concepts or situations. Links appear as arrows to express the relationships between objects, and link
labels specify particular relations. Relationships provide the basic structure for
organizing knowledge. The objects and relations involved need not be so concrete. As nodes are
associated with other nodes semantic nets are also referred to as associative nets.

Semantic Networks for representing knowledge has particular advantages:


1. They allow us to structure the knowledge to reflect the structure of that part of the world which is
being represented.
2. The semantics, i.e. real world meanings, are clearly identifiable.
3. There are very powerful representational possibilities as a result of “is a” and “is a part of”
inheritance hierarchies.
4. They can accommodate a hierarchy of default values (for example, we can assume the height of an
adult male to be 178cm, but if we know he is a baseball player we should take it to be 195cm).
5. They can be used to represent events and natural language sentences. The major idea is that:

 The meaning of a concept comes from its relationship to other concepts.


 The information is stored by interconnecting nodes with labelled arcs.

Representation in a Semantic Net

The physical attributes of a person can be represented in below figure.


In the above figure all the objects are within ovals and connected using labelled arcs. Note that there
is a link between Jill andFemalePersons with label MemberOf. Simlarly there is aMemberOf link
between Jack and MalePersons and SisterOf link between Jill and Jack. The MemberOf link
between Jill and FemalePersons indicates that Jill belongs to the category of female persons.

INHERITANCE REASONING

Unless there is a specific evidence to the contrary, it is assumed that all members of a class (category)
will inherit all the properties of their superclasses. So semantic network allows us to perform
inheritance reasoning. For example Jill inherits the property of having two legs as she belongs to the
category of FemalePersons which in turn belongs to the category of Persons which has a boxed Legs
link with value 2. Semantic nets allows multiple inheritance. So an object can belong to more than one
category and a category can be a subset of more than one another category.

INVERSE LINKS

Semantic network allows a common form of inference known as inverse links. For example we can
have a HasSister link which is the inverse of SisterOf link.The inverse links make the job of inference
algorithms much easier to answer queries such as who the sister of Jack is. On discovering
that HasSister is the inverse of SisterOf the inference algorithm can follow that link HasSister
from Jack to Jill and answer the query.

DISADVANTAGE OF SEMANTIC NETS

1.One of the drawbacks of semantic network is that the links between the objects represent only
binary relations.

2.There is no standard definition of link names.

ADVANTAGES OF SEMANTIC NETS

1.Semantic nets have the ability to represent default values for categories. In the above figure Jack has
one leg while he is a person and all persons have two legs. So persons have two legs has only default
status which can be overridden by a specific value.

2.They convey some meaning in a transparent manner.

3.They nets are simple and easy to understand.


4.They are easy to translate into PROLOG.

1.7 Frames

Frames can also be regarded as an extension to Semantic nets. Semantic nets initially used to
represent labelled connections between objects. As tasks became more complex the representation
needs to be more structured. A frame is a collection of attributes or slots and associated values that
describe some real world entity. Each frame represents:

 a class (set), or
 an instance (an element of a class).

NEED OF FRAMES

Frame is a type of schema used in many AI applications including vision and natural language


processing. The situations to represent may be visual scenes, structure of complex physical objects,
etc. A frame is similar to a record structure and corresponding to the fields and values are slots and
slot fillers. Basically it is a group of slots and fillers that defines a stereotypical object. A single frame
is not much useful. Frame systems usually have collection of frames connected to each other. Value
of an attribute of one frame may be another frame.

A frame for a book is given below.

Slots Fillers

publisher Thomson
title Expert Systems
author Giarratano
edition Third
year 1998
pages 600

Frames can represent either generic or frame. Following is the example for generic frame.

Slot Fillers

name computer
specialization_o a_kind_of machine
f
types (desktop, laptop,mainframe,super)
if-added: Procedure ADD_COMPUTER
speed default: faster
if-needed: Procedure FIND_SPEED
location (home,office,mobile)
under_warranty (yes, no)
The fillers may values such as computer in the name slot or a range of values as in types slot. The
procedures attached to the slots are called procedural attachments. There are mainly three types of
procedural attachments: if-needed, default and if-added. As the name implies if-needed types of
procedures will be executed when a filler value is needed. Default value is taken if no other value
exists. Defaults are used to represent commonsense knowledge.

You might also like