use robot as knowledge. module robotEvents { % Update the agent's state of movement. forall percept(state(NewState)), bel(state(State), State \= NewState) do delete(state(State)) + insert(state(NewState)). % Record when we are entering or leaving a room. if bel(in(Place)), not(percept(in(Place))) then delete(in(Place)). if percept(in(Place)), not(bel(in(Place))) then insert(in(Place)). % do what is asked and reply. forall (Someone).sent:(msg(imp(in(Me,Room)))), bel(ownId(Me)) do adopt(in(Room)) + (Someone).send(msg(ontheway)). % Exercise 2.1b: insert rules for handling percepts other than "sendonce" percepts. % Exercise 2.5b: insert code for goal management that allows an agent to systematically search for blocks. (if needed) % Exercise 2.6b: insert code for goal management that makes the agent deliver a block when it % knows about a block that can be delivered. (if needed) }