


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Answer any TWO questions. Examiners: Dr. J. Stynes Dr. J. O’Brien Dr J. Keating
1 (a) Water jugs A and B have capacity 4 and 7 litres respectively. Assume the following constraints: A and B are initially empty; the jugs are irregularly shaped so it is not possible to measure any intermediate amount of water in the jug; all or part of the contents of a jug may be poured into the other jug or emptied down the drain; a tap can be used to fill a jug with water. Does there exist a sequence of pouring which leaves exactly 5 litres of water in jug B?
(i) Represent this as a state space search problem. List the operators and apply Depth First Search (show the trace) to find a solution. (13 marks)
(ii) Model this as a production system. Write the production rules and describe a control strategy that finds a solution. There is no need to find a solution. (10 marks)
(b) In the following AND-OR graph, assume that all leaves are solvable terminal nodes, arc cost is uniformly 1 and internal nodes are labelled with their heuristics.
(i) Briefly describe Nilsson’s algorithm to find a minimal cost solution tree for an AND-OR graph and apply it to the given graph. (12 marks)
(ii) Find a minimal cost solution tree for the graph. Why did the algorithm fail to produce a minimal cost solution tree in this case? (5 marks)
(iii) Under which other circumstances may the algorithm fail to produce an optimal solution tree? Illustrate with examples. (10 marks)
2 (a) append([],L,L). append([X|T],L,[X|T1]):-append (T,l,T1).
(i) Describe the behaviour of the append Prolog predicate in processing ?-append([a,b,c,d,e,f],[1,2],L). (5 marks)
(ii) The append predicate can be made more efficient if we used a difference list representation. What is a difference list representation? Rewrite the append predicate using this representation and trace its execution in appending the list [x,y] to the list [a,b,c,d,e,f]. (10 marks)
(b) Given the following Prolog code:
s
a b
c d e
f
m l
p q
i k
g h
n
3 (a) In predicate logic,
(i ) Transform the following expression into clause form: ( ∀ b ∃ a p(b,a) ) → ( ¬∃ a { ∀ b [ q(a,b) ∨ ¬ p(a,b) ] } ) (8 marks)
(ii) Formulate the following as first order predicate calculus formulas and use the method of resolution and refutation to determine the validity of the conclusion. During resolution, why is an expression involving a variable never unified with that variable? (10 marks) “ Anyone who can read is literate. Dolphins are not literate. Some dolphins are intelligent. Therefore some who are intelligent can not read.”
(iii) Suppose you are given the following axioms: ∀ x ( ¬ equal(x,x+1)) equal(2,3) Prove that all apples are oranges. Why were you able to do this? (7 marks)
(b) Why are standard probability models unsuitable for performing medical diagnosis given observations of a patient’s symptoms? Briefly discuss one alternative approach to handling such uncertainty. Explain how uncertainty is propagated through the system, i.e., how are new uncertain beliefs/evidence combined? Illustrate with examples. (15 marks)
(c) How can quantification be represented in semantic nets? For example, how would you represent the following sentences using semantic nets? (i) All postmen have been bitten by a dog. (ii) Some postmen are bitten by every dog. (iii) Pat the postman was bitten by my dog. (10 marks)