0% found this document useful (0 votes)
10 views

ai-unit3

The document discusses classical planning and reasoning with uncertain knowledge, focusing on the Planning Domain Definition Language (PDDL) for representing actions and states in planning problems. It covers various planning algorithms, including forward and backward search, partial-order planning, and the construction of planning graphs, along with the basics of probability theory and Bayesian networks for managing uncertainty. Key concepts include action schemas, state representation, goal satisfaction, and the use of probabilistic assertions in decision-making.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

ai-unit3

The document discusses classical planning and reasoning with uncertain knowledge, focusing on the Planning Domain Definition Language (PDDL) for representing actions and states in planning problems. It covers various planning algorithms, including forward and backward search, partial-order planning, and the construction of planning graphs, along with the basics of probability theory and Bayesian networks for managing uncertainty. Key concepts include action schemas, state representation, goal satisfaction, and the use of probabilistic assertions in decision-making.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 36

UNIT-3:

PLANNING AND REASONING


WITH UNCERTAIN KNOWLEDGE
Classical Planning
- Task of finding a sequence of actions to
accomplish a
goal in a discrete, deterministic, static, fully
observable environment
-Factored representation using a family of
languages called PDDL, the Planning Domain
Definition Language
-Allows us to express all actions with a single
action
schema, and does not need domain-specific
knowledge.
-Basic PDDL can handle classical planning
domains, and extensions can handle non-classical
domains that are continuous, partially
observable, concurrent, and multi-agent
In PDDL, a state is represented as a
conjunction of ground atomic fluents(“ground”
means no variables, “fluent” means an aspect of
the world that changes over time)
“ground atomic” means there is a single
predicate, and if there are any arguments, they
must be constants
Example,At(Truck1,Madurai)^At(Truck2,Chenn
ai) could represent a state in a package delivery
Problem
PDDL uses database semantics: the closed-
world assumption means that any fluents that
are not mentioned are false,and the unique
names assumption means that Truck1 and
Truck2 are distinct.
An action schema represents a family of ground
actions. For example, here is an action schema
for flying a plane from one location to another:
Action(Fly(p,from,to),
PRECOND:At(p,from) ^Plane(p)^Airport(from)

^Airport(to)
EFFECT: ┐At(p, from)^At(p,to))
The precondition and the effect are each
conjunctions of literals (positive or negated
atomic sentences). We can choose constants to
instantiate the variables, yielding a ground
(variable-free) action
A ground action a is applicable in state s if s
entails the precondition of a; that is, if every
positive literal in the precondition is in s and
The result of executing applicable action a in
state s is defined as a state s’ which is
represented by the set of fluents formed by
starting with s
Removing the fluents that appear as negative
literals in the action’s effects (DEL(a)), and
adding the
fluents that are positive literals in the action’s
effects (ADD(a)): RESULT(s; a) = (s-DEL(a)) U
ADD(a) :
A set of action schemas serves as a definition of
a planning domain. A specific problem within the
domain is defined with the addition of an initial
state and a goal.
The initial state is a conjunction of ground
fluents (with the keyword Init), The goal is just
Example domain: The blocks world
This domain consists of a set of cube-shaped
blocks placed on an arbitrarily-large table.The
blocks can be stacked, but only one block can fit
directly on top of another.
A robot arm can pick up a block and move it to
another position, either on the table or on top of
another block. The arm can pick up only one
block at a time, so it cannot pick up a block that
has another one on top of it.
A typical goal to get block A on B and block B
on C
We use On(b,x) to indicate that block b is
on x, where x is either another block or the
table
The action for moving block b from the
top of x to the top of y will be Move(b,x,y)
Basic PDDL does not allow quantifiers, so
instead we introduce a predicate Clear(x)
that is true when nothing is on x.
The action Move moves a block b from x
to y if both b and y are clear. After the
move is made, b is still clear but y is not.
Action(Move(b,x,y);
PRECOND:On(b,x)^Clear(b)^Clear(y);
EFFECT:On(b,y)^Clear(x)^ ┐On(b,x)^
This does not maintain Clear properly
when x or y is the table. When x is the
Table, this action has the effect
Clear(Table), but the table should not
become clear;
When y=Table, it has the precondition
Clear(Table), but the table does not have
to be clear for us to move a block onto it.
To fix this, we do two things.
First, we introduce another action to
move a block b from x to the table:
Action(MoveToTable(b,x),
PRECOND:On(b,x)^Clear(b),
Second, we take the interpretation of Clear(x)
to be “there is a clear space on x to hold a
block.” Under this interpretation, Clear(Table)
will always be true.
The only problem is that nothing prevents the
planner from using Move(b,x,Table) instead of
MoveToTable(b,x)
Algorithms for Classical Planning
Planning problem provides an obvious way to
search from the initial state through the space of
states, looking for a goal.
A nice advantage of the declarative
representation of action schemas is that we can
also search backward from the goal, looking for
the initial state
A third possibility is to translate the problem
Forward state-space search for planning

We can solve planning problems by


applying any of the heuristic search
algorithms
The states in this search state space are
ground states, where every fluent is either
true or not.
The goal is a state that has all the
positive fluents in the problem’s goal and
none of the negative fluents.
The applicable actions in a state,
Actions(s), are
To determine the applicable actions we unify
the current state against the preconditions of
each action schema.
For each unification that successfully results in
a substitution, we apply the substitution to the
action schema to yield a ground action with no
variables
It is a requirement of action schemas that any
variable in the effect must also appear in the
precondition; that way, we are guaranteed that
no variables remain after the substitution.
Each schema may unify in multiple ways, If an
action has multiple literals in the precondition,
then each of them can potentially be matched
against the current state in multiple ways.
At first, it seems that the state space might be
too big for many problems. Consider an air cargo
problem, 10 airports, where each airport initially
has 5 planes and 20 pieces of cargo. The goal is
to move all the cargo at airport A to airport B.
There is a 41-step solution to the problem
This solution can be difficult because the
average
branching factor is huge: each of the 50 planes
can fly to 9 other airports, and each of the 200
packages can be either unloaded (if it is loaded)
or loaded into any plane at its airport (if it is
unloaded). So in any state there is a minimum of
450 actions (when all the packages are at
airports with no planes) and a maximum of
10,450 actions.
Backward search for planning
Also called regression search, we start at
the goal and apply the actions backward
until we find a sequence of steps that
reaches the initial state.
At each step we consider relevant actions
(in contrast to forward search, which
considers actions that are applicable),
which reduces the branching factor
significantly, particularly in domains with
many possible actions.
A relevant action is one with an effect
that unifies with one of the goal literals,
but with no effect that negates any part of
Given a goal g and Regression an action
a, the regression from g over a gives us a
state description g’ whose positive and
negative literals are given by
POS(g’) = (POS(g) - ADD(a)) U
POS(Precond(a))
NEG(g’) = (NEG(g) - DEL(a)) U
NEG(Precond(a))
The preconditions must have held before,
or else the action could not have been
executed, but the positive/negative literals
that were added/deleted by the action
need not have been true before.
These equations are straightforward for
For example,
suppose the goal is to deliver a specific piece
of cargo to CHN: At(C2,CHN). The Unload action
schema has the effect At(c,a). When we
unify that with the goal, we get the substitution
{c=C2;a=CHN}; applying that substitution to
the schema gives us a new schema which
captures the idea of using any plane that is at
CHN:
Action(Unload(C2, p’, CHN),
PRECOND:In(C2,p’)^At(p’,CHN)^ Cargo(C2)^
Plane(p’) ^Airport(CHN)
EFFECT:At(C2,CHN)^˥In(C2,p’))
The regressed state description gives us a new
goal
G’=In(C2,p’)^At(p’,CHN)^Cargo(C2)^Plane(p’)
Partial-order planning
Represents a plan as a graph rather than a linear
sequence:
Each action is a node in the graph, and for each
precondition of the action there is an edge from
another action (or from the initial state) that indicates
that the predecessor action establishes the
precondition.
We search in the space of plans rather than world
states, inserting actions to satisfy conditions.
In the 1980s and 1990s, partial-order planning was
seen as the best way to handle planning problems with
independent subproblems.
By 2000, forward-search planners had developed
excellent heuristics that allowed them to efficiently
discover the independent subproblems that partial order
planning was designed for.
Partial-order planners are not competitive on fully
automated classical planning problems. For some
specific tasks, such as operations scheduling, partial-order
planning with domain-specific heuristics is the technology
of choice.
Partial-order planning is also often used in domains
where it is important for humans to understand the plans
For example, operational plans for spacecraft and Mars
rovers are generated by partial-order planners and are then
checked by human operators before being uploaded to
the vehicles for execution
Construction of Planning Graph
-is a data structure to represent and analyze the state
space of a planning problem
-goal is to find a sequence of actions that transforms
an initial state into a desired goal state
-Define the Initial State and Goal State
- Identify the initial state of the world and the goal
state you want to achieve and these states should be
represented as propositions or predicates
-Create the Level 0
-Represent the initial state as the first level of the
planning graph and each proposition or predicate in
the initial state becomes a node in the graph
- Expand Levels
- expanding levels until you reach a level where
the goal state is satisfied or no further
expansion is possible
-Actions and Preconditions
- Introduce actions, Each action has preconditions
(things that must be true before the action can be
applied) and effects (things that become true after
the action is applied).
- For each action, create a new level in the graph
with nodes representing the propositions that are
true after applying the action
- Ensure that the preconditions of an action are
satisfied in the previous level before action
-Mutex Relations
- Identify and represent mutex relations
- two actions might be mutex if they try to modify
the same variable in incompatible ways
-Goal Satisfaction
- Continue expanding levels until the goal state
propositions are satisfied
- This may involve applying a sequence of actions to
achieve the desired state
-Optimization
- could involve pruning unnecessary nodes or
refining the graph structure to improve efficiency
Once the planning graph is constructed, you can use a
search algorithm to find a valid plan.
Uses of Planning Graph
- Graph-Based Representation
- Search Space Reduction
- Action Pruning
- Incremental Construction
- Goal Recognition
- Efficient Plan Extraction
- Heuristic Information
- Parallel Planning
- Debugging and Analysis
Planning graphs serve as a foundational structure in
classical planning algorithms, aiding in the efficient
exploration of the state space and the derivation of
plans for achieving goals in various domains
Basic Probability Notation
-For our agent to represent and use probabilistic
information, we need a formal language,
-probabilistic assertions are about possible worlds and
talk about how probable the various worlds are
-The basic axioms of probability theory say that every
possible world has a probability between 0 and 1 and
that the total probability of the set of possible worlds
is 1
0 ≤ P(ω) ≤ 1 for every ω and ∑ P(ω) = 1
ω ∈Ω
Ω - sample space, and ω - elements of the space (that
is, particular possible worlds)
Probabilistic assertions and queries are not usually
about particular possible worlds, but about sets of
them.
For example, we might ask for the probability that
the two dice add up to 11, the probability that doubles
are rolled, and so on
In probability theory, these sets are called events and
in Event logic, a set of worlds corresponds to a
proposition in a formal language
The probability associated with a proposition is
defined to be the sum of the probabilities of the worlds
in which it holds
For any proposition φ, P(φ) = ∑ P(ω)
ω ∈φ
For example, when rolling fair dice, we have
P(Total = 11) = P((5, 6)) + P((6, 5))
= 1/36 + 1/36
= 1/18
Probabilities such as P(Total = 11) and P(doubles)
are called unconditional or prior probabilities.
Conditional or posterior probability of rolling
doubles given that the first die is a 5. This probability
is written P(doubles | Die1 = 5)
Conditional probabilities are defined in terms of
unconditional probabilities as follows: for any
propositions a and b
P(a|b)= P(a ∧ b) / P(b) which holds whenever
P(b)>0
Independence
Independence between variables X and Y can be
written as follows (again, these are all equivalent):
P(X |Y)=P(X) or P(Y |X)=P(Y) or P(X,Y)=P(X)P(Y)
Independence assertions are usually based on
knowledge of the domain.
If the complete set of variables can be divided into
independent subsets, then the full joint distribution can
be factored into separate joint distributions on those
subsets.
For example, the full joint distribution on the
outcome of n independent coin flips, P(C1,…..,Cn),
has 2n entries, but it can be represented as the product
of n single-variable distributions P(C i).
Bayes’ Rule
The product rule can be written in two forms:
P(a ∧ b) = P(a|b)P(b) and P(a ∧ b) = P(b|a)P(a)
Equating the two right-hand sides and dividing by
P(a)
P(b | a) = P(a | b)P(b) / P(a)

We perceive as evidence the effect of some


unknown cause and we would like to determine that
cause
P(cause|effect) = P(effect|cause)P(cause)/P(effect)

The doctor knows P(symptoms | disease) and wants


to derive a diagnosis, P(disease | symptoms)
For example, a doctor knows that the disease
meningitis causes a patient to have a stiff neck, 70%
of the time. The doctor also knows some
unconditional facts: the prior probability that any
patient has meningitis is 1/50,000 and the prior
probability that any patient has a stiff neck is 1%.
Letting s be the proposition that the patient has a stiff
neck and m be the proposition that the patient has
meningitis, we have
P(s | m) = 0.7
P(m) = 1/50000
P(s) = 0.01
P(m | s) = P(s | m)P(m) / P(s)
= (0.7 × 1/50000) / 0.01 = 0.0014
Bayesian network
Data structure to represent the dependencies among
variables.
Can represent essentially any full joint probability
distribution and in many cases can do so very
concisely
Directed graph in which each node is annotated with
quantitative probability information
1. Each node corresponds to a random variable,
which may be discrete or continuous.
2. Directed links or arrows connect pairs of
nodes. If there is an arrow from node X to node Y, X is
said to be a parent of Y. The graph has no directed
cycles and hence is a directed acyclic graph, or DAG.
3. Each node Xi has associated probability
information θ(Xi | Parents(Xi)) that quantifies the
effect of the parents on the node using a finite number
of parameters
The topology of the network—the set of nodes and
links—specifies the conditional independence
relationships that hold in the domain
The intuitive meaning of an arrow is typically that X
has a direct influence on Y, which suggests that causes
should be parents of effects.
It is usually easy for a domain expert to decide what
direct influences exist in the domain—much easier, in
fact, than actually specifying the probabilities
themselves.
Once the topology of the Bayes net is laid out, we
need only specify the local probability information for
each variable, in the form of a conditional distribution
given its parents.
The full joint distribution for all the variables is
defined by the topology and the local probability
information
Conditional independence of Toothache and Catch,
given Cavity, is indicated by the absence of a link
between Toothache and Catch.
Intuitively, the network represents the fact that
Cavity is a direct cause of Toothache and Catch,
whereas no direct causal relationship exists between
Toothache and Catch.
Burglar alarm
-burglar alarm installed at home
-fairly reliable at detecting a burglary, but is
occasionally set off by minor earthquakes
- two neighbors, John and Mary, who have promised
to call you at work when they hear the alarm.
-John nearly always calls when he hears the alarm, but
sometimes confuses the telephone ringing with the
alarm and calls then, too
- Mary, on the other hand, likes rather loud music and
often misses the alarm altogether.
- Given the evidence of who has or has not called, we
would like to estimate the probability of a burglary
 The network structure shows that burglary and
earthquakes directly affect the probability of the
alarm’s going off, but whether John and Mary call
depends only on the alarm.
The local probability information attached to each
node in Figure takes the form of a conditional
probability table (CPT).
Each row in a CPT contains the conditional
probability of each node value for a conditioning case
which is just a possible combination of values for the
parent nodes—a miniature possible world
A node with no parents has only one row,
representing the prior probabilities of each possible
value of the variable.

You might also like