initiates(exec(move(R,Y)),at(R,Y),T):-
	holds_at(at(R,X),T),
	connected(X,Y),
	holds_at(status(battery(R),L),T),
	L > 0.

terminates(exec(move(R,Y)),at(R,X),T):-
	holds_at(at(R,X),T),
	connected(X,Y),
	holds_at(status(battery(R),L),T),
	L > 0.

initiates(exec(move(R,Y)),status(battery(R),L),T):-
	holds_at(at(R,X),T),
	connected(X,Y),
	holds_at(status(battery(R),Lold),T),
	Lold > 0,
	L is Lold - 1.

terminates(exec(move(R,Y)),status(battery(R),Lold),T):-
	holds_at(at(R,X),T),
	connected(X,Y),
	holds_at(status(battery(R),Lold),T),
	Lold > 0.

initiates(exec(charge(R,V)),status(battery(R),L),T):-
	holds_at(status(battery(R),Lold),T),
	L is Lold + V.

terminates(exec(charge(R,V)),status(battery(R),Lold),T):-
	holds_at(status(battery(R),Lold),T).





initially(at(rob,room1)).
initially(status(battery(rob),10)).

connected(room1,room2).
connected(room2,room1).
connected(room2,room3).


/*
Traccia di esempio da copiare:

move(rob,room2) 1
move(rob,room1) 2
move(rob,room2) 3
charge(rob,5) 4
move(rob,room3) 5
*/

