0% found this document useful (0 votes)
20 views2 pages

Comparison of Forward and Backward Chaining

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)
20 views2 pages

Comparison of Forward and Backward Chaining

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

most recent human-computer matches have been won

convincingly by the computer. Give comparison between forward chaining and backward
chaining.
Explain the concept of agent and environment.An agent is Ans
anything that can perceive its environment through sensors Explain the working of simple reflex agent.
FORWARD CHAINING • Forward chaining starts with some initial
and acts upon that environment through effectors.A human Sometimes we do not need an extensive analysis of the game state
agent has sensory organs such as eyes, ears, nose, tongue to figure out our next move. At times, the game is simple enough information and work forward, attempting to match that information
and skin parallel to the sensors, and other organs such as that we can make a general strategy and represent it as a set of with a rule. • Once a fact has been matched to the IF part of the rule, the
hands, legs, mouth, for effectors.A robotic agent replaces rules. A rule would specify that a if a certain condition is met, a rule is fired. • The action could produce new knowledge or a new fact
cameras and infrared range finders for the sensors, and certain action should be taken. An agent built using such rules is that is stored in the knowledge base. • This new fact may then be used
various motors and actuators for effectors.A software agent called a Simple Reflex Agent to search out the next appropriate rule. • This searching and matching
has encoded bit strings as its programs and actions. Agent This agent selects actions based on the agents current perception or
Terminology Performance Measure of Agent − It is the the world and not based on past perceptions.
process continues until a final conclusion rule is fired.
criteria, which determines how successful an agent For example if a mars lander found a rock in a specific place it BACKWARD CHAINING • Backward chaining starts with a fact in
is.Behavior of Agent − It is the action that agent performs needed to collect then it would collect it, if it was a simple reflex the database, but this time it is the hypothesis. • The rule interpreter then
after any given sequence of percepts.Percept − It is agent’s agent then if it found the same rock in a different place it would still begins examining the THEN parts of rules for a match. • The inference
perceptual inputs at a given instance.Percept Sequence − It pick it up as it doesn't take into account that it already picked it up. engine searches for an evidence to support the hypothesis originally
is the history of all that an agent has perceived till This is useful for when a quick automated response is needed,
stated. • If a match is found, the database is updated recording the
date.Agent Function − It is a map from the precept sequence humans have a very similar reaction to fire for example, our brain
to an action. pulls our hand away without thinking about any possibility that there conditions or premises that the rule stated as necessary for supporting
could be danger in the path of your arm. We call these reflex the matched conclusion. • The chaining process continues with the
actions. system repeatedly attempting to match the right hand side of the rule
This kind of connection where only one possibility is acted upon is against the current status of the system. • The corresponding IF sides of
called a condition-action rule, written as: the rules matched are used to generate new intermediate hypotheses or
if hand is in fire then pull away hand
The simple reflex agent has a library of such rules so that if a certain
goal states which are recorded in the database. • Again this backward
situation should arise and it is in the set of Condition-action rules the chaining continues until the hypothesis is proved.
agent will know how to react with minimal reasoning.
Simple Reflex agent choose actions only based on the Write a note on Event calculus. Ans Situation calculus is limited in its
current percept.They are rational only if a correct applicability: it was designed to describe a world in which actions are
decision is made only based on current precept. discrete, instantaneous, and happen one at a time. Consider a continuous
Their environment is completely observable. action, such as filling a bathtub. Situation calculus can say that the tub is
Q2c. Write the uniform cost search algorithm. empty before the action and full when the action is done, but it can’t
Explain in short
Condition-Action Rule − It is a rule that maps a state
Uniform Cost Search is the best algorithm for a search problem, (condition) to an action. talk about what happens during the action. It also can’t describe two
which does not involve the use of heuristics. It can solve any general actions happening at the same time— such as brushing one’s teeth while
graph for optimal cost. Uniform Cost Search as it sounds searches in . Write the connectives used to form complex sentence waiting for the tub to fill. To handle such cases we introduce an
branches which are more or less the same in cost.Uniform Cost of propositional logic. Give example for each. alternative formalism known as event calculus, which is based on points
Search again demands the use of a priority queue. Recall that Depth The syntax of propositional logic defines the allowable sentences. of time rather than on situations. Event calculus reifies fluents and
First Search used a priority queue with the depth up to a particular The atomic sentences consist of a single proposition symbol.
node being the priority and the path from the root to the node being Each such symbol stands for a proposition that can be true or false.
events. The fluent At(Shankar , Berkeley) is an object that refers to the
the element stored. The priority queue used here is similar with the There are two proposition symbols with fixed meanings: True is the fact of Shankar being in Berkeley, but does not by itself say anything
priority being the cumulative cost up to the node. Unlike Depth First always-true proposition and False is the always-false proposition. about whether it is true. To assert that a fluent is actually true at some
Search where the maximum depth had the maximum priority, Complex sentences are constructed from simpler sentences, using point in time we use the predicate T, as in T(At(Shankar , Berkeley), t).
Uniform Cost Search gives the minimum cumulative cost the parentheses and logical connectives. There are five connectives in Events are described as instances of event categories.4 The event E1 of
.
E1 ∈ Flyings ∧ Flyer (E1, Shankar ) ∧ Origin(E1, SF) ∧
maximum priority common use: Shankar flying from San Francisco to Washington, D.C. is described as
¬ (not). A sentence such as ¬W1,3 is called the negation of W1,3. A
The algorithm of Uniform Cost Search literal is either an atomic sentence (a positive literal) or a negated

three-argument version of the category of flying events and say E1 ∈


Destination(E1,DC) . If this is too verbose, we can define an alternative
∧ (and). A sentence whose main connective is ∧, such as W1,3 ∧
atomic sentence (a negative literal).

P3,1, is called a conjunction; its parts are the conjuncts. (The ∧ looks Flyings(Shankar , SF,DC) . We then use Happens(E1, i) to say that the
∨ (or). A sentence using ∨, such as (W1,3∧P3,1)∨W2,2, is a
like an “A” for “And.”). event E1 took place over the time interval i, and we say the same thing
disjunction of the disjuncts (W1,3 ∧ P3,1) and W2,2. (Historically, the
in functional form with Extent(E1)=i. We represent time intervals by a
∨ comes from the Latin “vel,” which means “or.” For most people, it
(start, end) pair of times; that is, i = (t1, t2) is the time interval that starts
is easier to remember ∨ as an upside-down ∧.) at t1 and ends at t2. The complete set of predicates for one version of
⇒ (implies). A sentence such as (W1,3∧P3,1) ⇒ ¬W2,2 is called an the event calculus is T(f, t) Fluent f is true at time t Happens(e, i) Event

∧P3,1), and its conclusion or consequent is ¬W2,2. Implications are


implication (or conditional). Its premise or antecedent is (W1,3 e happens over the time interval i Initiates(e, f, t) Event e causes fluent f
to start to hold at time t Terminates(e, f, t) Event e causes fluent f to
symbol is sometimes written in other books as ⊃ or →.
also known as rules or if–then statements. The implication RULES cease to hold at time t Clipped(f, i) Fluent f ceases to be true at some
⇔ (if and only if). The sentence W1,3 ⇔ ¬W2,2 is a biconditional.
point during time interval i Restored (f, i) Fluent f becomes true
Some other books write this as ≡
sometime during time interval
Q2d. With suitable diagram explain the
following concepts . Explain the alpha-beta pruning with example What is planning? Explain STRIPS operators with suitable
i. shoulder ii. Global Alpha-beta pruning is a modified version of the minimax algorithm. It example. Ans The classical planning representation talks about what to
maximum iii. Local is an optimization technique for the minimax algorithm.
maximum
do, and in what order, but the representation cannot talk about time:
Ans: As we have seen in the minimax search algorithm that the number how long an action takes and when it occurs. For example, the planners
Plateau(shoulder): A plateau is a flat area of the state-space of game states it has to examine are exponential in depth of the of Chapter 10 could produce a schedule for an airline that says which
landscape. It can be a flat local maximum, from which no tree. Since we cannot eliminate the exponent, but we can cut it to planes are assigned to which flights, but we really need to know
uphill exit exists, or a shoulder, from which progress is half. Hence there is a technique by which without checking each departure and arrival times as well. This is the subject matter of
possible. A hill-climbing search might get lost on the node of the game tree we can compute the correct minimax scheduling. The real world also imposes many resource constraints; for
plateau. Global maxima: It is the best possible state in the decision, and this technique is called pruning. This involves two
state space diagram. This because at this state, objective threshold parameter Alpha and beta for future expansion, so it is
example, an airline has a limited number of staff—and staff who are on
function has highest value. Local maxima: a local maximum called alpha-beta pruning. It is also called as Alpha-Beta Algorithm. one flight cannot be on another at the same time. This section covers
is a peak that is higher than each of its neighboring states methods for representing and solving planning problems that include
but lower than the global maximum. Hill-climbing Alpha-beta pruning can be applied at any depth of a tree, and temporal and resource constraints. Action: Buy(x) Have(x) At(p)

this abstracts away many important details!] Restricted language ⇒


algorithms that reach the vicinity of a local maximum will sometimes it not only prune the tree leaves but also entire sub-tree. Sells(p,x) Buy(x) Precondition: At(p), Sells(p, x) Effect: Have(x) [Note:
be drawn upward toward the peak but will then be stuck
The two-parameter can be defined as:
with nowhere else to go
Alpha: The best (highest-value) choice we have found so far at any efficient algorithm Precondition: conjunction of positive literals Effect:
point along the path of Maximizer. The initial value of alpha is -∞. conjunction of literals A complete set of STRIPS operators can be
Beta: The best (lowest-value) choice we have found so far at any translated into a set of successor-state axioms
point along the path of Minimizer. The initial value of beta is +∞.
The Alpha-beta pruning to a standard minimax algorithm returns the Explain universal and existential quantifier with suitable example.
same move as the standard algorithm does, but it removes all the Ans The Universal Quantifier The expression: x P(x), denotes the
nodes which are not really affecting the final decision but making universal quantification of the atomic formula P(x). Artificial
algorithm slow. Hence by pruning these nodes, it makes the
Intelligence Regular OCT-2018 Paper Solution by Pallavi Tawde 15
algorithm fast.
Translated into the English language, the expression is understood as:
"For all x, P(x) holds", "for each x, P(x) holds" or "for every x, P(x)
what is rational agent? Discuss in brief about rationality. holds". is called the universal quantifier, and x means all the objects x in
An agent is just something that acts (agent comes from the Latin agere, the universe. If this is followed by P(x) then the meaning is that P(x) is
to do). Of course, all computer programs do something, but computer true for every object x in the universe. For example, "All cars have
agents are expected to do more: operate autonomously, perceive their wheels" could be transformed into the propositional form, x P(x),
Q1b. What is Artificial intelligence? Explain with
example
environment, persist over a prolonged time period, adapt to change, and where: P(x) is the predicate denoting: x has wheels, and the universe of
“Artificial Intelligence, or AI, is the ability of a computer to create and pursue goals. A rational agent is one that acts so as to discourse is only populated by cars. The Existential Quantifier The
act like a human being. It has several applications, achieve the best outcome or, when there is uncertainty, the best expression: xP(x), denotes the existential quantification of P(x).
including software simulations and robotics.” expected outcome. In the “laws of thought” approach to AI, the Translated into the English language, the expression could also be
1. Robotic vehicles: emphasis was on correct inferences. Making correct inferences is understood as: "There exists an x such that P(x)" or "There is at least
A driverless robotic car named STANLEY sped through the
sometimes part of being a rational agent, because one way to act one x such that P(x)" is called the existential quantifier, and x means at
rough terrain of the Mojave dessert at 22 mph, finishing the
132-mile course first to win the 2005 DARPA Grand rationally is to reason logically to the conclusion that a given action will least one object x in the universe. If this is followed by P(x) then the
Challenge. STANLEY is a Volkswagen Touareg outfitted with achieve one’s goals and then to act on that conclusion. On the other meaning is that P(x) is true for at least one object x of the universe. For
cameras, radar, and laser rangefinders to sense the hand, correct inference is not all of rationality; in some situations, there example, "Someone loves you" could be transformed into the
environment and onboard software to command the is no provably correct thing to do, but something must still be done. propositional form, x P(x), where: P(x) is the predicate meaning: x loves
steering, braking, and acceleration (Thrun, 2006). The There are also ways of acting rationally that cannot be said to involve you, The universe of discourse contains (but is not limited to) all living
following year CMU’s BOSS won the Urban Challenge, safely
driving in traffic through the streets of a closed Air Force
inference. For example, recoiling from a hot stove is a reflex action that creatures.
base, obeying traffic rules and avoiding pedestrians and is usually more successful than a slower action taken after careful
other vehicles. deliberation. All the skills needed for the Turing Test also allow an Write a note on Kriegspiel’s Partially observable chess. Ans In deterministic
2. Speech recognition: agent to act rationally. Knowledge representation and reasoning enable partially observable games, uncertainty about the state of the board arises entirely from
A traveler calling United Airlines to book a flight can have lack of access to the choices made by the opponent. This class includes children’s
agents to reach good decisions. We need to be able to generate games such as Battleships (where each player’s ships are placed in locations hidden
the entire conversation guided by an automated speech comprehensible sentences in natural language to get by in a complex
recognition and dialog management system. from the opponent but do not move) and Stratego (where piece locations are known
3. Autonomous planning and scheduling: society. We need learning not only for erudition, but also because it but piece types are hidden). We will examine the game of Kriegspiel, a partially
A hundred million miles from Earth, NASA’s Remote Agent improves our ability to generate effective behavior. The rational-agent observable variant of chess in which pieces can move but are completely invisible to
program became the first on-board autonomous planning approach has two advantages over the other approaches. First, it is more the opponent. The rules of Kriegspiel are as follows: White and Black each see a board
program to control the scheduling of operations for a containing only their own pieces. A referee, who can see all the pieces, adjudicates the
general than the “laws of thought” approach because correct inference is game and periodically makes announcements that are heard by both players. On his
spacecraft (Jonsson et al., 2000). generated plans from just one of several possible mechanisms for achieving rationality. turn, White proposes to the referee any move that would be legal if there were no
high-level goals specified from the ground and monitored
Second, it is more amenable to scientific development than are black pieces. If the move is in fact not legal (because of the black pieces), the referee
the execution of those plans—detecting, diagnosing, and
recovering from problems as they occurred. approaches based on human behavior or human thought. The standard announces “illegal.” In this case, White may keep proposing moves until a legal one is
of rationality is mathematically well defined and completely general, found—and learns more about the location of Black’s pieces in the process. Once a
4. Game playing:
legal move is proposed, the referee announces one or more of the following: “Capture
IBM’s DEEP BLUE became the first computer program to and can be “unpacked” to generate agent designs that provably achieve on square X” if there is a capture, and “Check by D” if the black king is in check,
defeat the world champion in a chess match when it bested it. Human behavior, on the other hand, is well adapted for one specific where D is the direction of the check, and can be one of “Knight,” “Rank,” “File,”
Garry Kasparov by a score of 3.5 to 2.5 in an exhibition environment and is defined by, well, the sum total of all the things that “Long diagonal,” or “Short diagonal.” (In case of discovered check, the referee may
match (Goodman and Keene, 1997). Kasparov said that he
felt a ―new kind of intelligence‖ across the board from him.
humans do. This book therefore concentrates on general principles of make two “Check” announcements.) If Black is checkmated or stalemated, the referee
rational agents and on components for constructing them. We will see says so; otherwise, it is Black’s turn to move.
Newsweek magazine described the match as ―The brain’s
last stand.‖ The value of IBM’s stock increased by $18 that despite the apparent simplicity with which the problem can be
billion. Human champions studied Kasparov’s loss and were stated, an enormous variety of issues come up when we try to solve it.
able to draw a few matches in subsequent years, but the
Ans:
Write a note on semantic network. Ans: i. Circumscription is a non-monotonic logic created by John McCarthy
In 1909, Charles S. Peirce proposed a graphical notation of nodes and to formalize the common sense assumption that things are as
edges called existential graphs that he called “the logic of the future.” expected unless otherwise specified. [1][2] Circumscription was later used
Thus began a long-running debate between advocates of “logic” and by McCarthy in an attempt to solve the frame problem. To implement
Explain types of environments. Ans: advocates of “semantic networks.” Unfortunately, the debate obscured circumscription in its initial formulation, McCarthy augmented first-
Nature of Environments Some programs operate in the entirely artificial the fact that semantics networks—at least those with well-defined order logic to allow the minimization of the extension of some
environment confined to keyboard input, database, computer file systems semantics—are a form of logic. The notation that semantic networks predicates, where the extension of a predicate is the set of tuples of
and character output on a screen. In contrast, some software agents provide for certain kinds of sentences is often more convenient, but if values the predicate is true on. This minimization is similar to the
(software robots or softbots) exist in rich, unlimited softbots domains. we strip away the “human interface” issues, the underlying concepts— closed-world assumption that what is not known to be true is false.
The simulator has a very detailed, complex environment. The objects, relations, quantification, and so on—are the same. There are ii. Default logic: Default logic is a formalism in which default rules
environment has multifold properties − 1. Discrete / Continuous − If there many variants of semantic networks, but all are capable of representing can be written to generate contingent, nonmonotonic conclusions. A
are a limited number of distinct, clearly defined, states of the individual objects, categories of objects, and relations among objects. A default rule looks like this:
environment, the environment is discrete (For example, chess); otherwise typical graphical notation displays object or category names in ovals or Bird(x) : Flies(x)/Flies(x) .
it is continuous (For example, driving). 2. Observable / Partially boxes, and connects them with labelled links. For example, Figure 12.5 This rule means that if Bird(x) is true, and if Flies(x) is consistent with

to the logical assertion Mary ∈FemalePersons; similarly, the Sister Of


Observable − If it is possible to determine the complete state of the has a MemberOf link between Mary and FemalePersons, corresponding the knowledge base, then Flies(x) may be concluded by default. In
environment at each time point from the percepts it is observable; general, a default rule has the form
otherwise it is only partially observable. 3. Static / Dynamic − If the link between Mary and John corresponds to the assertion SisterOf P: J1, . . . , Jn/C
environment does not change while an agent is acting, then it is static; (Mary, John). We can connect categories using SubsetOf links, and so where P is called the prerequisite, C is the conclusion, and Ji are the
otherwise it is dynamic. 4. Single agent / Multiple agents − The on. It is such fun drawing bubbles and arrows that one can get carried justifications—if any one of them can be proven false, then the
environment may contain other agents which may be of the same or away. For example, we know that persons have female persons as conclusion cannot be drawn. Any variable that appears in Ji or C must
different kind as that of the agent. 5. Accessible / Inaccessible − If the mothers, so can we draw a HasMother link from Persons to also appear in P. The Nixon-diamond example can be represented in
agent’s sensory apparatus can have access to the complete state of the
Republican(Nixon) ∧ Quaker(Nixon) .
FemalePersons? The answer is no, because HasMother is a relation default logic with one fact and two default rules:
environment, then the environment is accessible to that agent. 6. between a person and his or her mother, and categories do not have

boxed link—in Figure 12.5. This link asserts that ∀x x∈ Persons ⇒ [∀


Deterministic / Non-deterministic − If the next state of the environment is mothers.5 For this reason, we have used a special notation—the double- Republican(x) : ¬Pacifist (x)/¬Pacifist (x) .
completely determined by the current state and the actions of the agent,
y HasMother (x, y) ⇒ y ∈ FemalePersons ] . We might also want to
Quaker(x) : Pacifist (x)/Pacifist (x) .
then the environment is deterministic; otherwise it is non-deterministic. 7.
Episodic / Non-episodic − In an episodic environment, each episode assert that persons have two legs—that is, ∀x x∈ Persons ⇒ Legs(x, . List various classical planning approaches. Explain any one.
consists of the agent perceiving and then acting. The quality of its action 2) . As before, we need to be careful not to assert that a category has
depends just on the episode itself. Subsequent episodes do not depend on Ans: The most popular and effective approaches to fully automated
legs; the single-boxed link is used to assert properties of every member planning are:
the actions in the previous episodes. Episodic environments are much of a category. The semantic network notation makes it convenient to
simpler because the agent does not need to think ahead. Translating to a Boolean satisfiability (SAT) problem
perform inheritance reasoning of the kind introduced in Section 12.2. Forward state-space search with carefully crafted heuristics
For example, by virtue of being a person, Mary inherits the property of Search using a planning graph
Explain the algorithm for breadth first search algorithm. Ans: having two legs. Thus, to find out how many legs Mary has, the
Breadth-first search is a simple strategy in which the root node is 1. Boolean satisfiability (SAT) problem:
inheritance algorithm follows the MemberOf link from Mary to the
expanded first, then all the successors of the root node are expanded next, category she belongs to, and then follows SubsetOf links up the
then their successors, and so on. In general, all the nodes are expanded at hierarchy until it finds a category for which there is a boxed Legs link—
a given depth in the search tree before any nodes at the next level are in this case, the Persons category. The simplicity and efficiency of this
expanded. Breadth-first search is an instance of the general graph-search inference mechanism, compared with logical theorem proving, has been
algorithm in which the shallowest unexpanded node is chosen for one of the main attractions of semantic networks.
expansion. This is achieved very simply by using a FIFO queue for the
frontier. Thus, new nodes (which are always deeper than their parents) go Explain in brief about hierarchical planning. Ans
to the back of the queue, and old nodes, which are shallower than the new The problem-solving and planning methods of the preceding chapters
nodes, get expanded first. There is one slight tweak on the general graph- all operate with a fixed set of atomic actions. Actions can be strung
search algorithm, which is that the goal test is applied to each node when together into sequences or branching networks; state-of-the-art
it is generated rather than when it is selected for expansion. This decision algorithms can generate solutions containing thousands of actions. For
is explained below, where we discuss time complexity. Note also that the plans executed by the human brain, atomic actions are muscle
algorithm, following the general template for graph search, discards any activations. In very round numbers, we have about 103 muscles to
new path to a state already in the frontier or explored set; it is easy to see The translation is a series of straightforward steps:
activate (639, by some counts, but many of them have multiple
that any such path must be at least as deep as the one already found. Thus, subunits); we can modulate their activation perhaps 10 times per second; Propositionalize the actions: replace each action schema with a set of
breadth-first search always has the shallowest path to every node on the and we are alive and awake for about 109 seconds in all. Thus, a human ground actions formed by substituting constants for each of the
frontier. Breadth First Search (BFS) algorithm traverses a graph in a life contains about 1013 actions, give or take one or two orders of variables. These ground actions are not part of the translation, but will
breadth ward motion and uses a queue to remember to get the next vertex magnitude. Even if we restrict ourselves to planning over much shorter be used in subsequent steps.
to start a search, when a dead end occurs in any iteration. time horizons—for example, a two-week vacation in Hawaii—a detailed Define the initial state: assert F0 for every fluent F in the problem’s
motor plan would contain around 1010 actions. This is a lot more than initial state, and ¬F for every fluent not mentioned in the initial state.
1000. To bridge this gap, AI systems will probably have to do what Propositionalize the goal: for every variable in the goal, replace the

example, the goal of having block A on another block, On(A, x) ∧


Give the outline of Hill climbing algorithm. Ans humans appear to do: plan at higher levels of abstraction. A reasonable literals that contain the variable with a disjunction over constants. For
The hill-climbing search algorithm (steepest-ascent version). It is simply plan for the Hawaii vacation might be “Go to San Francisco airport; take
a loop that continually moves in the direction of increasing value—that is, Hawaiian Airlines flight 11 to Honolulu; do vacation stuff for two Block(x) in a world with objects A,B and C, would be replaced by the

(On(A,A) ∧ Block (A)) ∨ (On(A,B) ∧ Block (B)) ∨ (On(A,C) ∧ Block (C)) .


uphill. It terminates when it reaches a “peak” where no neighbor has a weeks; take Hawaiian Airlines flight 12 back to San Francisco; go goal
higher value. The algorithm does not maintain a search tree, so the data home.” Given such a plan, the action “Go to San Francisco airport” can
structure for the current node need only record the state and the value of
Ft+1 ⇔ ActionCausesFt ∨ (Ft ∧ ¬ActionCausesNotFt) , where
be viewed as a planning task in itself, with a solution such as “Drive to Add successor-state axioms: For each fluent F, add an axiom of the form
the objective function. Hill climbing does not look ahead beyond the the long-term parking lot; park; take the shuttle to the terminal.” Each of
immediate neighbors of the current state. This resembles trying to find the these actions, in turn, can be decomposed further, until we reach the ActionCausesF is a disjunction of all the ground actions that have F in
top of Mount Everest in a thick fog while suffering from amnesia. level of actions that can be executed without deliberation to generate the their add list, and ActionCausesNotF is a disjunction of all the ground
function Hill-Climbing(problem) returns a state that is a local maximum
Add precondition axioms: For each ground action A, add the axiom A t ⇒
required motor control sequences. In this example, we see that planning actions that have F in their delete list.
inputs: problem, a problem local variables: current, a node neighbor, a can occur both before and during the execution of the plan; for example,
node current←Make-Node (Initial-State[problem]) loop do neighbor←a one would probably defer the problem of planning a route from a PRE(A)t, that is, if an action is taken at time t, then the preconditions
highest-valued successor of current if Value[neighbor] ≤ Value[current] Artificial Intelligence Regular OCT-2018 Paper Solution by Pallavi
then return State[current] current←neighbor end must have been true.
Tawde 20 parking spot in long-term parking to the shuttle bus stop until Add action exclusion axioms: say that every action is distinct from every
a particular parking spot has been found during execution. Thus, that other action.
Write a note on Wumpus world problem. Ans: particular action will remain at an abstract level prior to the execution
The wumpus world is a cave consisting of rooms connected by The resulting translation is in the form that we can hand to SATPLAN to
phase. We defer discussion of this topic until Section 11.3. Here, we find a solution.
passageways. Lurking somewhere in the cave is the terrible wumpus, a concentrate on the aspect of hierarchical decomposition, an idea that
beast that eats anyone who entities its room. The wumpus can be shot by pervades almost all attempts to manage complexity. For example,
an agent, but the agent has only one arrow. The only mitigating feature of complex software is created from a hierarchy of subroutines or object . Write and explain a simple backward-chaining algorithm for first-
this bleak environment is the possibility of finding a heap of gold. classes; armies operate as a hierarchy of units; governments and order knowledge bases.
Although the wumpus world is rather tame by modem computer game
standards, it illustrates some important points about intelligence. The
corporations have hierarchies of departments, subsidiaries, and branch Ans:
offices. The key benefit of hierarchical structure is that, at each level of
precise definition of the task environment is given:  Performance the hierarchy, a computational task, military mission, or administrative
measure: +1000 for climbing out of the cave with the gold, –1000 for function is reduced to a small number of activities at the next lower
falling into a pit or being eaten by the wumpus, –1 for each action taken level, so the computational cost of finding the correct way to arrange
and –10 for using up the arrow. The game ends either when the agent dies those activities for the current problem is small. Non hierarchical
or when the agent climbs out of the cave.  Environment: A 4 x 4 grid of methods, on the other hand, reduce a task to a large number of
rooms. The agent always starts in the square labeled [1,1], facing to the individual actions; for large-scale problems, this is completely
right. The locations of the gold and the wumpus are chosen randomly, impractical.
with a uniform distribution, from the squares other than the start square.
In addition, each square other than the start can he a pit, with probability Write the minimax algorithm. Explain in short.Ans:
0.2.  Actuators: The agent can move Forward, Turn Left by 90°, or Mini-max algorithm is a recursive or backtracking algorithm which is
Turnftight by 90°. The agent dies a miserable death if it enters a square
used in decision-making and game theory. It provides an optimal move
containing a pit or a live wumpus. (it is safe, albeit smelly, to enter a
for the player assuming that opponent is also playing optimally. Mini-
square with a dead wumpus.) If an agent tries to move forward and bumps
Max algorithm uses recursion to search through the game-tree.Min-
into a wall, then the agent does not move. The action Grab can be used to
Max algorithm is mostly used for game playing in AI. Such as Chess,

American(x) ∧ Weapon(y) ∧ Sells(x,y,z) ∧ Hostile(z) ⇒ Criminal(x) .


pick up the gold if it is in the same square as the agent. The action Shoot It is a crime for an American to sell weapons to hostile nations”:
Checkers, tic-tac-toe, go, and various tow-players game. This
can be used to fire an arrow in a straight line in the direction the agent is
2) “Nono ...hassomemissiles.” Thesentence ∃x Owns(Nono,x)∧Missile(x)
Algorithm computes the minimax decision for the current state.
facing. The arrow continues until it either hits (or hence kills) the
function minimax(node, depth, maximizingPlayer) is
wumpus or hits a wall. The agent has only one arrow, so only the first istransformed into two definite clauses by Existential Instantiation,
if depth ==0 or node is a terminal node then
Shoot action has any effect. Finally_ the action Climb can be used to introducing a new constant M1:
climb out of the cave, but only from square [1,1].  Sensors: The agent return static evaluation of node
if MaximizingPlayer then // for Maximizer Player Owns(Nono,M1)
has five sensors. each of which gives a single bit of information: –In the Missile(M1)
square containing the wumpus and in the directly (not diagonally) maxEva= -infinity

Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono) .


for each child of node do 3) All of its missiles were sold to it by Colonel West
adjacent squares, the agent will perceive a Stench. –In the squares directly
adjacent to a pit, the agent will perceive a Breeze. –In the square where eva= minimax(child, depth-1, false)

Missile(x) ⇒ Weapon(x)
maxEva= max(maxEva,eva) //gives Maximum of the values 4) We will also need to know that missiles are weapons:
the gold is, the agent will perceive a Glitter. –When an agent walks into a
wall, it will perceive a Bump. –When the wumpus is killed, it emits a return maxEva

Enemy(x,America) ⇒ Hostile(x) .
woeful Scream that can be perceived anywhere in the cave else // for Minimizer player 5) enemy of America counts as “hostile”:
minEva= +infinity
. Write a note on Truth maintenance system. Ans: for each child of node do 6) West, who is American ...”:
We have seen that many of the inferences drawn by a knowledge eva= minimax(child, depth-1, true) American(West) .
representation system will have only default status, rather than being minEva= min(minEva, eva) //gives minimum of the values 7) The country Nono, an enemy of America
absolutely certain. Inevitably, some of these inferred facts will turn out to return minEva Enemy(Nono,America) .
be wrong and will have to be retracted in the face of new information.
This process is called belief revision.10 Suppose that a knowledge base . Explain the first order definite clause.
KB contains a sentence P—perhaps a default conclusion recorded by a Ans: Definite clause grammar (DCG) is a way of
forward-chaining algorithm, or perhaps just an incorrect assertion—and expressing grammar, either for natural or formal languages,
we want to execute TELL(KB, ¬P). To avoid creating a contradiction, we in a logic programming language such as Prolog. It is closely
must first execute RETRACT(KB, P). This sounds easy enough. related to the concept of attribute grammars / affix grammars

and asserted in the KB. For example, the implication P ⇒ Q might have
Problems arise, however, if any additional sentences were inferred from P from which Prolog was originally developed. DCGs are usually
associated with Prolog, but similar languages such as Mercury
been used to add Q. The obvious “solution”—retracting all sentences also include DCGs. They are called definite clause grammars

justifications besides P. For example, if R and R ⇒ Q are also in the KB,


inferred from P—fails because such sentences may have other because they represent a grammar as a set of definite
clauses in first-order logic. The term DCG refers to the specific
then Q does not have to be removed after all. Truth maintenance systems, type of expression in Prolog and other similar languages; not
or TMSs, are designed to handle exactly these kinds of complications. all ways of expressing grammars using definite clauses are
One simple approach to truth maintenance is to keep track of the order in considered DCGs. However, all of the capabilities or
which sentences are told to the knowledge base by numbering them from properties of DCGs will be the same for any grammar that is
P1 to Pn. When the call RETRACT(KB, Pi) is made, the system reverts to represented with definite clauses in essentially the same way
the state just before Pi was added, thereby removing both Pi and any as in Prolog. The definite clauses of a DCG can be considered
inferences that were derived from Pi. The sentences Pi+1 through Pn can a set of axioms where the validity of a sentence, and the fact
then be added again. This is simple, and it guarantees that the knowledge that it has a certain parse tree can be considered theorems
base will be consistent, but retracting Pi requires retracting and that follow from these axioms. This has the advantage of
reasserting n − i sentences as well as undoing and redoing all the making it so that recognition and parsing of expressions in a
inferences drawn from those sentences. For systems to which many facts language becomes a general matter of proving statements,
are being added—such as large commercial databases—this is such as statements in a logic programming language.
impractical.

. Explain the following terms:


i. Circumscription ii. Default logic

You might also like