0% found this document useful (0 votes)
73 views21 pages

Artificial Intelligence Paper Solution May 2019

This document contains the answers to questions about artificial intelligence. It discusses the Turing test and its purpose of providing an operational definition of intelligence. The Turing test examines whether a human can distinguish between responses from a computer and a person. It also defines artificial intelligence as the ability of computers to mimic human behavior through techniques like natural language processing, knowledge representation, automated reasoning, and machine learning. Additional questions cover topics like agents and environments, the rational approach to AI, and reflex agents.

Uploaded by

tApIsH
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)
73 views21 pages

Artificial Intelligence Paper Solution May 2019

This document contains the answers to questions about artificial intelligence. It discusses the Turing test and its purpose of providing an operational definition of intelligence. The Turing test examines whether a human can distinguish between responses from a computer and a person. It also defines artificial intelligence as the ability of computers to mimic human behavior through techniques like natural language processing, knowledge representation, automated reasoning, and machine learning. Additional questions cover topics like agents and environments, the rational approach to AI, and reflex agents.

Uploaded by

tApIsH
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/ 21

BSc.

(Information Technology)
(Semester V)
2018-19

Artificial Intelligence
(USIT 504 Core)
University Paper Solution

By
Payal Shah

Artificial Intelligence Page 1


Question 1

Q1a. What is the purpose of turing test?


Ans:

The Turing Test, proposed by Alan Turing (1950), was designed to provide a satisfactory
operational definition of intelligence. A computer passes the test if a human interrogator, after
posing some written questions, cannot tell whether the written responses come from a person or
from a computer. For now, we note that programming a computer to pass a rigorously applied
test provides plenty to work on. The computer would need to possess the following capabilities:
1. natural language processing to enable it to communicate successfully in English;
2. knowledge representation to store what it knows or hears;
3. automated reasoning to use the stored information to answer questions and to draw new
conclusions;
4. machine learning to adapt to new circumstances and to detect and extrapolate patterns.
Turing’s test deliberately avoided direct physical interaction between the interrogator and the
computer, because physical simulation of a person is unnecessary for intelligence. However, the
so-called total Turing Test includes a video signal so that the interrogator can test the subject’s
perceptual abilities, as well as the opportunity for the interrogator to pass physical objects
―through the hatch. To pass the total Turing Test,
1. the computer will need computer vision to perceive objects, and
2. robotics to manipulate objects and move about.
These six disciplines compose most of AI, and Turing deserves credit for designing a test that
remains relevant 60 years later. Yet AI researchers have devoted little effort to passing the Turing
Test, believing that it is more important to study the underlying principles of intelligence than to
duplicate an exemplar. The quest for ―artificial flight ‖ succeeded when the Wright brothers and
others stopped imitating birds and started using wind tunnels and learning about aerodynamics.
Aeronautical engineering texts do not define the goal of their field as making ―machines that fly
so exactly like pigeons that they can fool even other pigeons. ‖

Q1b. What is Artificial intelligence? Explain with example


Ans:
“Artificial Intelligence, or AI, is the ability of a computer to act like a human being. It has several
applications, including software simulations and robotics.”
1. Robotic vehicles:
A driverless robotic car named STANLEY sped through the rough terrain of the Mojave dessert at
22 mph, finishing the 132-mile course first to win the 2005 DARPA Grand Challenge. STANLEY is a
Volkswagen Touareg outfitted with cameras, radar, and laser rangefinders to sense the
environment and onboard software to command the steering, braking, and acceleration (Thrun,
2006). The following year CMU’s BOSS won the Urban Challenge, safely driving in traffic through
the streets of a closed Air Force base, obeying traffic rules and avoiding pedestrians and other
vehicles.
2. Speech recognition:
A traveler calling United Airlines to book a flight can have the entire conversation guided by an
automated speech recognition and dialog management system.
3. Autonomous planning and scheduling:

Artificial Intelligence Page 2


A hundred million miles from Earth, NASA’s Remote Agent program became the first on-board
autonomous planning program to control the scheduling of operations for a spacecraft (Jonsson
et al., 2000). generated plans from high-level goals specified from the ground and monitored the
execution of those plans—detecting, diagnosing, and recovering from problems as they occurred.
4. Game playing:
IBM’s DEEP BLUE became the first computer program to defeat the world champion in a chess
match when it bested Garry Kasparov by a score of 3.5 to 2.5 in an exhibition match (Goodman
and Keene, 1997). Kasparov said that he felt a ―new kind of intelligence ‖ across the board from
him. Newsweek magazine described the match as ―The brain’s last stand. ‖ The value of IBM’s
stock increased by $18 billion. Human champions studied Kasparov’s loss and were able to draw
a few matches in subsequent years, but the most recent human-computer matches have been
won convincingly by the computer.
Q 1c. Explain the concept of agent and environment
Ans:

1. An agent is anything that can perceive its environment through sensors and acts upon
that environment through effectors.
2. A human agent has sensory organs such as eyes, ears, nose, tongue and skin parallel to
the sensors, and other organs such as hands, legs, mouth, for effectors.
3. A robotic agent replaces cameras and infrared range finders for the sensors, and various
motors and actuators for effectors.
4. A software agent has encoded bit strings as its programs and actions.

Agent Terminology

 Performance Measure of Agent − It is the criteria, which determines how successful an


agent is.
 Behavior of Agent − It is the action that agent performs after any given sequence of
percepts.
 Percept − It is agent’s perceptual inputs at a given instance.
 Percept Sequence − It is the history of all that an agent has perceived till date.
 Agent Function − It is a map from the precept sequence to an action.

Artificial Intelligence Page 3


Q1d. Give the PEAS description of taxi’s task environment
Ans:
Agent Type Performance Environment Actuators Sensors
Measure
Taxi driver Safe, fast, legal, Roads, Other Steering, Cameras, sonar,
comfortable trip, traffic, accelerator, brake, speedometer,
maximize profits pedestrians, signal, horn, GPS, odometer,
customers display accelerometer,
engine sensors,
keyboard

Q1e. Explain the rational approach of AI


Ans:

In economics, game theory, decision theory, and artificial intelligence, a rational agent is an
agent that has clear preferences, models uncertainty via expected values of variables or functions
of variables, and always chooses to perform the action with the optimal expected outcome for
itself from among all feasible actions. A rational agent can be anything that makes decisions,
typically a person, firm, machine, or software.

Rational agents are also studied in the fields of cognitive science, ethics, and philosophy,
including the philosophy of practical reason.

Rationality is nothing but status of being reasonable, sensible, and having good sense of
judgment.
1. Rationality is concerned with expected actions and results depending upon what the
agent has perceived. Performing actions with the aim of obtaining useful information is an
important part of rationality.
2. Rationality of an agent depends on the following four factors –
a. The performance measures, which determine the degree of success.
Artificial Intelligence Page 4
b. Agent’s Percept Sequence till now.
c. The agent’s prior knowledge about the environment.
d. The actions that the agent can carry out.

The problem the agent solves is characterized by Performance Measure, Environment,


Actuators, and Sensors (PEAS).

Q1f. Explain the working of simple reflex agent.


Ans:

Sometimes we do not need an extensive analysis of the game state to figure out our next
move. At times, the game is simple enough that we can make a general strategy and represent
it as a set of rules. A rule would specify that a if a certain condition is met, a certain action
should be taken. An agent built using such rules is called a Simple Reflex Agent

This agent selects actions based on the agents current perception or the world and not based
on past perceptions.

For example if a mars lander found a rock in a specific place it needed to collect then it would
collect it, if it was a simple reflex agent then if it found the same rock in a different place it would
still pick it up as it doesn't take into account that it already picked it up.

This is useful for when a quick automated response is needed, humans have a very similar
reaction to fire for example, our brain pulls our hand away without thinking about any possibility
that there could be danger in the path of your arm. We call these reflex actions.

This kind of connection where only one possibility is acted upon is called a condition-action rule,
written as:

if hand is in fire then pull away hand

The simple reflex agent has a library of such rules so that if a certain situation should arise and it
is in the set of Condition-action rules the agent will know how to react with minimal reasoning.

 Simple Reflex agent choose actions only based on the current percept.
 They are rational only if a correct decision is made only based on current precept.
 Their environment is completely observable.

Condition-Action Rule − It is a rule that maps a state (condition) to an action.

Question 2

Q2a. List and explain performance measuring ways for problem solving.
Ans:
We can evaluate an algorithm’s performance in four ways:
1. Completeness: Is the algorithm guaranteed to find a solution when there is one?
2. Optimality: Does the strategy find the optimal solution,

Artificial Intelligence Page 5


3. Time complexity: How long does it take to find a solution?
4. Space complexity: How much memory is needed to perform the search?

Time and space complexity are always considered with respect to some measure of the problem
difficulty.
In AI, the graph is often represented implicitly by the initial state, actions, and transition model
and is frequently infinite. For these reasons, complexity is expressed in terms of three quantities:
1. b, the branching factor or maximum number of successors of any node;
2. d, the depth of the shallowest goal node (i.e., the number of steps along the path from the
root);
m, the maximum length of any path in the state space.

Q2b. Formulate the vacuum world problem


Ans:
The problem is formulated as:
1. States: The state is determined by both the agent location and the dirt locations. The agent is
in one of two locations, each of which might or might not contain dirt. Thus, there are 2 x 2 2
possible world states. A larger environment with n locations has n . 2 n states.
2. Initial state: Any state can be designated as the initial state.
3. Actions: In this simple environment, each state has just three actions: Left, Right, and Suck.
Larger environments might also include Up and Down.
4. Transition model: The actions have their expected effects, except that moving Left in the
leftmost square, moving right in the rightmost square, and Sucking in a clean square have no
effect. The complete state space is shown in the above figure.
5. Goal test: This checks whether all the squares are clean.
6. Path cost: Each step costs 1, so the path cost is the number of steps in the path

Q2c. Write the uniform cost search algorithm. Explain in short


Ans:

Uniform Cost Search is the best algorithm for a search problem, which does not involve the use of
heuristics. It can solve any general graph for optimal cost. Uniform Cost Search as it sounds
searches in branches which are more or less the same in cost.

Uniform Cost Search again demands the use of a priority queue. Recall that Depth First Search
used a priority queue with the depth up to a particular node being the priority and the path from
the root to the node being the element stored. The priority queue used here is similar with the
priority being the cumulative cost up to the node. Unlike Depth First Search where the maximum
depth had the maximum priority, Uniform Cost Search gives the minimum cumulative cost the
maximum priority.

Artificial Intelligence Page 6


The algorithm of Uniform Cost Search

Q2d. With suitable diagram explain the following concepts


i. shoulder ii. Global maximum iii. Local maximum
Ans:
Plateau(shoulder): A plateau is a flat area of the state-space landscape. It can be a flat local
maximum, from which no uphill exit exists, or a shoulder, from which progress is possible. A hill-
climbing search might get lost on the plateau.

Global maxima: It is the best possible state in the state space diagram. This because at this state,
objective function has highest value.

Local maxima: a local maximum is a peak that is higher than each of its neighboring states but
lower than the global maximum. Hill-climbing algorithms that reach the vicinity of a local
maximum will be drawn upward toward the peak but will then be stuck with nowhere else to
go

Q2e. How generic algorithm works?


Ans:
A genetic algorithm is a heuristic search method used in artificial intelligence and computing.

Artificial Intelligence Page 7


It is used for finding optimized solutions to search problems based on the theory of natural
selection and evolutionary biology. Genetic algorithms are excellent for searching through
large and complex data sets. They are considered capable of finding reasonable solutions to
complex issues as they are highly capable of solving unconstrained and constrained
optimization issues.

A genetic algorithm makes uses of techniques inspired from evolutionary biology such as
selection, mutation, inheritance and recombination to solve a problem. The most commonly
employed method in genetic algorithms is to create a group of individuals randomly from a given
population. The individuals thus formed are evaluated with the help of the evaluation function
provided by the programmer. Individuals are then provided with a score which indirectly
highlights the fitness to the given situation. The best two individuals are then used to create one
or more offspring, after which random mutations are done on the offspring. Depending on the
needs of the application, the procedure continues until an acceptable solution is derived or until
a certain number of generations have passed.

A genetic algorithm differs from a classical, derivative-based, optimization algorithm in two ways:

 A genetic algorithm generates a population of points in each iteration, whereas a classical


algorithm generates a single point at each iteration.
 A genetic algorithm selects the next population by computation using random number
generators, whereas a classical algorithm selects the next point by deterministic
computation.

Q2f. Explain the working of AND-OR search tree.


Ans:

Like A* algorithm here we will use two arrays and one heuristic function.
OPEN: It contains the nodes that has been traversed but yet not been marked solvable or unsolvable.
CLOSE: It contains the nodes that have already been processed.

Let us take the following example to implement the AO* algorithm.


Eg:

Step 1:
In the above graph the solvable nodes A,B,C,D,E,F and the unsolvable nodes are G,H. Take A as

Artificial Intelligence Page 8


the starting node. So place A into OPEN.
Ie. OPEN= A
CLOSE=(NULL)

Step2:
The children of A are B and C which are solvable. So place them into OPEN and place A into the
close.
OPEN= B C
CLOSE= A

Step 3:
Now process the nodes B and C. The children of B and C are to be place into OPEN. Also
remove B and C from OPEN and place them into CLOSE.
So OPEN= G D E ABC

Step 4:
As the nodes G and H are unsolvable, so place them directly into CLOSE and process the nodes D
and E.

i.e. OPEN= A

CLOSE= A B C G(o) D E H(o)

Step 5:
Now we have been reached at our goal state. So place F into CLOSE.
A B C G(O) D E H(O) F

Step 6
Success and exit.
AO* graph
Question 3

Q3a. List and explain the elements used to define the game formally.
Ans:
 A game can be formally defined as a kind of search problem with the following elements:
a. S0: The initial state, which specifies how the game is set up at the start.
b. PLAYER(s): Defines which player has the move in a state
c. ACTIONS(s): Returns the set of legal moves in a state.
d. RESULT(s, a): The transition model, which defines the result of a move.
e. TERMINAL-TEST(s): A terminal test, which is true when the game is over and false
f. TERMINAL STATES otherwise. States where the game has ended are called terminal states.
g. UTILITY(s, p): A utility function (also called an objective function or payoff
function),defines the final numeric value for a game that ends in terminal states for a
player p. In chess, the outcome is a win, loss, or draw, with values +1, 0, or 1/2. Some
games have a wider variety of possible outcomes; the payoffs in backgammon range from
0 to +192.

Artificial Intelligence Page 9


 A zero-sum game is (confusingly) defined as one where the total payoff to all players is
the same for every instance of the game. Chess is zero-sum because every game has
payoff of either 0 + 1, 1 + 0 or 1/2+ 1/2 .
 “Constant-sum” would have been a better term, but zero-sum is traditional and makes
sense if you imagine each player is charged an entry fee of 1/2.

Q3b. Write the minimax algorithm. Explain in short.


Ans:
1. Mini-max algorithm is a recursive or backtracking algorithm which is used in
decision-making and game theory. It provides an optimal move for the player
assuming that opponent is also playing optimally.
2. Mini-Max algorithm uses recursion to search through the game-tree.
3. Min-Max algorithm is mostly used for game playing in AI. Such as Chess, Checkers,
tic-tac-toe, go, and various tow-players game. This Algorithm computes the
minimax decision for the current state.
function minimax(node, depth, maximizingPlayer) is
if depth ==0 or node is a terminal node then
return static evaluation of node

if MaximizingPlayer then // for Maximizer Player


maxEva= -infinity
for each child of node do
eva= minimax(child, depth-1, false)
maxEva= max(maxEva,eva) //gives Maximum of the values
return maxEva

else // for Minimizer player


minEva= +infinity
for each child of node do
eva= minimax(child, depth-1, true)
minEva= min(minEva, eva) //gives minimum of the values
return minEva

Q3c. Explain the alpha-beta pruning with example


Ans:

 Alpha-beta pruning is a modified version of the minimax algorithm. It is an optimization


technique for the minimax algorithm.
 As we have seen in the minimax search algorithm that the number of game states it has to
examine are exponential in depth of the tree. Since we cannot eliminate the exponent, but
we can cut it to half. Hence there is a technique by which without checking each node of
the game tree we can compute the correct minimax decision, and this technique is called
pruning. This involves two threshold parameter Alpha and beta for future expansion, so it
is called alpha-beta pruning. It is also called as Alpha-Beta Algorithm.
 Alpha-beta pruning can be applied at any depth of a tree, and sometimes it not only
prune the tree leaves but also entire sub-tree.
 The two-parameter can be defined as:

Artificial Intelligence Page 10


1. Alpha: The best (highest-value) choice we have found so far at any point along the
path of Maximizer. The initial value of alpha is -∞.
2. Beta: The best (lowest-value) choice we have found so far at any point along the
path of Minimizer. The initial value of beta is +∞.
 The Alpha-beta pruning to a standard minimax algorithm returns the same move as the
standard algorithm does, but it removes all the nodes which are not really affecting the
final decision but making algorithm slow. Hence by pruning these nodes, it makes the
algorithm fast.

Q3d. Write the connectives used to form complex sentence of propositional logic. Give
example for each.
Ans:

 The syntax of propositional logic defines the allowable sentences. The atomic sentences
consist of a single proposition symbol.
 Each such symbol stands for a proposition that can be true or false.
 There are two proposition symbols with fixed meanings: True is the always-true
proposition and False is the always-false proposition.
 Complex sentences are constructed from simpler sentences, using parentheses and logical
connectives. There are five connectives in common use:
1. ¬ (not). A sentence such as ¬W1,3 is called the negation of W1,3. A literal is
either an atomic sentence (a positive literal) or a negated atomic sentence (a
negative literal).
2. ∧ (and). A sentence whose main connective is ∧, such as W1,3 ∧ P3,1, is called a
conjunction; its parts are the conjuncts. (The ∧ looks like an “A” for “And.”).
3. ∨ (or). A sentence using ∨, such as (W1,3∧P3,1)∨W2,2, is a disjunction of the
disjuncts (W1,3 ∧ P3,1) and W2,2. (Historically, the ∨ comes from the Latin “vel,”
which means “or.” For most people, it is easier to remember ∨ as an upside-down
∧.)

Artificial Intelligence Page 11


4. ⇒ (implies). A sentence such as (W1,3∧P3,1) ⇒ ¬W2,2 is called an implication (or
conditional). Its premise or antecedent is (W1,3 ∧P3,1), and its conclusion or
consequent is ¬W2,2. Implications are also known as rules or if–then statements.
The implication RULES symbol is sometimes written in other books as ⊃ or →.
5. ⇔ (if and only if). The sentence W1,3 ⇔ ¬W2,2 is a biconditional. Some other
books write this as ≡

Q3e. Explain the concept of knowledge base with example.


Ans:
 A knowledge-based system (KBS) is a form of artificial intelligence (AI) that aims to
capture the knowledge of human experts to support decision-making. ... The typical
architecture of a knowledge-based system, which informs its problem-solving method,
includes a knowledge base and an inference engine.
 A knowledge-based system may vary with respect to its problem-solving method or
approach. Some systems encode expert knowledge as rules and are therefore referred to
as rule-based systems. Another approach, case-based reasoning, substitutes cases for
rules. Cases are essentially solutions to existing problems that a case-based system will
attempt to apply to a new problem.
 Over the years, knowledge-based systems have been developed for a number of
applications. MYCIN, for example, was an early knowledge-based system created
to help doctors diagnose diseases. Healthcare has remained an important market
for knowledge-based systems, which are now referred to as clinical decision-
support systems in the health sciences context.
 Knowledge-based systems have also been employed in applications as diverse as
avalanche path analysis, industrial equipment fault diagnosis and cash
management.

Q3f. Write a short note on propositional theorem proving.


Ans:

 proving theorems is considered to require high intelligence


 if knowledge is represented by logic, theorem proving is reasoning
 theorem proving uses AI techniques, such as (heuristic) search
 (study how people prove theorems. Differently!)

We present here two techniques for logical theorem proving in propositional logic.

These are:

1. Semantic, and

2. Syntactic methods of theorem proving.

1. Semantic Method:

 The following notation will be used to represented a symbolic theorem, stating that
conclusion “c” follows from a set of premises p 1, p2…pn

Artificial Intelligence Page 12


 In this technique, we first construct a truth table representing the relationship of p 1 to pn
with “c”. Then we test the validity of the theorem by checking whether both the forward
and backward chaining methods to be presented shortly an hold good.

2. Syntactic Methods

The syntactic approach for theorem proving can be done in two ways, namely:

(i) By the method of substitution and

(ii) By Wang’s algorithm.

Question 4

Q4a. Explain the following with example


i. Atomic sentence ii. Complex sentence
Ans:
Atomic Sentence = predicate (term1,.....,termn)

or
term1 = term2
An atomic sentence is formed from a predicate symbol followed by list of terms.

Examples:
LargeThan(2,3) is false.
Brother_of(Mary,Pete) is false.
Married(Father(Richard),Mother(John)) could be true or false.

Note: Functions do not state facts and form no sentence:


- Brother(Pete) refers to John (his brother) and is neither true nor false

Brother_of(Pete,Brother(Pete)) is True.
Binary relation Function

Complex Sentences
To make complex sentence with connectives (just like in propositional logic).

Artificial Intelligence Page 13


More Examples
 Brother(Richard, John) ∧ Brother(John, Richard)
 King(Richard) ∨ King (john)
 King(John)=> ᆨ King(Richard)
 LessThan(plus(1,2),4)∧GreaterThan(1,2)
(Semantics are the same as in Propositional logic)

Q4b. Explain universal qualifier with example


Ans:
The universal quantifier is a symbol of symbolic logic which expresses that the statements within
its scope are true for everything, or every instance of a specific thing.
The symbol ∀, which appears as a vertically inverted “A”, is used as the universal quantifier.
Universal quantifiers are normally used in logic in conjunction with predicate symbols, which say
something about a variable or constant, in this case the variable being quantified.
The universal quantifier ∀ (which means “for all”), differs from the existential quantifier ∃ (which
means “there exists”, or in contrast to ∀, “for at least one”).
Note: Some logicians and logic texts do not make use of the ∀ symbol, and simply use the
notation (x) to indicate universal quantification. This site, however, will always use ∀.
Examples
For example, if the predicate symbol Mx is taken to mean “x is matter”, then we may formalize an
expression using a universal quantifier:
∀xMx
Translated back into English, this reads as “for every x, x is matter”, or more simply,
“everything is matter”.
Q4c. Define wumpus world problem in terms of first order logic.
Ans:
It is useful to have a good testing environment for verifying the methods being developed.
This environment needs to be simple enough to allow developing intuitions and quickly
discovering properties, but at the same time rich enough to pose some significant demands
of the problem solving abilities, and allow to formulate problems of various degree of
difficulty.

One of such“textbook” testing environment is the wumpus world. An intelligent agent


moves around this environment in search for gold, which she intends to carry out safely. The
agent is however faced with some dangers, such as the pits), into which she may fall, and
the title wumpus monster, which may eat the agent.
The agent may only turn right or left, move forward by one step, shoot a single arrow from
a bow (ahead), pick up gold, and leave the environment when she is in the starting position.

Artificial Intelligence Page 14


Q4d. Explain the following concepts
i. Universal Instantiation ii. Existential Instantiation
Ans:
In order to express rules for our quantifiers, we will need to do something to the symbols
ϕ and ψ that lets us pay special attention to variables. So, we allow for the following
convention. ϕx is a sentence where we are paying special attention to the free (not bound
by any quantifier in ϕx) occurrences of the variable x. ϕx(c) is a sentence where we have
replaced every free occurrence of the variable x with an occurrence of a constant c. So, ϕx
might contain some occurrences of c. But ϕx(c) will not contain any free occurrences of x.

Artificial Intelligence Page 15


The two simplest rules for us to learn with the quantifiers are as follow:
Universal Instantiation and Existential Generalization
1. Universal Instantiation (abbreviated UI), the argument form
∀xϕx ⊢ ϕx(c)
is a rule of direct inference
2. Existential Generalization (abbreviated EG), the argument form
ϕx(c) ⊢ ∃xϕx
The basic idea behind each one is very simple. Universal instantiation takes note of the fact
that if something is true of everything, then it must also be true of whatever particular
thing is named by the constant c. Existential generalization takes note of the fact that if
something is true of a particular constant c, then it's at least true of something.

Q4e. Write and explain a simple backward-chaining algorithm for first-order knowledge
bases.
Ans:

It is a crime for an American to sell weapons to hostile nations”:


American(x) ∧ Weapon(y) ∧ Sells(x,y,z) ∧ Hostile(z) ⇒ Criminal(x) .
2) “Nono ...hassomemissiles.” Thesentence ∃x Owns(Nono,x)∧Missile(x) istransformed into two
definite clauses by Existential Instantiation, introducing a new constant M1:

Owns(Nono,M1)
Missile(M1)
3) All of its missiles were sold to it by Colonel West

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


4) We will also need to know that missiles are weapons:

Missile(x) ⇒ Weapon(x)
5) enemy of America counts as “hostile”:

Enemy(x,America) ⇒ Hostile(x) .
6) West, who is American ...”:

Artificial Intelligence Page 16


American(West) .
7) The country Nono, an enemy of America

Enemy(Nono,America) .

Q4f. Explain the first order definite clause.


Ans:

 Definite clause grammar (DCG) is a way of expressing grammar, either for natural or
formal languages, in a logic programming language such as Prolog. It is closely related to
the concept of attribute grammars / affix grammars from which Prolog was originally
developed. DCGs are usually associated with Prolog, but similar languages such as
Mercury also include DCGs. They are called definite clause grammars because they
represent a grammar as a set of definite clauses in first-order logic.
 The term DCG refers to the specific type of expression in Prolog and other similar
languages; not all ways of expressing grammars using definite clauses are considered
DCGs. However, all of the capabilities or properties of DCGs will be the same for any
grammar that is represented with definite clauses in essentially the same way as in Prolog.
 The definite clauses of a DCG can be considered a set of axioms where the validity of a
sentence, and the fact that it has a certain parse tree can be considered theorems that
follow from these axioms. This has the advantage of making it so that recognition and
parsing of expressions in a language becomes a general matter of proving statements,
such as statements in a logic programming language.

Question 5

Q5a. Write PDDL description of an air cargo transportation planning problem.


Ans:

Artificial Intelligence Page 17


PDDL of an air cargo transportation planning problem.
Air cargo transport problem involving loading and unloading cargo and flying it from place to
place. The problem can be defined with three actions: Load, Unload, and Fly. The actions affect
two predicates: In(c, p) means that cargo c is inside plane p, and At(x, a) means that object x
(either plane or cargo) is at airport a. Note that some care must be taken to make sure the At
predicates are maintained properly. When a plane flies from one airport to another, all the cargo
inside the plane goes with it.

Q5b. Explain GRAPHPLAN algorithm.


Ans:

This section shows how to extract a plan directly from the planning graph, rather than just
using the graph to provide a heuristic. The GRAPHPLAN algorithm repeatedly adds a level
to a planning graph with EXPAND-GRAPH. Once all the goals show up as non mutex in the
graph, GRAPHPLAN calls EXTRACT-SOLUTION to search for a plan that solves the problem.
If that fails, it expands another level and tries again, terminating with failure when there is
no reason to go on.

Q5c. List various classical planning approaches. Explain any one.


Ans: The most popular and effective approaches to fully automated planning are:
1. Translating to a Boolean satisfiability (SAT) problem
2. Forward state-space search with carefully crafted heuristics

Artificial Intelligence Page 18


3. Search using a planning graph
1. Boolean satisfiability (SAT) problem:

The translation is a series of straightforward steps:


• Propositionalize the actions: replace each action schema with a set of ground actions
formed by substituting constants for each of the variables. These ground actions are not
part of the translation, but will be used in subsequent steps.
• Define the initial state: assert F0 for every fluent F in the problem’s initial state, and ¬F for
every fluent not mentioned in the initial state.
• Propositionalize the goal: for every variable in the goal, replace the literals that contain the
variable with a disjunction over constants. For example, the goal of having block A on
another block, On(A, x) ∧ Block(x) in a world with objects A,B and C, would be replaced by
the goal
(On(A,A) ∧ Block (A)) ∨ (On(A,B) ∧ Block (B)) ∨ (On(A,C) ∧ Block (C)) .
• Add successor-state axioms: For each fluent F, add an axiom of the form
Ft+1 ⇔ ActionCausesFt ∨ (Ft ∧ ¬ActionCausesNotFt) , where ActionCausesF is a disjunction of
all the ground actions that have F in their add list, and ActionCausesNotF is a disjunction of
all the ground actions that have F in their delete list.
• Add precondition axioms: For each ground action A, add the axiom A t ⇒ PRE(A)t, that is, if
an action is taken at time t, then the preconditions must have been true.
• Add action exclusion axioms: say that every action is distinct from every other action.
The resulting translation is in the form that we can hand to SATPLAN to find a solution.

Q5d. Explain the following terms:


i. Circumscription ii. Default logic
Ans:
i. Circumscription is a non-monotonic logic created by John McCarthy to formalize
the common sense assumption that things are as expected unless otherwise specified.
[1][2]
Circumscription was later used by McCarthy in an attempt to solve the frame
problem. To implement circumscription in its initial formulation, McCarthy augmented
first-order logic to allow the minimization of the extension of some predicates, where
the extension of a predicate is the set of tuples of values the predicate is true on. This
minimization is similar to the closed-world assumption that what is not known to be
true is false.

ii. Default logic: Default logic is a formalism in which default rules can be written to
generate contingent, nonmonotonic conclusions. A default rule looks like this:
Bird(x) : Flies(x)/Flies(x) .

Artificial Intelligence Page 19


This rule means that if Bird(x) is true, and if Flies(x) is consistent with the knowledge
base, then Flies(x) may be concluded by default. In general, a default rule has the form
P: J1, . . . , Jn/C
where P is called the prerequisite, C is the conclusion, and Ji are the justifications—if
any one of them can be proven false, then the conclusion cannot be drawn. Any
variable that appears in Ji or C must also appear in P. The Nixon-diamond example can
be represented in default logic with one fact and two default rules:
Republican(Nixon) ∧ Quaker(Nixon) .
Republican(x) : ¬Pacifist (x)/¬Pacifist (x) .
Quaker(x) : Pacifist (x)/Pacifist (x) .

Q5e. Write a short note on description logics.


Ans:
A Uniform Resource Identifier has some meaning because someone published that
it has that meaning and because people use it with that meaning. This works, but we
want more. We would like to have meanings that allow a computer to do some
inference.
Modern ontology languages such as OWL are based on description logics. A
description logic is used to describe classes, properties, and individuals. One of the
main ideas behind a description logic is to separate
 a terminological knowledge base that describes the terminology, which should
remain constant as the domain being modelled changes, and
 an assertion knowledge base that describes what is true in some domain at
some point in time.
Usually, the terminological knowledge base is defined at the design time of the system
and defines the ontology, and it only changes as the meaning of the vocabulary
changes, which should be rare. The assertion knowledge base usually contains the
knowledge that is situation-specific and is only known at run time.
Q5f. Explain semantic network with example
Ans:
A semantic network is a graphic notation for representing knowledge in patterns of interconnected nodes.
Semantic networks became popular in artificial intelligence and natural language processing only because
it represents knowledge or supports reasoning. These act as another alternative for predicate logic in a
form of knowledge representation.
The structural idea is that knowledge can be stored in the form of graphs, with nodes representing objects
in the world, and arcs representing relationships between those objects.
 Semantic nets consist of nodes, links and link labels. In these networks diagram, nodes appear in
form of circles or ellipses or even rectangles which represents objects such as physical objects,
concepts or situations.
 Links appear as arrows to express the relationships between objects, and link labels specify
relations.
 Relationships provide the basic needed structure for organizing the knowledge, so therefore
objects and relations involved are also not needed to be concrete.
 Semantic nets are also referred to as associative nets as the nodes are associated with other nodes
Example
 Representing data
 Revealing structure (relations, proximity, relative importance)
 Supporting conceptual edition

Artificial Intelligence Page 20


 Supporting navigation

---------------------------------------

Artificial Intelligence Page 21

You might also like