You are on page 1of 11

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

2016/2017)
Prof. E. Giunchiglia, A. Tacchella
(27 June 2017)

Please answer using the space in between the questions.

First & Last name: FRANCESCA CANALE


Matricola: 4113133

1. Propositional Logic
There are three people (Alex, Brook and Cody), one of whom is a knight, one a liar, and one
a spy.
The knight always tells the truth, the liar always lies, and the spy can either lie or tell the truth.
Alex says: ”Cody is a liar.” Brook says: ”Alex is a knight.” Cody says: ”I am the spy.”
Who is the knight, who the liar, and who the spy?
Write out the facts as sentences in Propositional Logic, and use propositional reasoning to
solve the puzzle.
Soluzione.
any one is the Knight aka 7812 NICK v

Tak n BK a 7 Ck v
Tak a 7 Bk a CK

any one is the liar i al n TBL a 7 Cl v


7 AL n BL 7 Cl v
7 Al n 7 BL a CL

any one is the i Las nibs a 7 Cs v


Spy
has a Bs 7 Cs
7 as a 7 Bs a Cs

each person could be da knife a andar


spy
aka 7 AL n 7 As v i aka al n ras v i aka 2 Ala AD

BK a 7 BL a 7 Bs v i BK a BL n 7Bs v i BK a LABS

CK a 7 CL a 7 Cs v lick a CL n 7 Cs v lick a 2 Claes

if a is the Knight
A is letting the truth I c is the car
B is the spy
aka CL a Bs

if B is the Knight
Bis letting the truth a is the Knight
Aka BK va contro caid
if C is the Knight
c is telling the truth E C is
spy
va contro
ok a Cs X
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 6, 7 and 9
• c is connected to g, s with costs 6, 10
• d is connected to a, b with costs 2, 4
• s is connected to a, b, c with costs 10, 9, 9
• g is connected to b, c with costs 6, 5.

s is the start node and g is the goal node. For each node, the value of the h function is 1, 4, 5,
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 trees explored by iterative deepening up to height 2 using uniform cost and
specify the sequence of nodes visited.
Soluzione.

2. Design the trees explored by iterative deepening up to height 2 using A⇤ and specify the
sequence of nodes visited.

5
Soluzione.

3. When using iterative deepening with A⇤ , is the solution found guaranteed to be optimal
for any search problem? Justify your answer.
Soluzione.

6
Provo io

n s 1

SI Mio
Ti a

b e
4
5

È LÀ 45 e 3
d 0
g O

1 ITERATIEDEEPINGEI
visi s b e a d d 9

io
It
20 io trotto
X X X
pQ 9 S s s
2

visi s C 2 d b d 9

ah ste È
IX
II EEsOst.Is
XIIgBXi6P.Q
9,5 5,5
3
6. Planning
Consider a scenario where you want to get from home (off campus) to the University during a
bus strike going through various locations which have to be connected. You can go from one
location to another either driving if you have a car, or running. Further, assume that some of
the connections you may have to go through cannot be crossed by car.

• Write dows a STRIPS formulation that allows to model the above problem.
Soluzione.

Predicate at A
nonni A B
Have
CAR crossedl'AIB

Actions
Tt
Precondition atta pre aria
carina B conn la B
Have c
effects a B CAR crossed B
AT A elfi ATB
AT a
• In the same assumptions as before, write the explanatory frame axioms for your state
variables.
Soluzione.

7
Reni la B Ati a n con i LABI
o
Run i ta B latita B Natia a
drive e la B c lati a a comica B a Havei c
a S

insana c

Exploratory
latita a natia la V runica y v Drive la y c
y
nati I B natia B Rumi Y B v Drivei 14 B

Conflict CEA
Roni y y a Remi Y y y yy
1 Ironica yin Roni fa y e è
Drive il a y c a drive i y y c y y
Drive il a y c a drive i ri y c e ai

I pini y y a Drivei ta y c

Classical
Runica B Ati c atti d
Darei la B c Atilio as AT ie D
Rari AP con i ca B con i la B
i
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 ! s2; s2 ! s1;

Assuming the initial states are s1 and s2:


• 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
Si 52 7pm 70 alpino
52953 iPAQ n Pinto
53 sai 1 PM n spin Oil
52 Si iPAQ in Irpinia
p
i

Q Q
i I
pi q
o
L
0 0
I 1

1 0

You might also like