Part II-Problems, Problem Spaces and Search
Part II-Problems, Problem Spaces and Search
7 (x,y) if x+y >= 4 and y >0 (4, y-(4-x)) Pour water from the 3 –
gallon jug into the 4 –gallon
jug until the 4-gallon jug is full
8 (x, y) if x+y >= 3 and x>0 (x-(3-y), 3) Pour water from the 4-gallon jug
into the 3-gallon jug until the 3-
gallon jug is full
9 (x, y) if x+y <=4 and y>0 (x+y, 0) Pour all the water from the 3-
gallon jug into the 4-gallon jug
10 (x, y) if x+y <= 3 and x>0 (0, x+y) Pour all the water from the 4-
gallon jug into the 3-gallon jug
2 0
Ajay Prasad, Assistant Professor
Dept of CSE, School of Engineering, Sir Padampat Singhania University
Formal Description of the problem
S, S0, G, A:S->S
(4,0) (0,3)
(4,0)
(4,3)
Start: ON(C,A)
• Following operators A
are available: C B
A B C
• CLEAR(x) [ block x
Goal:
has nothing on it]-> ON(B,C) and
ON(A,B)
ON(x, Table) ON(B,C) and ON(A,B)
• CLEAR(x) and
CLEAR(y) -> ON(B,C) ON(A,B)
ON(x,y) [ put x on y]
CLEAR(A) ON(A,B)
ON(B,C)
CLEAR(A) ON(A,B)
• Examples:
– Finding a consistent interpretation for the sentence
“The bank president ate a dish of pasta salad with the
fork”. We need to find the interpretation but not the
record of the processing.
– Water jug : Here it is not sufficient to report that we
have solved , but the path that we found to the state
(2,0). Thus the a statement of a solution to this
problem must be a sequence of operations ( Plan)
that produces the final state.
• Two examples:
– Chess: Knowledge is required to constrain the search for a
solution
– Newspaper story understanding: Lot of knowledge is required
even to be able to recognize a solution.
• Consider a problem of scanning daily newspapers to
decide which are supporting the democrats and which are
supporting the republicans in some election. We need lots
of knowledge to answer such questions as:
– The names of the candidates in each party
– The facts that if the major thing you want to see done is have
taxes lowered, you are probably supporting the republicans
– The fact that if the major thing you want to see done is improved
education for minority students, you are probably supporting the
democrats.
– etc