You are on page 1of 21

C ORSO DI I NTELLIGENZA A RTIFICIALE ( A . A .

2015/2016)
Prof. E. Giunchiglia
(13 June 2016)
Please answer using the space in between the questions.

Nome e Cognome: Francesca barale


Matricola: 4113133

1. Propositional Logic
There are three suspects for a murder: Adams, Brown, and Clark.
1. Adams says ”I didn’t do it. The victim was old acquaintance of Brown’s. But Clark hated
him.”
2. Brown states ”I didn’t do it. I didn’t know the guy. Besides I was out of town all the
week.”
3. Clark says ”I didn’t do it. I saw both Adams and Brown downtown with the victim that
day; one of them must have done it.”
Assume that the two innocent men are telling the truth, but that the guilty man might not be.
Write out the facts as sentences in Propositional Logic, and use propositional reasoning to
solve the crime.
Soluzione.
piani µ noie
1 7A a BK CH
2 TB a 7 Bk out
3 7C Aka BK n auff
B isthe nerdcrea
a con telling the
truth
PROVO IO
a Adam M nuoce s seen
B Brown K knows O ott
c warn it hates

Aly one is the murderer ama i BM a icm v


v 1AM n BM n i CM V

7AM ni BM n cm

1 7AM a BK n CH
2 IB Mn 7 Bk BO 2 sta mentendo
3 7cm a Bs nasa AM Bn

Bs Bh
T T
F T
F F
3. First order logic
Specify using the syntax of first order logic, the sentences corresponding to the following
natural language phrases:

1. ...
2. People only criticize people that are not their friends.
3. Everyone does not criticize someone.

Fill the dots with a phrase that does not entail the last phrase and that allows to conclude the
last phrase when used in conjunction with the second,introduce a suitable first order language
to formalize the three sentences and write down their first order formalization.
Soluzione.

1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3
5. Search
Consider the search problem with 6 nodes a, b, c, d, s and g in which
• a is connected to s and d with costs 10 and 1 (i.e., from a you can go to s with cost 10,
and to d with cost 1)
• b is connected to d, g, s with costs 4, 5 and 8
• c is connected to g, s with costs 5, 9
• d is connected to a, b with costs 1, 4
• s is connected to a, b, c with costs 10, 8, 9
• g is connected to b, c with costs 5, 5.
s is the start node and g is the goal node. For each node, the value of the h function is 0, 0, 4,
3, 0, 0, for nodes s, a, b, c, d, g respectively. We assume that nodes with the same value are
selected from the frontier in alphabetical order.
1. Design the tree explored by uniform cost and specify the sequence of nodes visited.
Soluzione.

2. Is the heuristic function h admissible? Explain why or why not.


Soluzione.

5
3. Design the tree explored by a⇤ and write down the sequence of nodes explored by a⇤ and
for each node specify its f value.
Soluzione.

6
1
io i his O
start I Na o
hi b 4
L 64 hai 3
Ncd 0
65 Ng o

49021

1
il
È 2

io 490 4

Il 7
22 B
I
8

ij s
14
io

Vis S b e 2,0 2,0 a d 8


PQ a d g b b s b s s S S

I take b frame p 0
I check is it su goal
no 7 expend it
In poi ho c 2 S d 9
minor costo C cosi no
a
expand

cosa in cui ti chiede di noi espandere prove che


hai già visitato
È
Io
ÌÌa non lo espando

visi s b c 2 0 li metto nelle liste


0,2 9 Ma non gli espando
PQ i
9b s s s

3 a
Vis S 2 d 2 b C 0 2 d 9
QQ 2 d 9 5,5 b b s b 5 S
da sab t NCD

µ
da sa a Ha da s a c t hic

io risorto a parrà di
I
io Ì costo
in eroine
si va

µ dj strabico lo
dice il testo

io 0
I 17
14
PROVO io

106 11
start
96 8 14
s

his O hic 3
Nia 0 Ncd O
WI b 4 ho Ig 0

1 Ntt expand least cost unexposed node

visi 5 b sa d a d 2,99

io 9
a
R B io 14
20 11

rsII.bOio
ed a
20 is

Infango 2210013 23 14
perche o a
alfabetico
14 17
a

P.Qijqgab.bg
2
atti costo twin

visi 52,0 a b c d 0,9

loto stato

20
solo e il 8 15
B
848
ÈTTI
16
814
e 12
91950915
18 o
14

I'È htt Hbo


14 14
Bg p
12110 12ft 13110 13 1
22 a 23 o
14
13g p
B ti Bt4
l4 4 21
17
P a d 9 S S b b S b S S
14 14 14 16 18 19 io vo M 22 23
PROVO IO

e ho s O

dèi a
b
o

4
I 15
Lj e

d
3
O

9 0

1 uniform cost seguace è nodes explored


le
least cost unexploded node

visi s b C 2,0 a d d
a
9

io

È e
Itis
O
5
X 23 È
4 È
poi
fissi torsi
2 Is the heuristic admissible

m
mode b 4 E 4
44 5
ok
Ok
ii È
mode c 34 5
4 E 8 ok
rode ci 3 I 9 ok
3 E 5 ok

e sia
visi 30,2 b e dia 0,9

IO 144 9 3 12

I
dso.IIYDoII
61
12 B
It
13 Ì 14 23

14 da 21 e

Pio fa poi fa I'fr Ì


6. Planning
Consider a graph like the one in the previous exercise but without costs.
• Write dows a STRIPS formulation that allows to model the reachability problem on such
a graph.
Soluzione.

• In the specific case of the graph of the previous exercise, specify its initial and goal state.
Soluzione.

• Write the search tree explored by a planning system using heuristic search with the empty
delete relaxation heuristics given the STRIPS formulatio, initial and goal states as in the
previous two questions. For each node n explored, write both the value of g(n) and h(n).
Soluzione.

7
PROVO io

start
Il
a
goal

Predicates at N corni Ni Na
action more CET
Precondition ATIF CONNIE
Effect AT IT TAT F

Initial state Aics


CONNCA s Counts A
noi necessarie canne a d Corinto a
le Icann A G
Cannes c i
7 AT D i
i Cannes B 1
perche Strips prevede
che tuttoqueiio che
CONN D B
rae'specificato e'i CONN B G
Connie G

Goal stati Atl G


01 2 2

1 1 2 11 1 2 gaiphobeh.cat
order c'era
santo
p
o
2 0 2 2 12 4 21 2 4

VIS S b 9
Pio c d s
7. Symbolic reachability
Given a system with 4 states:
s1 : ¬P, ¬Q; s2 : ¬P, Q; s3 : P, ¬Q; s4 : P, Q
and transitions:
s1 ! s2; s2 ! s3; s3 ! s4; s4 ! s1;

Assuming the initial states are s1 and s3:


• Write the OBDD representing the transition relation of the system
Soluzione.

• Compute the forward image computation using OBDDs of the initial states, expliciting
the intermediate steps.
Soluzione.

8
provo io

TTIP.is sa'Pill
P 54 S3 IP io

Paio nip Q v

iPaq n P'n Q v

paio a Pino v

Pn a 7 P'n 70

p p

Ìo otto
ok tip pt 0

ottica il

p p
o o

tipi pit o
I
Q 0 0 à

q
È
vodka
è te
P
Q Q

O tipi tipi
o Io odio
L a dì
1 0 0 1 1 0

p
Q Q

pi tipi pi tipi
o

oh O

TOTAL Abdo P
i

Q Q
n
pi
sì pi
pi

1
di
0

Provo io
Si Sai 17Pa 79 altra Q
52153 iPAQ al P'n 70
53 Sai Pinto n P'noi
54 Sii Pn Q Irpinia

Q Q
a a
pi pi pi pi
LI a
µ
0 O
I
X

I
voi ad
1
0 1
110

You might also like