This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
teaching:is:ind-solutions [2020/06/24 15:08] Franconi Enrico [12.5] |
teaching:is:ind-solutions [2020/06/24 17:11] (current) Franconi Enrico [12.9] |
||
---|---|---|---|
Line 66: | Line 66: | ||
ask two_doors_east(r107, | ask two_doors_east(r107, | ||
===== 12.6 ===== | ===== 12.6 ===== | ||
+ | (a) | ||
+ | yes(R) ⇐ two_doors_east(r107, | ||
+ | | ||
+ | imm_east(E1, | ||
+ | | ||
+ | yes(R) ⇐ imm_east(r017, | ||
+ | | ||
+ | | ||
+ | | ||
+ | yes(R) ⇐ imm_west(M1, | ||
+ | | ||
+ | | ||
+ | | ||
+ | yes(R) ⇐ imm_east(r105, | ||
+ | | ||
+ | | ||
+ | yes(R) ⇐ imm_west(R, | ||
+ | | ||
+ | | ||
+ | yes(r103) ⇐ | ||
+ | | ||
+ | (b) | ||
+ | | ||
+ | yes(R) ⇐ next_door(R, | ||
+ | | ||
+ | | ||
+ | yes(R) ⇐ imm_east(R, | ||
+ | | ||
+ | | ||
+ | yes(R) ⇐ imm_west(r107, | ||
+ | | ||
+ | | ||
+ | yes(r109) ⇐ | ||
+ | | ||
+ | Another derivation by backtracking to (*) and selecting another clause to resolve against: | ||
+ | |||
+ | yes(R) ⇐ next_door(R, | ||
+ | | ||
+ | | ||
+ | yes(R) ⇐ imm_west(R, | ||
+ | | ||
+ | | ||
+ | yes(r105) ⇐ | ||
+ | |||
+ | |||
+ | < | ||
+ | |||
+ | ...similar to (d)... | ||
+ | |||
+ | (d) | ||
+ | |||
+ | yes(R) ⇐ west(r107, | ||
+ | | ||
+ | | ||
+ | yes(R) ⇐ imm_west(r107, | ||
+ | | ||
+ | | ||
+ | yes(r109) ⇐ | ||
+ | |||
+ | Another derivation by backtracking to (*) and selecting another clause to resolve against: | ||
+ | |||
+ | yes(R) ⇐ west(r107, | ||
+ | | ||
+ | imm_west(W1, | ||
+ | west(M1, | ||
+ | | ||
+ | yes(R) ⇐ imm_west(r107, | ||
+ | | ||
+ | | ||
+ | | ||
+ | yes(R) ⇐ west(r109, | ||
+ | resolve with west(W2,E2) ⇐ imm_west(W2, | ||
+ | | ||
+ | yes(R) ⇐ imm_west(r109, | ||
+ | | ||
+ | | ||
+ | yes(r111) ⇐ | ||
===== 12.8 ===== | ===== 12.8 ===== | ||
+ | |||
+ | (a) | ||
+ | f(X, | ||
+ | |||
+ | |||
+ | (b) | ||
+ | yes(c(l, | ||
+ | |||
+ | |||
+ | < | ||
+ | |||
+ | append(c(l, | ||
+ | | ||
===== 12.9 ===== | ===== 12.9 ===== | ||
+ | |||
+ | (a) | ||
+ | {Z/ | ||
+ | |||
+ | (b) | ||
+ | {W/ | ||
+ | |||
+ | < | ||
+ | |||
+ | {P/ | ||
===== 12.14 ===== | ===== 12.14 ===== | ||
+ | (a) Here is a top-down derivation: | ||
+ | |||
+ | yes(Y) ⇐ adj(b, | ||
+ | choose clause 3, with { A/ | ||
+ | | ||
+ | yes(Y) ⇐ ap(F1, | ||
+ | choose clause 2, under | ||
+ | { F1/ | ||
+ | | ||
+ | yes(Y) ⇐ ap(T2, | ||
+ | choose clause 1 under { T2/ | ||
+ | | ||
+ | yes(b) ⇐ | ||
+ | |||
+ | (b) Yes, there is one more answer . | ||
+ | at (*) | ||
+ | choose clause 2 under | ||
+ | { T2/ | ||
+ | | ||
+ | yes(Y) <- ap(T3, | ||
+ | choose clause 1 under { T3/ | ||
+ | | ||
+ | yes(a) <- |