Language:EN
Pages: 10
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
understanding the meta symbols and

Understanding the meta symbols and

3-16. ARTIFICIAL INTELLIGENCE — MODEL ANSWERS

1. The question tests basic understanding of Prolog, data structures and recursion. It should have been relatively straightforward for anyone who and been to the lectures and done all the lab exercises. The ‘nasty’ was in Part (b), where the question does not specify what to do with the country. There were various different solutions, all of which were acceptable: either hardwire it, with country( C ) before check eligible( S, C, R ); define check team/3 rather than /2, as here, which makes part (c) slightly easier; or leave it as an instantiated variable when you first call it, and it will be instantiated if the call succeeds (and in part(c) check the value that it is instantiated to is the country you want). Part (d) required the >= checks and to terminate when points was zero.

countgps( [], Country, Sum ) :-
Sum >= 2.

countgps( [GP|GPs], Country, SoFar ) :-person( GP, Country, _, _ ), !, SoFar1 is SoFar + 1,
countgps( GPs, Country, SoFar1 ).

3-16. Artificial Intelligence — MODEL ANSWERS
1/10

length( Squad1, L ),
L < 26, !.

check_length( _, [too_big] ).

check_eligible( [H|T], C, R ) :-
eligible( H, C ), !,
check_eligible( T, C, R ).

check_eligible( _, [ineligible_player] ).

d) points2scores( 0, [] ).

points2scores( N, [goal|L] ) :-
N >= 7,
NewN is N - 7,
points2scores( NewN, L ).

a) state – Prolog term
Node = state plus possibly some more information Path = list of nodes
Graph = list of Paths

b)

A graph G can be searched for a Solution Path SP, if

A graph G can be searched for a Solution Path SP, if

Pick a path P in G, AND

Compute the set N′of all the new nodes reachable from N, AND

Graph G+can be searched for a Solution Path SP.

ibbs_search( Graph, SolutionPath, Beam ) :-

search( Graph, [Node|Path], _ ) :-

choose( [Node|Path], Graph, _ ),

one_step_extensions( Path, NewPaths ),

add_to_paths( NewPaths, OtherPaths, GraphPlus, Beam ),

prune( AllGraph, GraphPlus, Beam ).

insert_in_order( [], Graph, Graph ).

insert_one( Path, [], [Path] ).

prune( [], _, [] ) :- !.

3-16. Artificial Intelligence — MODEL ANSWERS

cImperial College London

4/10

3. The question was a gift for going to the lectures and doing the labs. The tricky part was actually having an extra bit of Prolog to write with some mathematical operations in it, but anything sensible that looked Prolog would have been acceptable, for example sqrt( XX, X) rather than X is sqrt( XX ), for example. The other issue was making sure that the right justification for the behaviour of A* was given for part (f), and a proper example was given for part (g).


PG′ = i=0�P′i

P′0= {[(S,0)]}
P′i+1= {[(n,c+e) | p] | ∃p ∈ P′i.∃op ∈ Op.op(frontier(p)) = (n,e)∧gcost(p) = c}

straight-line, go this distance, and maybe more, therefore never over-estimate

manhattan, go at least X1-X2 in X direction and Y1-Y2 in y-direction, and maybe more, therefore never over-estimate

sld( (X1,Y1), (X2,Y2), H ) :-

Dx is (X1 - X2) * (X1 - X2),

(Y1 > Y2 -> Dy is Y1 - Y2 ; Dx is Y2 - Y1),

H is Dx + Dy.

f)

A* will expand all those nodes to the left of the f∗bar

Therefore the ‘trick’ is to get as many nodes to the right of the f∗

bar ...

But with h2

So straight-line distance is likely to be more efficient, since hstraight−line ≤ hmanhattan

g)






Apply heuristic evaluation to all siblings at ply (assume these are MIN nodes)
Terminate (prune) exploration of parent if any of their values is greater

than or equal to the beta cutoff


Search stopped below any MIN node having a beta value less than
Search stopped below any MAX node having an alpha value greater

Example: any sensible correct example will do

b) yes X bound to a, Y bound to a

yes X bound to Z, Y bound to Z

c)

property2(b)
property3(c)
prerelation1(a,b)
prerelation2(a,c)

e)
7/10
3-16. Artificial Intelligence — MODEL ANSWERS

5. Understanding the meta symbols and |= can be a conceptually a bit tricky. Part (b) was manageable for anyone who had been to the lectures and tried out the KE proofs in the tutorials and tried to implement the KE proof engine in the labs. Part (c) was trickier because firstly, it required thinking about open branches rather than closed KE- trees, and secondly it required an exhaustive analysis of the various combinations. The insight was to understand that saying yes or no to a question meant either adding the formula or its negation (respectively) to the root of the tree, and that there were eight such combinations, from yes-yes-yes to no-no-no. Then, for each of the combinations, see if there was a KE tree with an open branch, if there was, then you had an assignment of truth values to the variables that made all the assertions true (and therefore consistent). The reasoning used here is just a short cut for that. Finally, in part (d), full marks required keeping track of the worlds labelling the formulas in the application of the modal rules, and taking care of the order in which they were applied, i.e. possibility before necessity (i.e. you can’t just go around making up worlds you want propositions to be true in, unless you’re a Brexit fantasist).

soundness – ⊢→|= – if prove a theorem then it is an entailment completeness – |=→⊢ – if there is an entailment then it is provable Translate and prove:

1

¬lockdoor → (forget ∨lostkey) lostkey → trouble
memory → ¬forget memory

2
3
4
5

¬(lockdoor ∨trouble)¬lockdoor
¬trouble
¬forget
(forget ∨lostkey) lostkey

negated conclusion

6
7
8
9
10

β, 9, 8

11

trouble

no, yes or no, no

To see this, suppose we say yes to q∨¬(p∨r). Then we must say yes to p → q.

¬(q∨¬(p∨r)) q

negated conclusion

10/10

¬q
¬¬(p∨r)

d)

1 : ¬p
2 : □p

3 : ¬p 3 : p

ness, 4

×

5, 6

negated conclusion

α, 1

6

ness, 3

5, 6

3-16. Artificial Intelligence — MODEL ANSWERS

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Nicole Hart

PageId: DOCE9F2C1F